Code for animation in flash action script 2.0

  • Thread starter brandy
  • Start date
  • #1
161
0

Main Question or Discussion Point

i have a a board and i want it divided into 6 parts.
1 part is equal to the size of the stage.
when the mouse moves to the left of the screen i want the current part to tween into the left part.
same for right and down and up.

what i have so far is for the bar on the left, right, bottom.
on(rollOver){
...
something do to _x and _y???


how do i finish it?
please and thankyou.
 

Answers and Replies

  • #2
minger
Science Advisor
1,495
1
I dont' really understand your question, but you can basically just set a point (x,y) that you want to be at. Then for your invisible button, you can have something like:
Code:
onRollOver() {
  mcSquare.nextFrame()
}
Then on one of the 6 squares, you have a stop command on the first frame, then on the second, you have something like:
Code:
onFrameEvent(enterframe){
dx = targetx - this._x
dy = targety - this._y
this._x =+ dx
this._y =+ dy
}
Sorry if the code is rusty, it's been years since I've coded or done anything in Flash.

For better reference, may I direct you to www.flashkit.com <-GREAT FORUM for Flash
 

Related Threads for: Code for animation in flash action script 2.0

Replies
1
Views
2K
  • Last Post
Replies
9
Views
2K
  • Last Post
Replies
7
Views
3K
  • Last Post
Replies
2
Views
2K
Replies
12
Views
2K
  • Last Post
Replies
1
Views
432
Top