A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Help with button inside movieclip!

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Posts
    8

    Help with button inside movieclip!

    Hello everybody, Im stuck on this project im doing I'd really appreciate a little help in this. Here's the thing:
    I have a menu made up of 4 MCs, each one has a rollover and rollout effect, and also has frame as2 onpress action to make this movieclip play. What it does is when clicked its animated to enlarge and cover the screen and "become" the clicked section, now inside this movieclip, I added a button on frame 20, and I want this button when pressed to play frame 21 which is the same animation just backwards making it small again and having the menu back as it was in the beginning. So what it does is, it plays I believe the original press on the movieclip which is the enlargement animation, so my question is how can I fix this? Does the movieclip onpress action override any ineractivity inside that movieclip? Please help!
    Heres my AS:
    Frame:
    _root.qsom_bot.onRelease=function(){
    _root.qsom_bot.gotoAndPlay("marca1");
    _root.qsom_bot.swapDepths(_root.getNextHighestDept h());
    }
    MovieClip:
    onClipEvent (load) {
    this.onRollOver = function() {
    this.play();
    };
    this.onRollOut = function() {
    this.play();
    };
    }
    Button inside MovieClip:
    on (press) {
    play("marca2");
    }

    Thanks!

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You can't have a button inside a button. The rollOver event gives the movieclip button behavior, thus disabling any buttons inside it. Try using movieclip events instead of button events. Like onMouseDown, onMouseMove, etc. Check your help files for these.

    Also, try to not write code ON objects. Frame actions instead of the old onClipEvent...

    gparis

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    2
    This was what i was looking for!
    Except how do you roll off?
    Thanks

Tags for this Thread

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