Problems with creating popup window in Flash...

  • FlyHigh5
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14

Post 3+ Months Ago

Hi,
I am trying to create a popup window. I've googled the topic, I've also found posts in this forum, but when I add the:

helpBtn_mc.onRelease = function() {
getURL("javascript:openNewWindow('help.html','Help','height=400,width=400,toolbar=no,scrollbars=yes')");
}

to the button (in my generateHelp.fla) which triggers the popup window, and add the following code to my help.html file, just after the <head>

<SCRIPT LANGUAGE=JavaScript>
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}
</SCRIPT>

and run my movie generateHelp.fla, I get the following error message:

Safari can’t run the script “openNewWindow('help.html','Help','height=400,width=400,toolbar=no,scrollbars=yes')” because Safari doesn’t allow JavaScript to be used in this way.

I am very new to action script & Flash, and I don't know what step I am missing that causes this error.

PLEASE HELP!!! I have spent a long time, and have tried different versions of suggestions, but get the same error message, and can't resolve this on my own.

Thanks for your help.
Cheers.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

in actionscript, use external interface:
Code: [ Select ]
import flash.external.ExternalInterface;
helpBtn_mc.onRelease = function() {
ExternalInterface.call("openNewWindow", "help.html","Help","height=400,width=400,toolbar=no,scrollbars=yes");
}
  1. import flash.external.ExternalInterface;
  2. helpBtn_mc.onRelease = function() {
  3. ExternalInterface.call("openNewWindow", "help.html","Help","height=400,width=400,toolbar=no,scrollbars=yes");
  4. }

javascript code remains the same.
Just test your code on a server, otherwise on local you will get something like: Adobe Flash Player has stopped a potentialy unsafe operation blah blah.
  • FlyHigh5
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14

Post 3+ Months Ago

Thanks so much for your help IceCold. I tried the code. Nothing happens locally. I am still developing other parts, but once I am done, will try it on a server.

Take care.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.