Update: My experience with AS1 / 2 is limited, and this is based on what I saw on the AS forums. From the comments, it seems that the second and third event processing methods are valid in both AS1 and AS2.
The syntax for event processing is different:
ActionScript 3
addEventListener(MouseEvent.MOUSE_UP, handleClick); private function handleClick(e:MouseEvent):void {
ActionScript 2
onRelease = function():Void{
ActionScript 1
on(release){ //do something }
You may find this page useful: Migrating from AS2 to AS3
The way to add new AS3 children is new followed by addChild
var s:Sprite = new Sprite(); var tf:TextField = new TextField(); this.addChild(s); s.addChild(tf);
Previously, these were the createMovieClip and createTextField - not sure about the exact version.
_root.createTextField("mytext",1,100,100,300,100); //that is name, depth, x, y, width, height mytext.multiline = true; mytext.wordWrap = true; mytext.border = false;
Previously, if you had the name property of a child, you can access the child from the parent using parent.childName , even if the parent class did not have a property called childName . With AS3, this is possible only if the parent class has a property called childName (of the appropriate type), and you assigned it a link to it (or you created this property in the dynamic MovieClip class). There is getChildByName() - but it will return the first child with the given name (and duplication of names is possible in the child list).