I'm having a problem with my onPress being triggered. I have a parent MC, let's hypothetically call it "sections". It has a bunch of MCs in it, let's say by the name of "section_1", "section_2", "section_3". On the first frame of the first and only layer inside my parent MC (sections) I have a bunch of onPress code for my children section. It worked great until I added an onPress code for my parent MC on my _root timeline. Now only my parent's onPress code is being triggered, and the onPress for the children aren't. Is there anyway to get these both to be triggered, perhaps with a mouse listener?
the parent movieclip is intercepting mouse events so the child movieclips do not detect mouse events. to remedy, you must either code for the youngest generation that needs mouse handlers or use a hitTest for one of the generations.
I'm having a similar problem, where a "play_mc", "stop_mc", "pause_mc" are nested inside a "controls_mc" to fade everything in and out on controls_mc.onRollOver. Could you further explain the hitTest and "coding for the youngest generation"? It will be greatly appreciated.
hitTest technique: _level0.onMouseMove=function(){ if(parentMC.hitTest(_xmouse,_ymouse){ // execute parent movieclip onPress code } } childMC.onPress=function(){ // execute child movieclip onPress code } // coding for youngest generation: on the parent mc timeline (where the child mc's can be found) create a shape that's the same as the parent movieclip less the children mcs. paste that on the parent's timeline, convert to a movieclip and assign mouse handlers and, if you want the children to execute the same code as the parent, to also contain that code add the same code to their handlers.
also see: http://www.senocular.com/flash/tutorials/buttoncapturing/ [quoted text, click to view] "BeniRose" <webforumsuser@macromedia.com> wrote in message news:f0620j$p4c$1@forums.macromedia.com... > I'm having a problem with my onPress being triggered. I have a parent MC, > let's > hypothetically call it "sections". It has a bunch of MCs in it, let's say > by > the name of "section_1", "section_2", "section_3". On the first frame of > the > first and only layer inside my parent MC (sections) I have a bunch of > onPress > code for my children section. It worked great until I added an onPress > code for > my parent MC on my _root timeline. Now only my parent's onPress code is > being > triggered, and the onPress for the children aren't. Is there anyway to get > these both to be triggered, perhaps with a mouse listener? >
Don't see what you're looking for? Try a search.
|