Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

zooming error

Status
Not open for further replies.

ticke

Technical User
May 1, 2003
65
US
I am trying to figure out something but I have had much luck.. Can I get someone to look at the code and try to set a limit on this thing?

It's a basic zoom whereas it takes a movie clip and zoom it in and out. The zoom out seems fine but the zooming in has an error. If you zoom in too much it will literally take the movie clip and turn it upside down.

the link is at where you can even look at the .fla (test.fla)


Please help!!! :)

Thanks
 
are you sure your having the problem with zooming in? It seemed to work fine for me, I zoomed in until it was a big s curve and came to a crawl.

it will flip upside down if you zoom out too much though. What happens is your x and yscale goes below 0, which then keeps going into negative values, which shows a clip as inverted and starts growing as the negative value gets lower
 
Sorry, i have that backward. It's the zooming out that I am trying to figure out. how would you set it so that the movie clip stop zooming out when that variable reach 0?

Sorry about the confusion


 
i guess you're doing some enter frame action so
a simple if-statement should do it:
Code:
if (mymovieclip._xscale<0){
    mymovieclip._xscale=0;
    mymovieclip._yscale=0;
}else {
    mymovieclip._xscale-=1;
    mymovieclip._yscale-=1;
}

so the condition asks for the xscale-value, sets it to zero when it becomes less than zero and otherwise substracts the value you use (in my case it's 1).
would work for other methods as well, like _width, _height, _y, _rotation,.....

regards

tektips.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top