PDA

View Full Version : Frame variable


stucco
03-01-2004, 11:56 AM
Ok, I am having a bit of an issue.

I have a button that when clicked does the following code.

on (press) {
set (varframe.number, 15);
gotoAndPlay(199);
}

Basically frame 199 plays a closing animation, then I have a script set to do the following.


gotoAndPlay(varframe.number)

How can I get it to resolve varframe.number to the correct variable? I have tried omitting the .number option, and nothing seems to work. If I can get something similar to this to work, it will save me several hours worth of redundant programming.

divarch
03-01-2004, 12:18 PM
You must define the variable on the _root, try:
on (press) {
_root.varFrame = 15;//set() method is obsolete
_root.gotoAndPlay(199);
}

stucco
03-01-2004, 07:14 PM
Ok, but what would the code be to gotoandplay(vframe)?

stucco
03-01-2004, 07:15 PM
actually it was _root.varframe


thanks for the help!!!