This is really weird. I have 2 MC’s in Library, “mc” and “mc2”. Both are added in main timeline with
var aaa = new mc();
addChild(aaa)
var bbb = new mc2();
addChild(bbb)
“mc” has keyframe script and “mc2” a .as class file
“mc”
this.addEventListener(Event.ADDED_TO_STAGE,startall);
function startall(e:Event):void{
trace("yes")
}
“mc2”
package {
import flash.display.Sprite;
import flash.events.Event;
public class mc2 extends Sprite{
public function mc2() {
addEventListener(Event.ADDED_TO_STAGE,startall);
}
//---------------------------------
public function startall(Evt:Event):void{
trace("yes2")
}
}
}
Now the weird part; “mc2” traces ‘yes2’ but “mc” does not trace. Anybody any clue, principle is the same with difference that one is in .as and other in keyframe.
Did I oversee something?