Play 2nd flash video after the first endings

I have a Flash object installed in the standard format:

<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> swfobject.embedSWF("swfplayer.swf", "myContent", "300", "120", "9", "expressInstall.swf"); </script> 

but I want to start playing the second flash video on another part of the webpage when the first video ends. Is there any kind of listener?

thanks

+4
source share
3 answers

There is actually a way to do this by providing you with a movie more or less time-based. There are a couple of calls you can make to a Flash object via javascript, which will return you values ​​that you can check to determine if the movie is complete.

To get the current frame of a movie, use:

 document.getElementById("myFlashObject").TCurrentFrame("_root"); 

To check if movie playback is being used:

 document.getElementById("myFlashObject").IsPlaying() 

If the movie is stopped in the frame using the "stop ()" method, this will return false. There are many other methods that you can use, as well as what you may find useful when playing another movie. Here is a link to Adobe reference documents:

http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html

Note: I tested this and it works with flash player 10 in firefox. You can double check the compatibility of these methods with multiple browsers.

+2
source

You can approach it from these two possibilities: LocalConnection or ExternalInterface .

I would go with ExternalInterface personally. With it, you can set up a javascript function that receives a call from videoPlayer_1 when its video ends. To this javascript function, you can pass an identifier to determine which player has finished, and then send a call back to the appropriate next player to start playing. You can repeat this process as many times as you have / swf with the video.

I would include an example, but you did not mention as2 or 3.

As for LocalConnection , you can create a movie group with a local data connection, but it can be easily broken by certain scripts of several browsers / swf, so this is probably not the most reliable method. However, if you want to take a picture, look at the Grant Skinner SwfBridge class to make things a lot easier.

+1
source

Source: https://habr.com/ru/post/1332051/


All Articles