how to check if a video has finished playing before loading another Swishmax 4.
Example:
Controls:
Right click on the video to switch between videos and to stop playing video.
First Of All:
You will need the vidoeObject from the components

if you cannot find it don’t know how to get it, Download the starter file below for swishmax 4.
|
|
download: videoObject (6.83KB) added: 01/08/2012 clicks: 82 description: Swishmax 4 flv Tutorial Starting file containing the videoObject from the components. |
Step.1
Group the videoObject as a movieclip and name it player

On Scene_1 add the following script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | function link2(){ player.my_ns.pause() } function link1(){ player.my_ns.play("video2.flv"); player.Count=2; } function link0() { player.my_ns.play("video1.flv"); player.Count=1; } onSelfEvent (load) { MENU = new ContextMenu(); MENU.hideBuiltInItems(); Message0 = new ContextMenuItem("Play Video 1",link0); Message1 = new ContextMenuItem("Play Video 2", link1); Message2 = new ContextMenuItem("Stop Playing", link2); MENU.customItems.push(Message0); MENU.customItems.push(Message1); MENU.customItems.push(Message2); _root.menu = MENU; } |
Step.2
add the following script to the player movieclip
1 2 3 4 5 6 7 8 9 10 11 | onSelfEvent (load) { var maxCount = 2; // how many number of flv's in the library var Count = 1; // starting number var my_nc : NetConnection = new NetConnection(); // new net connection my_nc.connect(null); var my_ns : NetStream = new NetStream(my_nc); videoObject.attachVideo(my_ns); // attach movie to netstream my_ns.play("video"+Count+".flv"); // loads movie from librabry my_ns.onStatus = function(info) { if (info.code == "NetStream.Play.Stop") { // checks if current netstream has finished playing if(Count |
Video files need to be name video1, video2, video3 etc
some sample flv video files can be found here
Buy this tutorial file via paypal £2.50
the file is for swishmax 4 and does not contain any flv video files.
[paiddownloads id="122"]
Social Connect
Login with one of the following.Enter your WordPress.com blog URL
http://.wordpress.com
Proceed