I am new to flash/AS2, and was trying to make a youtube video gallery in flash AS2.0. I've created one movieClip with name "video_mc" and creating child clips inside, to load youtube movies on release of buttons ("video_btn01" and "video_btn02"). Here is my code.
var vidId:String = "";
function createMovieInstance(mid){
var mclip:MovieClip = video_mc.createEmptyMovieClip("v", _root.getNextHighestDepth());
mclip.loadMovie("http://www.youtube.com/v/"+mid+"&autoplay=0");
}
video_btn01.onRelease = function(){
vidId = "iRaR7O1wNGg";
createMovieInstance(vidId);
}
video_btn02.onRelease = function(){
vidId = "h22OsQONU3M";
createMovieInstance(vidId);
}
Movies are getting loaded properly, but the first loaded movie will be playing in background while the next is getting loaded, because i'm creating another clild movie clip and loading the second movie, while the first one is getting played in another movieClip instance. So need to find the running movieClip and unload it. It would be great if somebody can assist me how to overcome this issue. Cheers!..