I'm not actually our flash guru. So, does anyone know a good way in Actionscript 3 to detect when an embedded .swf hits its end so we can advance to the next keyframe automatically? (There's a way built in to the .swf to fast-forward and rewind, so there's no guarantee it'll always take the same amount of time. Else, I'd just set it to wait a certain number of frames/seconds)
The MovieClip class has two properties that would be helpful here -- framesLoaded and currentFrame. Theoretically speaking, you should be able to do something like this:
Code:
if (mc1.currentFrame == mc1.totalFrames) {
trace("We're at the end, folks.");
}
More information: Adobe LiveDocs
The .swf in question has looping music at the end. Is that going to be an issue?
Depends on how the audio is looped. If it's frame dependent, then yes it will be a problem. If it's not, then it shouldn't be. I'd suggest removing the audio (actually, you'll just be able to mute it) from the embedded SWF and adding it to the container SWF. That way, it'll be seamless. Otherwise, you'll probably have a bit of a rough seam when the old SWF ends and the new one begins.
Bookmarks