A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Movie Clip Button hit area

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    19

    Movie Clip Button hit area

    I am working on my first Flash Project since a few years ago when I was using Flash MX. So far I have created a working movie clip button that incorporates an After Effects animation upon a mouse rollover.

    The hit area for my button is way too large now since the movie clip has taken on the properties of a button.I tried to create another movie clip in the same layer that was the correct size to act as the hit area that I wanted. I also made it transparent but I know my action scripting must be wrong.

    Is there a way to do this or should I try a different way to customize my hit area?? Any help is appreciated.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Which actionscript version are you using?
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    19
    I am using Flash CS3, AS 3.0

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Then you may want to look into this:

    http://flashas3.flashscript.biz/mouse/button_event.html
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Junior Member
    Join Date
    Jul 2007
    Posts
    19
    So how would I go about simply creating a child button that would play the movie clip in my movie clip button on a rollover? I think that would work to create the right sized hit area that I want, Im just not sure how to script that.

  6. #6
    Junior Member
    Join Date
    Jul 2007
    Posts
    19
    I have 2 movie clip buttons. "hit_btn" is the one I want as the hit area. "animation" is my animated movie clip button that contains a hit area that is way to large to use with multiple buttons that would eventually be side by side.

    Here is what I have Scripted thus far. I don't get any errors but nothing is happening now when I rollover.


    function overButton(event:MouseEvent):void {
    event.currentTarget.gotoAndPlay("over");
    }

    hit_btn.addEventListener(MouseEvent.ROLL_OVER,over Button);

    hit_btn.buttonMode = true;

    hit_btn.visible = false;

    hit_btn.hitArea = animation;

    animation.mouseEnabled = false;

  7. #7
    Junior Member
    Join Date
    Jul 2007
    Posts
    19
    NEVERMIND. I GOT IT!! just had my buttons flipped around wrong
    (animation.hitArea = hit_btn)

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