A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Coding a movie clip as a button to change frames

Hybrid View

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    1

    Coding a movie clip as a button to change frames

    I am trying to use a movieclip as a button so I can have animation on the mouseover. I have been unable to get the button to work to change to a different frame. I can make the movieclip open a browser window, but not jump to another frame.

    Here is the code that I have in the button:
    <highlight>stop();

    this.onEnterFrame = function(){
    if(rewind == true){
    prevFrame();
    }
    }

    this.onRollOver = function(){
    rewind = false;
    play();
    }

    this.onRollOut = function(){
    rewind = true;
    }

    this.onRelease = function(){
    gotoAndStop("Scene 1", 2);
    }</highlight>
    Attached Files Attached Files

  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    96
    I think the gotoAndStop is referencing your movieclip button and not the main animation. Try adding _root.gotoAndStop and see if that works.

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