开发者

Flash: Loadmovie() in a specific width and height?

i'm using loadmovie() to load a youtube video player inside my flash website but i want to specify the width and height so it can fit my box.

This i开发者_JAVA技巧s my code:

vloader.loadMovie("http://www.youtube.com/v/Alw5hs0chj0&hl=fr&fs=1hJ-mPcGtC");

I have an empty CLIP called "vloader" where i load the video player.

Note: it is recommended that i get a code in Action script 1.0

Thanks


When you load an external movie, you can't specify before in what size it will appear later. After the movie is loaded, Flash is able to get its real size and only then you can change its size. So if you want to display a movie in a different size, you will need to load it, and change the size when it is fully loaded and ready for being displayed.

However by using ActionScript 1, finding out when a movie is completely loaded is very hard, so it would be better if you would move to AS2 (with its MovieClipLoader object) or even AS3 (with its Loader class).


If you're loading a video from YouTube you could take a look at their Player API Reference here: http://code.google.com/apis/youtube/flash_api_reference.html

From your question I can guess you've not used AS3 at all, I can highly recommend Colin Moock's book Essential Actionscript 3 to get you up to speed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜