Skip to main content
Participating Frequently
April 3, 2009
Question

root and parent vars??

  • April 3, 2009
  • 1 reply
  • 527 views

Hi, I hope someone can help me!

I just need to call a variable or function from a movie clip to main timeline.
In AS2 I would use something like:
_root.myvar = "Hola";
or
_parent.myfunc(4,2);

But this doesn't works on AC3. I tried to remove the "_" but its the same.

Thaks for your time.
This topic has been closed for replies.

1 reply

Ned Murphy
Legend
April 3, 2009
Use....

MovieClip(root).myvar = "Hola";

MovieClip(parent).myfunc(4,2);

They made AS3 unnecessarily less cooperative. You need to identify the the type of object you're referring to.
ebelendezAuthor
Participating Frequently
April 8, 2009

Thanks so much! It worked!