PDA

View Full Version : executing javascript from swf movie



thumper
September 7th, 2003, 02:05 PM
Hi, hope someone can help, I have two large doors slamming shut and would like to execute the browser shake javascript function hardcoded into the html page for about 0.1 - 0.2 seconds.. just enough to shake the window when the doors slam shut.

How do I call the shake() function that is on the same html document as the swf object? Not from a button press, but from an event (ie certain keyframe reached).

This will also help me for opening popups etc...

Thanks a bunch!

λ
September 7th, 2003, 02:12 PM
getURL("java script:functionName(params)");

no space, the board messes up the word java script. turns it into about. also, you have to use a slash / if you want to use " in th function.

Voetsjoeba
September 7th, 2003, 02:23 PM
Here's an example:

thumper
September 7th, 2003, 03:01 PM
Thanks all, but one last question: I don't have a user generated event to launch the getURL:javascript, I need it to happen at a certain frame in the preload transition (the door slam). Any ideas? I'm thinking some sort of clip event, like enter frame number? Total newbie here.

Thanks,

claudio
September 7th, 2003, 04:04 PM
Apply the getURL action to the frame you want it to happen.