Link to home
Start Free TrialLog in
Avatar of stevenjs
stevenjs

asked on

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 https://www.experts-exchange.com/questions/21805819/Title-Quiz-Template-Guru-Needed-for-Multiple-Questions-2-Serious-anomalies-when-testing-Quiz-artifacts-from-one-question-appear-on-others-Help.html
Avatar of nifmcm
nifmcm

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.
Avatar of stevenjs

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of nifmcm
nifmcm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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) :)