A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Sprite MouseChildren Not Working

  1. #1
    strandedgenius.com
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    187

    Exclamation Sprite MouseChildren Not Working

    Very basic yet very difficult for some reason. I have a container Sprite, that hold many sprites inside it. I need at least one of the children sprites to works like a button. I've done this a million times before but not within a container. Anyone know what else I can do to make this work? I know I'm missing something or else Sprites wouldn't have the mouseChildren property.

    Code:
    var __container:Sprite = new Sprite();
    __container.mouseChildren = true;
    addChild( __container );
    
    var insideButton:Sprite = new Sprite();
    insideButton.buttonMode = true;
    insideButton.addEventListener( MouseEvent.CLICK, whatever );
    __container.addChild( __insideButton );
    Also assume both sprites are just simple boxes.
    JScarlip,
    That Was Nice!

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Don't use mouseChildren. Why did you add that?
    Last edited by cancerinform; 03-10-2008 at 09:57 PM.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    strandedgenius.com
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    187

    resolved

    Hey Cancer, yeah that actually still works either way. "mouseChildren" enabled the children of that sprite to receive MousEvents. My problem was the hit area. I had several pngs and they where all same size overlapped on top of each other. So even though each png was showing a different part they where still directly of top of each so anything behind the top layer pngs wouldn't off recieved the MousseEvent. Suck, so I had to add a hot spot, so it works now.
    JScarlip,
    That Was Nice!

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