Forum Moderators: open

Message Too Old, No Replies

Multiple Flash Movies On One Page

How to detect and kill running movie

         

StupidScript

10:38 pm on Oct 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Let's say that there are 2 video clips with audio converted to separate Flash movies.

I put both Flash clips on a single page, side by side. (The visitor clicks on either movie to start its playback.)

Clip #1 starts when clicked, and the video plays and the audio comes out of the speakers.

Without stopping or pausing Clip #1, the visitor clicks on Clip #2, and it also starts playing while Clip #1 continues to play.

Problem: Neither Flash movie has dominance; both videos play ... and both audio tracks play ... at the same time.

How can I change this behavior?

I want Clip #1 to play only as long as another clip is not playing. When Clip #2 is clicked-to-start while Clip #1 is playing, I want Clip #1 to pause or rewind and stop. Likewise with Clip #2; if Clip #2 is playing and Clip #1 starts = kill Clip #2.

Thanks!

[edited by: StupidScript at 10:40 pm (utc) on Oct. 11, 2006]

ahmedtheking

10:00 pm on Oct 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right, I know there's a way to do this in action script. Basically, when you embed the flash, you give it a name, id or target (id is best, totally valid!). Through Actionscript, you just tell it to disabled the other(s) apart from itself. That should work. Without a bit of googling or reading, I can't say off the top of my head but I know this can be done!