Jump to content


Photo

scaling images actionscript


  • Please log in to reply
2 replies to this topic

#1 darkson01

darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 13 May 2009 - 05:56 AM

quick question: when making a image smaller through actionscript, is there a way to keep the height to width pixel ratio and keep it a good resolution? a.k.a so it's nots all pixelated and shows it's obviously been de-scaled.

cheers

#2 GRIMESD

GRIMESD

    Young Padawan

  • Members
  • Pip
  • 10 posts
  • Gender:Male
  • Location:Upstate New York
  • Interests:I have been working with web design for a few years now and recently gained much interest in flash. I am self-teaching myself AS3 while also giving tutorials to help others out with what I have learned.

Posted 19 August 2009 - 08:39 AM

The only way you would be able to do this is to is to make sure that you decrease your x and y proportionally to keep image restraints.

For example... If you have an image that is 800 x 600. And you want that image to be at a width of 500 instead..

Bad Code .. >
whatever.x = 500;
whatever.y = 600;

Good Code ..>
whatever.x = 500;
whatever.y = 300;


good luck!

#3 dragonjeteo

dragonjeteo

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 25 August 2009 - 08:50 PM

have you tried using the movieclips's _xscale and _yscale properties?

mc._xscale = 60;
mc._yscale = 60;

the number sould be the percentage you want it scaled.
100 is the original size. Cheers blues!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users