flash_monkey
August 1st, 2004, 12:04 PM
I can't figure out how to access variables that are declared in a movie clip from a function declared in that same movie clip.
i.e.
****************************
var int1 = 1
var int2 = 2
function myfunction(){
int1++;
int2++;
}
myfunction();
****************************
I'm trying to do this in the main movie clip of a movie that I plan on importing dynamically in another movie. I've tried to use this.int1++, but I think that flash was looking for a variable that belongs to "myfunction" when I did that. I could just use _root.int1++ but like I said, I plan on dynamically loading this into another movie, in which case it would be pointing to the wrong movie.
Help!!
i.e.
****************************
var int1 = 1
var int2 = 2
function myfunction(){
int1++;
int2++;
}
myfunction();
****************************
I'm trying to do this in the main movie clip of a movie that I plan on importing dynamically in another movie. I've tried to use this.int1++, but I think that flash was looking for a variable that belongs to "myfunction" when I did that. I could just use _root.int1++ but like I said, I plan on dynamically loading this into another movie, in which case it would be pointing to the wrong movie.
Help!!