Go Back   kirupaForum > Flash > Flash CS3

Reply
 
Thread Tools Display Modes
Old 11-27-2009, 07:39 AM   #1
nallath
Registered User
Zooming/panning multiple movieclips

There are tons of example explaining how to zoom/pan a single movieclip, but im looking for a way to zoom AND pan multiple movieclips.

So far ive been able to zoom or pan, but not both at the same time.

Im using this for the zooming and works perfectly. But how can i let the movieclips pan properly with a maximum pan?

Code:
public function zoom(action:String) {
 var zoomType:Number;
 var scaleType:Number;
 if(action == "in"){
  zoomType = 1.01;
  scaleType = 0.99;
  zoomed += 0.01;
 } else if(action == "out"){
  zoomType = 0.99;
  scaleType = 1.01;
  zoomed -= 0.01;
 }
 for (var i:int = 0; itemArray.length >i; i++) {
  itemArray[i].x = mouseX - ((mouseX - itemArray[i].x)  * zoomType);
  itemArray[i].y = mouseY - ((mouseY - itemArray[i].y) * zoomType);
  itemArray[i].scaleX /=scaleType;
  itemArray[i].scaleY /= scaleType;
}
nallath is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 -4. The time now is 06:10 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com