4

I just switched to AS3 I am having problem accessing variables of the timeline from MovieClips. In AS2 we used to do _root.myvar, I checked for references, I found _root is root now in AS3.

I have a variable isValid on the root timeline and My code inside a movieclip needs the value of that variable for some checks. I did this:

MovieClip Frame 1:

if(root.isValid == true)
{
 this.gotoAndStop(4);
}

It returned some undefined property error on that.

please help

thank You

1 Answers1

1

You need to cast the root to a MovieClip:

if(MovieClip(root).isValid == true)
{
 this.gotoAndStop(4);
}

it should work then..

yawar
  • 629
  • 3
  • 8