Question : How can i do smooth box scaling and positioning animation?

Hi,
I am new in actionscripting,

My flash document size is
width: 995px;
height: 800px;

On layer 1 - 1st frame I have two buttons
1st button instance name "button1" &
2nd button instance name"buttonTwo"

and

on 2nd layer 1st frame i have box movieClip
instance name "box"
width of the box is : 300px;
height of the box is : 600px;
By default the box is positioned in
x-axis : 347.5
y-axis :100.0
of the flash document


Now once i click 1st button i want the box to move its position with an ease tween animation to
x-axis : 40
y-axis :100.0
and re-size itself to
width 600px;
height 600px;


once i click the 2nd  button i want the same box to move its position with an ease tween animation to

x-axis : 680
y-axis :200
and re-size itself to
width 250px;
height 300px;

Can you please help me with the script?

Answer : How can i do smooth box scaling and positioning animation?

fine I give up. here u go.
I won't try and help you to learn and understand i'll just do the work for you.
i appreciate your being brave to doing something you don't know how, but seriously, instead of just taking the code and saying cool i'm done, actually try and understand it.
you need to learn to apply the code and what it does and why.

the code snippet below 1st button takes it from start position to new positions.
the second button goes from new positions after button1 is clicked and takes it back to the original positions.
any other buttons you just copy and paste and change the values - which is what i've been trying to tell you all along.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var orgX:Number = box_mc._x;
var orgY:Number = box_mx._y;
var orgW:Number = box_mc._width;
var orgH:Number = box_mc._height;
 
 
button1.onPress = function(){
 var t1:Tween = new Tween(box_mc,"_x",Strong.easeOut,box_mc._x, 40,2,true);//2 is the num of seconds
 var t2:Tween = new Tween(box_mc,"_y",Strong.easeOut,box_mc._y, 100,2,true);
 var t3:Tween = new Tween(box_mc,"_width",Strong.easeOut,box_mc._width,100,2,true);
 var t4:Tween = new Tween(box_mc,"_height",Strong.easeOut,box_mc._height,600,2,true);
}
button2.onPress = function(){
 var t5:Tween = new Tween(box_mc,"_x",Strong.easeOut,40,2, orgX,true);
  var t6:Tween = new Tween(box_mc,"_y",Strong.easeOut,100,2, orgY,true);
  var t8:Tween = new Tween(box_mc,"_width",Strong.easeOut,100,orgWidth,2,true);
  vart t9:Tween = new Tween(box_mc,"_height",Strong.easeOut,100,orgHeight,2,true);
} 
Open in New Window Select All
Random Solutions  
 
programming4us programming4us