PDA

View Full Version : onRelease question


skyfix
03-21-2010, 03:43 PM
stop();

var Tred:Number= 1;
var count:Number= 1;


r1_mc.rv.onRelease = function() {
Tred = Tred + count;
trace(Tred);
r1_mc.gotoAndStop("r_act");
}

r1_mc.rr.onRelease = function() {
Tred = Tred - count;
trace(Tred);
r1_mc.gotoAndStop("r_init");
}


the .rv and .rr are 2 different instances, both representing the same button in different states,(rr in the r_init, and rv in the r_act)
now...
the first on release works perfectly...
once it's on the frame 'r_act' on the other hand, it doesn't do anything... doesn't even recognize it as a button (no hand, just arrow)
what am I doing wrong?

skyfix
03-22-2010, 01:38 PM
please?

skyfix
03-23-2010, 03:34 PM
realy, nobody?
waw...thanks a lot...

Yui
03-24-2010, 02:52 PM
try this code and you'll realize that r1_mc.rr is null:

stop();

var Tred:Number= 1;
var count:Number= 1;


r1_mc.rv.onRelease = function() {
Tred = Tred + count;
trace(Tred);
r1_mc.gotoAndStop("r_act");
}

trace(r1_mc.rr); //output: null

make sure all the objects you use (buttons, mc's etc) exist when you want them to do something.