ForumsProgramming ForumAddChild in AS3

7 4069
kevinseven11
offline
kevinseven11
36 posts
0

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

  • 7 Replies
clipmaster3
offline
clipmaster3
110 posts
0

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

Erasmus_Darwin
offline
Erasmus_Darwin
62 posts
0

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.

kevinseven11
offline
kevinseven11
36 posts
0

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?

dank
offline
dank
1,044 posts
750

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).
kevinseven11
offline
kevinseven11
36 posts
0

dude thanks alot, ill keep learnin

max3624
offline
max3624
1 posts
0

How can I use delay in addChild?

Darkroot
offline
Darkroot
2,877 posts
710

How can I use delay in addChild?


With a timer?
Showing 1-7 of 7