A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: dynamic button

  1. #1
    Junior Member
    Join Date
    Feb 2002
    Posts
    8
    I was trying to create a button that would play a movie clip of an arrow rotating 90% when it was clicked, and when the mouse was released, rotate 90% back. I got that far.. but the problem is, if the mouse is released before the first clip has played,the second clip rotates from a full 90%. i want the second clip to play from the frame that the other clip left off. Basically, i want the arrow to rotate 90% while the mouse is being pressed, and then rotate back to the starting position when the mouse is released. any help or suggestions would be appreciated. thanks
    --Neil

  2. #2
    Pillow Daddy m_andrews808's Avatar
    Join Date
    May 2001
    Location
    London England
    Posts
    924
    I'm assuming that your arrow is moving using a motion tween. If you've actionsripted it then let me know because this won't work.

    In the first frame of your arrow animation put this:

    Code:
    Reverse = false;
    then put this code in the arrow clip:

    Code:
    onClipEvent(enterFrame) {
        if(Reverse) {
            gotoAndStop(_currentFrame - 1);
        }
    }
    then in your button put this (assuming your arrow clip is on the base timeline with an intance name Arrow):

    Code:
    on(press) {
        _root.Arrow.play();
        _root.Arrow.Reverse = false;
    }
    
    on(release) {
        _root.Arrow.Reverse = true;
    }
    Ought to do the job. Let me know if it doesn't work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center