Copy link to clipboard
Copied
I have searched and read and searched some more, but have had no luck . . . could be because I'm new to Flash and Action Script and don't know enough to know what terms to search for.
I'm authoring in Flash CS4 using Motion Tweens.
Here is the situation. I have a JavaScript that closes the DIV containing my flash object. It currently closes after 15 seconds. That is supposed to be how long the Flash movie lasts. however, slower machines run the movie longer. this means the flash object closes too quickly and they don't see the entire movie . . . if I increase the time, the users of fast machines have to wait around awhile for the movie to disappear.
So, I would like the movie to execute the javaScript when it gets to the last frame.
Copy link to clipboard
Copied
please don't cross-post. in fact, ignore your duplicate message in the as1/as2 forum.
on the last frame of your swf, you can call your javascript function using the flash externalinterface class.
Copy link to clipboard
Copied
Sorry about the cross post. I thought I only selected Action Script 3. This is my first post and I am new to Flash.
The issue is that I cannot determine how or where to put externalinterface class. I have clicked around, but not found where to put the code such that it attaches itself to the last frame of any tween. I clicked on Commands and tried Run Command..., but I'm not sure if putting the command in a file and then clicking OK will do it.
I looked at the Actions dialog, but it says my current selection cannot have actions applied to it.
Copy link to clipboard
Copied
you don't put the class anywhere. you just use its methods. i don't think you even need to import it when using as3:
ExternalInterface.call("yourJSfunction", "any variable(s) you want to send");
Copy link to clipboard
Copied
Sounds great. Where do you type it such that it executes on the last frame of a Motion Tween?
Copy link to clipboard
Copied
create a keyframe at the end of your tween (using a different layer) and, place the code there.