This content has been marked as final. Show 3 replies
when you prefix a variable's definition with var (as in, var slide:String etc) inside a function body, that variable is local to the function and undefined outside the function (and even inside the function on subsequent function calls).
to remedy, type your variable outside the function body and assign its value (without the var prefix) within the function body.
Forgive me, but my knowledge of Action Script is fairly primitive.
I understand what you’re describing about a variable being local to a function. I was starting to suspect that after trying different approaches to this on my own.
However would you mind elaborating on how to just assign a value with out making it a var.? I always thought they were mutually exclusive.
Are you suggesting something like “slide = this.total_number_of_slides;” If so how would one associate this with a Var.?
outside of class files, you don't even need to type your variables in as1/as2. so, you could use: