Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-08-2007, 01:03 PM   #1
evride
2006 Man Of The Year
 
evride's Avatar
 
Join Date: Mar 2007
Posts: 919
Default addChild()

what does the addChild function do? im trying to move on from AS2 to AS3 and i see this function a lot in samples and tutorials. to me it appears that it adds a movieclip to the stage or to another movieclip, but can't you just do that by mc.attachMovie()?
evride is offline   Reply With Quote
Old 10-08-2007, 02:25 PM   #2
panel
AS3
 
panel's Avatar
 
Join Date: Mar 2007
Location: Warsaw
Posts: 1,991
Send a message via Skype™ to panel
Default

attachMovie() was removed in as3.

There is whole new display list model in as3.

Each object extending DisplayObjectContainer class has own display list (MovieClip, Sprite...). It means that you can add any object (witch extend DisplayObject class) to display list of particular object.
To make object visible you have to add it to stage Display list or to display list of one of objects already added to stage display list.

I know it sounds confuising, but is easy.
This should be helpfull

There is many advantages of this model on is that you can object to
panel is offline   Reply With Quote
Old 10-08-2007, 02:27 PM   #3
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

attachMovie is AS2 only. A lot of things have changed in AS3 - how display objects (movie clips) are handled is one of them. If you haven't already do some reading : ) There are a number of resources out there that explain the new way of handling these things in AS3, including Flash help.

[edit]Panel beat me to it ; )[/edit]
__________________
(6)
senocular is offline   Reply With Quote
Old 10-08-2007, 10:05 PM   #4
evride
2006 Man Of The Year
 
evride's Avatar
 
Join Date: Mar 2007
Posts: 919
Default

thanks for your explanations dudes. i just dont see the need for you to write a whole other statement to add an object to the stage. seems tedious. in AS2 if you created a new movieclip in any way (duplicate, createEmptyMovieClip), it'd be on the stage and thats how i liked it.
evride is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OOP addChild Applewood ActionScript 3.0 9 09-22-2007 11:13 PM
addChild (simple?) problem timbaah ActionScript 3.0 2 06-11-2007 09:25 PM
addChild Issue slalonde44 ActionScript 3.0 2 05-26-2007 01:57 AM
how do I access bitmap Object after addChild? kensuguro ActionScript 3.0 9 02-06-2007 03:49 PM
addChild and AS3-Specific "Best Practices"? feanish ActionScript 3.0 1 12-18-2006 08:54 PM


All times are GMT. The time now is 03:40 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.