Forums

ForumsProgramming Forum

AddChild in AS3

Posted Jul 18, '09 at 7:29pm

kevinseven11

kevinseven11

36 posts

Okay Ive been learnin alot about AS3 but i dont understand how AddChild() can even be anything.Its not a variable and I think its a class but when I look theres no class for it, is it a function?
Thanks

 

Posted Jul 18, '09 at 7:51pm

clipmaster3

clipmaster3

110 posts

addChild() is a function of the DisplayObjectContainer class
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/DisplayObjectContainer.html#addChild()

 

Posted Jul 18, '09 at 11:57pm

Erasmus_Darwin

Erasmus_Darwin

62 posts

It's worth noting that Stage, Sprite, and MovieClip (among other classes) are all direct or indirect subclasses of DisplayObjectContainer. So if you've got an object of one of those types, you can call addChild on it.

 

Posted Jul 19, '09 at 2:15am

kevinseven11

kevinseven11

36 posts

oh thanks guys, when you add it and it has the () do you have to put the X and Y cordinates everytime? or is there a default?

 

Posted Jul 25, '09 at 12:06am

dank

dank

1,045 posts

Knight

You can look it up in the docs if you aren't sure about it's parameters.
In Flash, go to Help>Flash Help, or press F1. Then search addChild(). When you find it, YOu'll see that it says:

public override function addChild(childisplayObject)isplayObject

the part that says childisplayObject tells you that it takes one parameter of a DisplayObject (or one of its subclasses).
 

Posted Jul 25, '09 at 10:41pm

kevinseven11

kevinseven11

36 posts

dude thanks alot, ill keep learnin

 

Posted Dec 5, '11 at 8:36pm

max3624

max3624

1 post

How can I use delay in addChild?

 

Posted Dec 6, '11 at 1:55am

Darkroot

Darkroot

2,879 posts

How can I use delay in addChild?


With a timer?
 
Reply to AddChild in AS3

You must be logged in to post a reply!