Quiz Template Guru Needed for Multiple Questions: 3) I've seen many solutions, elaborate and simple, can't get this simple "openWindow" to work.

Greetings,

I'm working on a Flash Test and need some urgent assistance. All questions easy or hard (as a newbie to actionscript, who am I to say?) will have 500 pts. assigned.

You can download the .fla at http://mywebniche.com/test/openWindow/openWindow.zip

The test can be seen at http://mywebniche.com/test/openWindow/openWindow.html (updated since original posting -- sorry, forgot to include the script in the head !-)

Here is the script:

Put the following action in your button:

on (release) {
    getURL ("javascript:openWindow()");
}

and the following script between your head-tags in the html document containing the Flash Movie object:

<head>
<script language="JavaScript" type="text/javascript">
<!--
function openWindow()
{
  newWindow = window.open('newWindow.html','myWindowName','width=550,height=400,top=0,left=100,resizeable=yes,toolbar=no,menu=no,scrollbar=no')
}

//>
</script>
</head>
 
Of course I've changed the name of newWindow.html, the actual file is pdc_Table.html and it is at the same directory level as the openWindow.html file (containing the Flash Quiz).

The script in the openWindow.html file is full of SCORM related chicken scratchings, but the newWindow code is right at the top of the <head> tag so you can find it easily.

Why doesn't the bugger work?

regards,

stevenjs
_______________________________
"I am but an egg."
--Stranger in a Strange Land

PS: Previous Question in this series can be found at http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21805819.html
stevenjsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nifmcmCommented:
it works in firefox, but in not IE.. the issue isn't the openWindow function though (works fine if you setup a test without all the other script)... it seems there is an issue with some other javascript on the page:

Error: uncaught exception: Permission denied to get property Window.API... (firefox exception).

so, IE is stopping all script running because of that issue, including your openWindow function.
firefox still runs working scripts, so openWindow function runs.

hope this helps.
0
stevenjsAuthor Commented:
Thank you, nifmcm, for your thoughtful response.

I am not sure I understand what you are saying about IE, however.

I have saved a copy of the .fla as openWindow2 and re-published it with the html set to "Flash Only." See  http://mywebniche.com/test/openWindow/openWindow2.html

If I ad the script to the head tag,

<script language="JavaScript" type="text/javascript">
<!--
function openWindow()
{
  newWindow = window.open('pdc_Table.html','myWindowName','width=600,height=500,top=0,left=72,resizable=yes,toolbar=no,menu=no,scrollbars=no')
}

//>
</script>

the Flash no longer appears at all in  IE !! ??

I also tried re-publishing the .fla with the html set to "Flash with FSCommand," likewise, the movie disappears if the script is added to the <head>, but if added to the body, the movie at least appears in IE, though the popup link still does not work. The quiz at the original URL -- http://mywebniche.com/test/openWindow/openWindow.html -- is currently this "with FSCommand" incarnation. The .fla in the Zip has not been changed, so you can download it and re-publish it with different html settings yourself.

I guess I need to rephrase the question, since there seems to be so much going on here that is beyond my comprehension:

Can someone show me how to get this popup to work in this quiz any which way under the sun?? As fed up as I am with IE, I don't have the liberty to require a particular browser to take this test (it is really 30 questions, I isolated the ones with the popups for ease of debugging). So it has to work in IE and Firefox both. The simpler the scripting the better.

This is urgent. Thank you.

regards,

stevenjs
_______________________________
"I am but an egg."
--Stranger in a Strange Land

0
nifmcmCommented:
hi stevenjs,

what i origionally meant was that the problem did not appear to be your openWindow function, but some other part of the javascript running on your page. sorry to confuse with all the IE this and firefox that... just trying to say that ithe openWindow function works and the error thrown appears to be a problem with some other part of the script.

however, i have just tried one or two things locally and am not getting it to work in either IE or firefox.
i can't open your file as i think it is flash 8? not yet purchased and trial expired :P

i can view your swf in IE and in firefox, but think i've snatched the swf running fscommand and not the one calling openWindow as now the call to the js function is not working.

try creating a new plain html page and pasting the code below and putting in a new directory (possible caching issues)... then revert to the getURL("javascript:openWindow()"); call in your flash and put the compiled swf in the same dir as html and making sure it is called openWindow.swf

test that and see if it works... if it does, then you know the issue isn't the openWindow function.

sorry i can't be of more help, but i am a bit in the dark still about a few things as i can't open the fla and i found that copying your html source caused the swf not to display and i cannot see a reason for it. but working with a fresh file and my own flash object call, it works fine.

will try help more in the morning when my head isn't quite so foggy :)

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stevenjsAuthor Commented:
Thank you once again for your efforts, though I'm sorry, I still can't quite make sense of what you're saying. I'm just not at your level.

In any event, I tried inserting the .swf into a plain HTML page in Dreamweaver, as you sort of seemed to be suggesting, without publishing any html out of Flash. I then added the openWindow script into the head section. The movie appears and although it did not work in preview on the computer, voila ! it works online. You can see this version at http://mywebniche.com/test/openWindow/openWindowPlain.html

Hurray ! Do you deserve the points, nifmcm? A for effort, but the specific problem was never identified, and it was only by taking your words "try creatinjg a new plain html page" and ignoring the rest of the comments that I came up with something that works.

Sometimes though, that's all it takes is a phrase of feedback. Thanks !

regards,

stevenjs
_______________________________
"I am but an egg."
--Stranger in a Strange Land
0
nifmcmCommented:
hehe:) well i am glad i could help, even if it is indirectly, and thanks for the points... much needed (i still can't access solutions) :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.