PDA

View Full Version : AS2 to AS3 attachMovie help


dajohnson1s
11-18-2009, 08:55 PM
Hello,

Just to warn everyone, this is my first time with actionscript.

I am following this (http://www.gotoandlearn.com/play?id=32) video tutorial, around 11: 37, it asks to use 'attachMovie()', which has been removed from AS3.

This is the line specifically:

var t = this.addMovie("item","item"+i,i+i);


And this is what actionscript/flash prompted me to change this line to:

var t = DisplayObjectContainer.addChild(child:DisplayObject item);DisplayObject:item;



But I am now getting an error of:
1084: Syntax error: expecting rightparen before colon.

I have read for a while to solve this issue, but I am getting even more confused.

Any help would be greatly appreciated.
Daniel

PappaJohn
11-19-2009, 12:35 AM
var t = DisplayObjectContainer.addChild(child:DisplayObject item);
should be
var t = DisplayObjectContainer.addChild(child:DisplayObject);
The addChild method accepts only one argument.