This maybe simple but I have two as files and I want to call a function inside a class and I am not sure how to do this. EX I want to call the function Main() after I import the packages. Can anyone help?
Package CODE:
package code
{
import flash.display.Sprite;
import flash.display.MovieClip;
public class allActivities extends flash.display.Sprite
{
public static var testGlobal:String = "testValue";
private function Main():void
{
trace("Initilize Global Variables");
}
}
}
package code
{
public class activityone
{
private function Maintwo():void
{
trace("testGlobal " + allActivities.testGlobal);
}
}
}
FLA CODE
import code.*;
If you want to be able to call the Main function from the fla you need to make it a public function. Making it private means access to it is restricted to within the class.
After you straighten that out, in your fla file try creating an instance of the class and use that to call on the Main function...
var aa:allActivities = new allActivities();
aa.Main();
North America
Europe, Middle East and Africa
Asia Pacific