| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2006
Location: Dallasish
Posts: 8
|
Scale a symbol with AS
I need to use action script to scale and object in the viewport. all the examples of this i find use the mouse position to start the even onclick. i do want to click on the button, but i want it to zoom from where it is not where the mouse it. an example would be a map of the US. click on Texas and it would zoom to fill the viewport. I know I can animate that with tweens, but I really don't want to do that. Any hints in the right direction will be appreciated. |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Jul 2006
Location: Dallasish
Posts: 8
|
its a map of the us. i need to make each state clickable. thats not a problem. i do want them each to call some javascript as well as scale to the size of the viewport. there will also be some points plotted to each state, but thats not the scale thing. |
|
|
|
#4 (permalink) |
|
Moderator
Join Date: Oct 2004
Location: Bristol
Posts: 3,291
|
use _xscale and _yscale to scale the symbol and use _x and _y to position it correctly, so for each state you would define variables for _x,_y and the scale. Then place them in a function which would move/enlarge the symbol to the defined variables in increments (if you half the distance each time this will have an easing in effect). Use setInterval to make it animate. |
|
![]() |