A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: trying to use movie clip as button

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    2

    Angry trying to use movie clip as button

    Hi I have created a movie clip with a zoom effect, I am trying to make the movie clip act as a button I have tried to use the on release event but its not working I have tried

    on (press) {gotoAndPlay (5);

    }

    on (press) {gotoAndPlay "scene 1" (5);

    }



    in my movie clip I am using

    stop();

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

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

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

    I am sure this is something simple but it has me stumped.

  2. #2
    Senior Member
    Join Date
    Mar 2006
    Posts
    139
    give you movieclip a name
    then in the actions panel (on the timeline not the movieclip)
    use something like

    myButtonMc.onRelease=function(){gotoAndPlay(5);}

  3. #3
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    is onRelease a movieclip event and not a button event? I'm quite certain you need onMouseDown.

    thebutton_mc.onMouseDown = function(){
    if(thebutton_mc.hitTest(_xmouse, _ymouse, true)){
    trace('cake');
    }
    }

  4. #4
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    Your problem is in gotoAndPlay(); action which needs to be this.gotoAndPlay(5);

    code:


    mc.onRelease = function() {
    this.gotoAndPlay(5);
    };






    arkitx
    Last edited by arkitx; 10-08-2012 at 06:52 PM.

  5. #5
    Junior Member
    Join Date
    Oct 2012
    Posts
    2
    ad.fla

    thanks for the replies I have tried some of your suggestions but I cannot get it to work I have attached my fla for you to see maybe you could point out where I am going wrong

  6. #6
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    I am using CS5.

  7. #7
    Senior Member
    Join Date
    Mar 2006
    Posts
    139
    give this a go...
    Attached Files Attached Files

  8. #8
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    The ad.fla file is CS6. Please export it as an earlier version for those who are using CS3 to CS5.

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