Click to See Complete Forum and Search --> : dress up with layers?
milowerx
12-31-2008, 12:12 PM
Wow... it's been years since I posted here...
Hey can anyone tell me how the code that makes this file (http://www.peta2.com/trollsens/dress_up.asp) pop the clothes behind the head was done? How does it know that the coat should pop behind the head each time?
-Mike
friedegg3
12-31-2008, 02:46 PM
I'm assuming it's setChildIndex('some number');, where the 'some number' is the level in the stacking order and controled with the MOUSE_DOWN and MOUSE_UP handlers.
it 'knows' which level to switch to with a conditional if statement with hitTestObject.
Hope this helps and leads you in the right direction.
milowerx
12-31-2008, 03:16 PM
Yes thanks that does help... I couldn't do it in Actionscript but I sorta get what you're talking about. Thanks man!
neznein9
12-31-2008, 04:09 PM
You could also set this up with transparent layered 'zones' - the head on top, the body below, etc - then when you release the jacket it would detect whether it's over the person (hitTest or just by coordinate) and then you'd use addChild to move the jacket into the body zone...
flashkit.com
Copyright Internet.com Inc., All Rights Reserved.