Hi there - I am about to go crazy here.... I am trying to target a button in a
dynamic
MC (attached from the Library). Each movie clip in the library already has the
required
buttons with an instance name.
I have a MC on my main timeline called "menu_mc".
Now in the timeline of "menu_mc" I have the following code:
//l2
this.l1_mc.product_btn.onPress = function():Void {
_parent.menu_mc.attachMovie("level2McProduct", "l2Product_mc", 12);
_parent.menu_mc.l2Product_mc._x = 73.7;
new Tween(_parent.menu_mc.l2Product_mc, "_alpha", Strong.easeOut, 0,
100, 3, true);
new Tween(_parent.menu_mc.l2Product_mc, "_y", Strong.easeOut, 106, 0,
1, true);
};
//l3
this.l2Product_mc.mens_btn.onPress = function():Void {
trace(_parent);
_parent.menu_mc.attachMovie("level3McMens", "l3Mens_mc", 13);
_parent.menu_mc.l3Mens_mc._x = 189.5;
new Tween(_parent.menu_mc.l3Mens_mc, "_alpha", Strong.easeOut, 0, 100,
3, true);
new Tween(_parent.menu_mc.l3Mens_mc, "_y", Strong.easeOut, 106, 0, 1,
true);
};
the "l1_mc" was created with attachMovie earlier in the code, but is trimmed
from here
to save room (it functions as it should). The following:
this.l1_mc.product_btn.onPress = function():Void
also works as it should. Now the results of that are another MC attached to the
timeline
of the "menu_mc" instance. This all works, and my tweens, etc all work as
expected. Now
for some reason when I drill down one level deeper:
this.l2Product_mc.mens_btn.onPress = function():Void
the code stops working. I stuck a "trace" in there to see if the button event
was even
responding. Which it is not! I double, triple checked the button instance name
and the
so on... but it just never works. As you can see I had modified my path to use
the
previously attached MC. I even tried putting in the moviclip by hand and
browsed to find
the path (to make sure I had no mistakes)- and it appears I do not.
I am at wits end here and going insane. Does anyone have any suggestions? Am I
missing
something? Is there a limitation in flash that I do not know about?
::::::::::::::::::::::
Dustin
::::::::::::::::::::::
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders