views:

393

answers:

2

Hello, I'm trying to load a YouTube video on a flash MovieClip using url http://www.youtube.com/v/4nRNoXT%5FgUc that returns the video with player directly.

the video is loaded and i can manage it with his player, the problem is when i try to position it no the stage, because I don't know his width until it starts.

I've tested it with Event.ENTER_FRAME but when the video starts it return width = 10000 how can i do to know his width or height?

A: 

You can retrieve the movie's nominal width and height through the loader's contentLoaderInfo object. Just try the following :

trace(loader.contentLoaderInfo.width);

The nominal width and height of your movie is 640x480. You will notice, however, that the movie is being scaled down (probably by YouTube, would need to be confirmed).

Also, be aware that what is returned by YouTube is an AVM1Movie object. An AVM1Movie object is an SWF that was compiled under ActionScript 2 (in YouTube's case, most likely Flash version 8). The interaction that is possible with an AVM1Movie object is much more limited than that of a regular AS3-based swf file.

Djip
A: 

these youtube pigs!

aaa