Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-13-2009, 01:54 PM   PM User | #1
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
Resizing an SWF after loading it

Hi
I have a movie that loads SWF files using the following

Code:
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
losse is offline   Reply With Quote
Old 03-13-2009, 06:03 PM   PM User | #2
Stooshie
Regular Coder

 
Stooshie's Avatar
 
Join Date: Mar 2008
Location: Dundee, Scotland
Posts: 376
Thanks: 9
Thanked 39 Times in 39 Posts
Stooshie is on a distinguished road
add an event listener before loading it:
Code:
loader.addEventListener("ready", loaderReadyHandler);
on(release){
	loader.loadMovie("video.swf")
}
then write the loaderReadyHandler method
Code:
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
__________________
Regards, Stooshie
O
Stooshie is offline   Reply With Quote
Old 03-13-2009, 07:42 PM   PM User | #3
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
Where would I put the loaderReadyHandler ??
losse is offline   Reply With Quote
Old 03-25-2009, 04:11 PM   PM User | #4
Stooshie
Regular Coder

 
Stooshie's Avatar
 
Join Date: Mar 2008
Location: Dundee, Scotland
Posts: 376
Thanks: 9
Thanked 39 Times in 39 Posts
Stooshie is on a distinguished road
Straight after the first bit of code:
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!
__________________
Regards, Stooshie
O
Stooshie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:16 AM.


Advertisement
Log in to turn off these ads.