View Full Version : accessing buttons inside MC from main a
bearsark86
09-12-2005, 07:20 AM
i knoe tis question has been asked many times but i need 2 tis over with once and 4 all..
in the spirit of makin ur codes as centralized as possible, is there ANY way to access a button inside MC and pass a command?... :o, other than directly puttin an event handler 2 tt button...
Sunny13
09-12-2005, 08:47 AM
are you looking for something like this....:)c_btn.onRelease = function() {
_root.a_mc.b_mc.onRelease();
_root.a_mc.b_btn.onRelease();
};
a_mc.b_mc.onRelease = function(){
trace("MovieClip");
}
a_mc.b_btn.onRelease = function(){
trace("Button");
}
bearsark86
09-12-2005, 09:29 AM
tis is not wat ive been lookin 4 but yea tt piece of code is sumthin new 2 me... i tink i knoe where e code is goin at...i ll figure tis out by myself...
anyway thanks Sunny13... :) :) :)
bearsark86
09-13-2005, 02:48 AM
hah! go it. my case is where strangely my button inside a MC doesnt work usin e normal 'this.mc_start.red_btn.onRelease'..heres how i got it 2 work:
_root.mc_start.onRelease = function () { // red_btn resides in mc_start
_root.red_btn.onRelease ();
gotoAndPlay (2);
}
thanx 4 e leg up!!! :)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.