Retreivining Class Values in Main Timeline
Hello,
The code works, I'm jsut unable to read the Class variable "myString" on the main timeline.
I thought I could pass the "myString" value from the Class to the Main Timeline?
I created a variable in an external Class .as file.
See coding below.
//------- Code on main timeline .Fla
var testClass:MyClass = new MyClass(myString);
var myString:String;
var vString = myString;
trace("from main timeline=== " +vString);
//-------- Code in the .as File
package {
public class MyClass{
public function MyClass(myString){
//do something
var myString:String = "traced from class === ";
trace(myString);
}
}
}
//-------- Output When Ran (In trace window)
traced from class === //the class value is recognized.
from mail timeline=== null //However, the maintimeline is null
Any help would be appreciated