View Full Version : Video Question
TheSheriff
05-31-2006, 02:20 PM
Below is part of some code I am using to play some videos in Flash
var videos:Object = new Object();
videos.list = new Array();
videos.list[0] = "01.flv";
videos.list[1] = "02.flv";
videos.list[2] = "03.flv";
videos.list[3] = "04.flv";
videos.list[4] = "05.flv";
Is there anyway to set up an 'if' statement so I can have another movie clip do something based on which video is playing in the array?
mcmcom
05-31-2006, 04:15 PM
yes you can.
if(myMoviePlayer.contentPath = "05.flv"){
myTextbox.text = "Video 5 is Playing";
}
that code is just to give you an idea. You basically check the value of however you load the video (i dont know what component your using so i dont know the exact properties) but there should be one that tells you whats in the video player (you must use LoadMovie or AttachVideo or some sort of method that assigns the video to the player) just formulate your if statement to look at what contents in the video player.
hth,
mcm
TheSheriff
05-31-2006, 09:05 PM
Well this works to an extent. i am using the flvPlayback component and loading in multiple movies. When I use this code
if(myPlayer.contentPath = "01.flv"){
btn01.gotoAndStop(2);
}
if(myPlayer.contentPath = "02.flv"){
btn02.gotoAndStop(2);
}
if(myPlayer.contentPath = "03.flv"){
btn03.gotoAndStop(2);
}
I would like it to do the following:
When video 01 plays btn01 goes to frame 2
When video 02 plays btn02 goes to frame 2 etc
Right now it looks like all of the btn's go to frame 2 onload.
mcmcom
05-31-2006, 09:18 PM
your if statement is messed up
change the one equal sign to two of course all would change your actually ASSIGNING the content of all three clips to the statement.
ie
//one equals means ASSIGN, TWO means EVALUATE
if(myPlayer.contentPath == "03.flv"){
hth,
mcm
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.