Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Code for animation in flash action script 2.0

  1. May 10, 2009 #1
    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.
     
  2. jcsd
  3. May 11, 2009 #2

    minger

    User Avatar
    Science Advisor

    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 (Text):

    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 (Text):

    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
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Code for animation in flash action script 2.0
  1. Python Script (Replies: 2)

Loading...