Hi there, im trying to move to AS3 …
So I came across this code, where the fla has a document class of Main.as
This loads in … Ok. But what I dont get inside this code, is that it manages to load in Secondary.as without a form of reference I am familiar with :::: it must be easy stuff, but look at this…(Main.as)
package
{
import flash.display.MovieClip;
public class Main extends MovieClip
{
private var ac:Secondary;
public function main()
{
ac = newSecondary ();
addChild(ac);
}
}
}
Seconday.as is as follows (it doesnt do anything)
package
{
import flash.display.MovieClip;
public class Secondary extends MovieClip
{
public function Secondary()
{
addEventListener(Event.ADDED_TO_STAGE, initThis);
}
private function initThis (evt:Event)
{
test = new Sprite();
this.addChild(test);
}
}
}
any explanations would be tip top…