FlyingCat
FlyingCat

Reputation: 14250

How to specify width and height when loading external swf file?

I am trying to load an external swf file. The swf width and height is small and I want to enlarge it when loading it. (My scene has large width and height). My current code could load the file but I am not sure how to enlarge the swf width and height. I would appreciate if anyone can help me about it...Thanks

var request:URLRequest = new URLRequest("index.swf");
var loader:Loader = new Loader()
loader.load(request);

addChild(loader);

Upvotes: 1

Views: 2061

Answers (1)

sunetos
sunetos

Reputation: 3508

The Loader class is a DisplayObject (which is how you can add it to the stage). You should be able to just set the width and height of your loader:

loader.width = 50;
loader.height = 50;

UPDATED: Make sure to read the comments about width vs. scaleX and being loaded or on the stage.

Upvotes: 4

Related Questions