Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Migrating from AS2 to AS3 - AttachMovie vs. AddChild

Status
Not open for further replies.

grande

Programmer
Feb 14, 2005
657
CA
Hi guys, I've been having a bit of a problem upgrading from AS2 to AS3. I used to have this line:
Code:
var si:MovieClip = searchField.attachMovie("toc_item", "ti"+pg, searchField.getNextHighestDepth(), ({x:40+c*285, y:r*150+90}));

I tried changing it to
Code:
var si:MovieClip = searchField.addChild(toc_item);
but this gives me an error saying "1118: Implicit coercion of a value with static type flash.display:DisplayObject to a possibly unrelated type flash.display:MovieClip."

How can I attach a library object to my field?

-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top