Answered
Call Method In Root From Movie Clip
Hello All,
In AS 2, I was able to call a method declared in the root timeline from a moviclip by placing code similar to "_root.callMethod()". I'm trying to do the same in AS 3 but I get an error "1119: Access of possibly undefined property st through a reference with static type flash.display:DisplayObject."
On the first frame of my main timeline, I have:
var st:String = "HELLO";
I also have a movieclip on the main timeline that has the following on its 1st frame:
trace ("ST FROM ROOT FROM CLIP -- " + root.st);
When runned, I get the error above.
How do I get access to variables declared in other clips and main timeline as well as calling methods declared in other MC and main timeline?
Thanks for your help in advanced.
V
In AS 2, I was able to call a method declared in the root timeline from a moviclip by placing code similar to "_root.callMethod()". I'm trying to do the same in AS 3 but I get an error "1119: Access of possibly undefined property st through a reference with static type flash.display:DisplayObject."
On the first frame of my main timeline, I have:
var st:String = "HELLO";
I also have a movieclip on the main timeline that has the following on its 1st frame:
trace ("ST FROM ROOT FROM CLIP -- " + root.st);
When runned, I get the error above.
How do I get access to variables declared in other clips and main timeline as well as calling methods declared in other MC and main timeline?
Thanks for your help in advanced.
V