简体   繁体   English

调整加载的 swf AS2

[英]Resize loaded swf AS2

I am trying to resize a swf file that is loaded into a loader_mc clip.我正在尝试调整加载到 loader_mc 剪辑中的 swf 文件的大小。 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.不过,只要我这样做,swf 就不会加载。

I can do it like this however, but it does not use _width, which is what I need.但是我可以这样做,但它不使用_width,这是我需要的。

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. IIRC flash 在您使用 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.load_mc.loadMovie(swfUrl); outer_mc.width=210; external_mc.width=210; outer_mc.yscale=175; external_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:使用 AS2 加载 MovieClips 的一种更舒适、更推荐的方法是 MovieClipLoader,它有一个事件可以轻松完成此操作:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM