SixfootJames
SixfootJames

Reputation: 1871

Resize loaded swf AS2

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!

Upvotes: 0

Views: 2219

Answers (1)

Malte Köhrer
Malte Köhrer

Reputation: 1579

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

Upvotes: 1

Related Questions