|
-
 Originally Posted by angelhdz
Thanks fruitbeard! You saved me time 
Thank you both
I think it's solved
the "removeChildAt" didn't seem to work 100%. The image disappeared but not the sound.
i added a pauseVideo() to shut it up !
for now then, i'm loading 2 vids, one after the other with the subtitles forced to appear, so thank you to you both for your kind help.
now i'm going to try and get the player stopping and starting 7 videos, so .... we will see what happens !!
Thanks again....below is what I've ended up with so far.
very best regards x
/////////////////////////////////////////////////////////////////
Security.allowDomain("www.youtube.com");
var my_player:Object;
var my_player2:Object;
var my_loader:Loader = new Loader();
var my_loader2:Loader = new Loader();
load_btn.addEventListener(MouseEvent.CLICK, loadNext);
function loadNext(e:MouseEvent):void {
my_loader.load(new URLRequest("http://www.youtube.com/v/video ID 1?version=3&cc_load_policy=1"));
my_loader.contentLoaderInfo.addEventListener(Event .INIT, onLoaderInit);
while (my_player2.numChildren > 0)
{
my_player2.removeChildAt(0);
my_player2.pauseVideo();
}
}
function onLoaderInit(e:Event):void{
addChild(my_loader);
my_loader.x = 170;
my_loader.y = 50;
my_player = my_loader.content;
my_player.addEventListener("onReady", onPlayerReady);
}
function onPlayerReady(e:Event):void{
my_player.setSize(550,400);
my_player.loadVideoById("video ID 1",46);
}
load_btn2.addEventListener(MouseEvent.CLICK, loadNext2);
function loadNext2(e:MouseEvent):void {
my_loader2.load(new URLRequest("http://www.youtube.com/v/video ID 2?version=3&cc_load_policy=1"));
my_loader2.contentLoaderInfo.addEventListener(Even t.INIT, onLoaderInit2);
while (my_player.numChildren > 0)
{
my_player.removeChildAt(0);
my_player.pauseVideo();
}
}
function onLoaderInit2(e:Event):void{
addChild(my_loader2);
my_loader2.x = 170;
my_loader2.y = 50;
my_player2 = my_loader2.content;
my_player2.addEventListener("onReady", onPlayerReady2);
}
function onPlayerReady2(e:Event):void{
my_player2.setSize(550,400);
my_player2.loadVideoById("video ID 2",46);
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|