开发者

Resize loaded swf AS2

开发者 https://www.devze.com 2023-03-18 18:27 出处:网络
I am trying to resize a swf file that is loaded into a loader_mc clip. I have tested this in two ways so far:

I am trying to resize a swf file that is loaded into a loader_mc clip. I have tested this in two ways so far:

load_mc.loadMovie(swfUrl);
load_mc._width=210;
load_mc._yscale=175;

Soon as I do this though, the swf does not load.

I can do it like this however, 开发者_开发技巧but it does not use _width, which is what I need.

load_mc.resize_mc.loadMovie(swfUrl);
load_mc.resize_mc._xscale=50;
load_mc.resize_mc._yscale=50;

Thanks!


IIRC flash replaces a movie clip after you loaded something into it with loadMovie. Thus all settings of the original movieclip are lost. If you want to fix that issue that would mean that you either add an outer container which you resize:

outer_mc.load_mc.loadMovie(swfUrl); outer_mc.width=210; outer_mc.yscale=175;

or you wait until the movieclip is loaded before you resize it.

A comfortable, more recommended way to load MovieClips with AS2 is MovieClipLoader that has an event to do this easily:

http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002001.html

0

精彩评论

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

关注公众号