PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Help with buttons please
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help with buttons please

  1. #1
    Member
    Join Date
    Nov 2007
    Posts
    58

    Help with buttons please

    I put this button menu together from bits and pieces. I have a mc with hidden buttons behind it and when you roll over the movie clip the buttons tween up from behind it and when you roll out it tweens back behind the mc. My only problem is that I can't click on any of the buttons that pop out because it tweens back as soon as I move the cursor off the mc.

    I thought that if I placed the buttons inside the mc and just reference the movieclip that it would work but obviously not.

    How can I fix this?

    Actionscript Code:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import flash.events.MouseEvent;

    avatar.mouseEnabled = true;

    avatar.addEventListener(MouseEvent.MOUSE_OVER, onOver);

    function onOver(event:MouseEvent):void{
        avatar.removeEventListener(MouseEvent.MOUSE_OVER, onOver);
        avatar.addEventListener(MouseEvent.MOUSE_OUT, onOut);
        var statement_btn:Tween = new Tween(avatar.statement_btn, "y", Strong.easeOut, 78.15, -28.85, .2, true);
        var contact_btn:Tween = new Tween(avatar.contact_btn, "y", Strong.easeOut, 54.15, -52.85, .4, true);
        var resume_btn:Tween = new Tween(avatar.resume_btn, "y", Strong.easeOut, 29.15, -77.85, .6, true);
        var press_btn:Tween = new Tween(avatar.press_btn, "y", Strong.easeOut, 5.15, -101.85, .8, true);
    }

    function onOut(event:MouseEvent):void{
        avatar.removeEventListener(MouseEvent.MOUSE_OUT, onOut);
        var statement_btn:Tween = new Tween(avatar.statement_btn, "y", Strong.easeOut, -28.85, 78.15, .4, true);
        var contact_btn:Tween = new Tween(avatar.contact_btn, "y", Strong.easeOut, -52.85, 54.15, .4, true);
        var resume_btn:Tween = new Tween(avatar.resume_btn, "y", Strong.easeOut, -77.85, 29.15, .4, true);
        var press_btn:Tween = new Tween(avatar.press_btn, "y", Strong.easeOut, -101.85, 5.15, .4, true);
        avatar.addEventListener(MouseEvent.MOUSE_OVER, onOver);
    }

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Location
    Nintendo Land
    Posts
    15
    Just move them in a different spot. Try the code like this too if you want the buttons to only come at a specific time.

    button.hide() ( To make it hide )
    button.show() ( To make it show )

    Of coarse make the time by using a time variable first.
    Nintendo Land!

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