Basically I’m looking for a tutorial to scale a “box” on the click of a button. For example my “box” is first 100x200, and when a button is clicked the box transforms (smootly) to 50x300.
what determines the 30 and the 10? well, you want to go from 100 scale to 400 scale, and from 100 scale to 200 scale… right? The for loop is going to have 10 intervals, so you have to divide the differences between the scales by the number of intervals… (400 - 100)/10 = 30… etc.
what determines the 30 and the 10? well, you want to go from 100 scale to 400 scale, and from 100 scale to 200 scale… right? The for loop is going to have 10 intervals, so you have to divide the differences between the scales by the number of intervals… (400 - 100)/10 = 30… etc. **
Yep… of course, these use coordinates. So instead of using _x and _y stuff just use _xscale and _yscale stuff.
THe effect is still the same, it just resizes. The important part is that endX and endY equal your final detination, whether it be size or coordinates.
well… the problem with mine is that it’s not going to animate… (by the way, the commas in the for loop are supposed to be semicolons…) both lost and I are right… but you want it to animate, right? you should use an onEnterFrame function… something like
box.onEnterFrame = function(){
//insert here code that lost put in..
}
and you would call that function from the on(release) handler
I got your question, Some people replied for your problem. Those scripts work fine and its good. But it can be done in much more simpler way, I am sending you one fla and I also responded to your personnal mail id.