?
Solved

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

Posted on 2006-04-17
5
Medium Priority
?
506 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:stevenjs
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:nifmcm
ID: 16476163
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
 

Author Comment

by:stevenjs
ID: 16480428
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
 
LVL 3

Accepted Solution

by:
nifmcm earned 1500 total points
ID: 16482337
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
 

Author Comment

by:stevenjs
ID: 16488718
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
 
LVL 3

Expert Comment

by:nifmcm
ID: 16492396
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question