Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable assignment troubles... 1

Status
Not open for further replies.

bugg

Programmer
Jun 20, 2001
62
US
can someone please tell me what I'm doing wrong here?

on (press) {
if (_root.icons.rbicons.res.drw.tit._currentframe == 15) {
var resdrwlft = -515;
var resdrwbtm = 20;
}
else {
var resdrwlft = -485;
var resdrwbtm = (40-(_root.icons.rbicons.res.wrd.drgbtn._y + 135));
}

thanks much
bugg
 
to be more specific, when "_root.icons.rbicons.res.drw.tit"'s currentframe is 15, the variables remain as directed by the else clause.

bugg
 
Did you try it with a capital F on _currentFrame?

_currentFrame should appear in green in the actions box!
mywink.gif
ldnewbie
 
it is in lowercase in my actionscript, yet it still appears green. Ok, I tried putting it in upper case, it appears green again but still doesn't work... :(

bugg
 
I'm assuming all (the red) are mcs
_root.icons.rbicons.res.drw.tit, right?

If so, is the tit mc stopped on some frame, or is it playing?
Maybe use the Trace action to output the _currentFrame, because it appears this condition is never met!
Put it within your press action, before your if statement!

mywink.gif
ldnewbie
 
er, ok, what is the trace action? I am not familiar with it
thanks
bugg
 
Look for it in the actions' list in the Object Actions box.
Add it here:
on (press) {
trace(_root.icons.rbicons.res.drw.tit._currentframe);
if (_root.icons.rbicons.res.drw.tit._currentframe == 15) {
var resdrwlft = -515;
var resdrwbtm = 20;
}

Make sure the expression box is checked.
It will send the value of the _currentframe in the output window which will automatically open up when you test your movie.
Obviously if you never get 15, it means the if statement will never be true, so there's something wrong somewhere else.
And you didn't answer my other questions!
mywink.gif
ldnewbie
 
sorry for skipping over your questions...

Yes, _root.icons.rbicons.res.drw.tit (red ones) are movie clips.
Yes, it should be stopped @ either 14 or 15.

It was the expression box. works like a charm. thankyou for your help. (and the trace action is pretty sweet, wish I knew about this earlier, I'm sure I'd have saved some hours...)

bugg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top