Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Flash youtube error

Explorer ,
Dec 13, 2014 Dec 13, 2014

Can anybody tell me what I am doing wrong.

I drug an FLVPlayback to the stage, made it a movie clip and gave it an instance name of my_player then put in the code below and I get the following error.

Security.allowDomain("www.youtube.com");

var my_playerbject;

var my_loader:Loader = new Loader();

my_loader.load(new URLRequest("https://www.youtube.com/watch?v=dnkTYGkoUEc"));

my_loader.contentLoaderInfo.addEventListener(Event .INIT, onLoaderInit);

function onLoaderInit(e:Event):void{

addChild(my_loader);

my_player = my_loader.content;

my_player.addEventListener("onReady", onPlayerReady);

}

function onPlayerReady(e:Event):void{

my_player.setSize(640,360);

my_player.cueVideoById("dnkTYGkoUEc",0);

}

TOPICS
ActionScript
347
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2014 Dec 14, 2014

remove the flvplayback component from your library.

try:

Security.allowDomain("www.youtube.com");

var my_player:Object;

var my_loader:Loader = new Loader();

my_loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));

my_loader.contentLoaderInfo.addEventListener(Event .INIT, onLoaderInit);

function onLoaderInit(e:Event):void{

addChild(my_loader);

my_player = my_loader.content;

my_player.addEventListener("onReady", onPlayerReady);

}

function onPlayerReady(e:Event):void{

my_player.setSize(640,360);

my_player.cueVideoById("dnkTYGkoUEc",0);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2014 Dec 14, 2014

That works great but it pops up in the upper screen left corner is there any way I can get it to the center of the stage?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2014 Dec 15, 2014
LATEST

i'm sure there is.  just check the google api.

(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines