...

View Full Version : Resizing an SWF after loading it



losse
03-13-2009, 01:54 PM
Hi
I have a movie that loads SWF files using the following


on(release){
loader.loadMovie("video.swf")
}

the video that I am loading is fairly big and I want to resize it when it's loaded... Is there a way to set the width and height in the "loader" so that the video loads a certain heigh and width?

Thanks

Stooshie
03-13-2009, 06:03 PM
add an event listener before loading it:


loader.addEventListener("ready", loaderReadyHandler);
on(release){
loader.loadMovie("video.swf")
}

then write the loaderReadyHandler method


private function loaderReadyHandler(_event:Event):void
{
// work out the loader object from the event
var _loader:Loader = (_event.currentTarget as Loader);
_loader.height = 200;
_loader.width = 200;
}

hope that helps

losse
03-13-2009, 07:42 PM
Where would I put the loaderReadyHandler ??

Stooshie
03-25-2009, 04:11 PM
Straight after the first bit of code:


loader.addEventListener("ready", loaderReadyHandler);
on(release){
loader.loadMovie("video.swf")
}

private function loaderReadyHandler(_event:Event):void
{
// work out the loader object from the event
var _loader:Loader = (_event.currentTarget as Loader);
_loader.height = 200;
_loader.width = 200;
}

hope it helps!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum