Problems with creating popup window in Flash...

  • FlyHigh5
  • Newbie
  • Newbie
  • User avatar
  • Joined: Oct 04, 2009
  • Posts: 14
  • Status: Offline

Post October 4th, 2009, 8:57 pm

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.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 4th, 2009, 8:57 pm

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post October 5th, 2009, 5:19 am

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.
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • FlyHigh5
  • Newbie
  • Newbie
  • User avatar
  • Joined: Oct 04, 2009
  • Posts: 14
  • Status: Offline

Post October 5th, 2009, 3:27 pm

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 30 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.