-
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.
-
Senior Member
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. -
-
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|