The ActionScript 3 `addChild()` function
Questions tagged [addchild]
287 questions
2
votes
5 answers
Getting error when using the removeChild method
Happy Pre-Halloween everyone :)
My issue today is a DisplayObject error I'm getting when remove a child object. I have code that will launch(addChild) a video container and video controls as well as add a close button. Now the close button works…

Leon Gaban
- 36,509
- 115
- 332
- 529
2
votes
1 answer
No layer concept in ActionScript 3.0?! What happens to Flash IDE layers, then?
I was trying to access the layers by their names dynamically via AS3. But then I just found out there's nothing on layers in AS3 API (or I didn't search enough).
If that's true, naming layers at IDE is totally meaningless to the code?
What happens?…
user1869316
2
votes
3 answers
ActionScripting Issue: adding/removing children
I have three movie clips all linked to the stage and I want them to behave like a button/ But I am not using a button because I have not found a way to have each part (up, over, down, hit) be animated and not just change when the mouse is in use…

user1890698
- 21
- 1
2
votes
1 answer
addchild with multiple movieclip in as3
var txt_mc:movieClip=new movieClip();
createTxt(3)
function createTxt(_no):void
{
var _sy = 0;
for (var i=0; i<_no; i++)
{
var txt:TextField = new TextField();
txt_fmt.size = _size;
…

Vijay Navlani
- 23
- 4
2
votes
2 answers
{AS3} addChild() in a Class does not work
so I have a class:
package
{
public final class Main extends Sprite
{
private var TextHolder:Sprite = new Sprite();
public function Main():void
{
spawnHolder();
}
private function…

GilaGuy
- 23
- 1
- 5
2
votes
2 answers
Add Sprite After Touch cocos2d
My goal is to add a sprite, leftOn, to the screen after a user touches the screen.
Here's my code:
-(void)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
CGPoint location = [touch locationInView:[touch view]];
location =…

Real Talk
- 60
- 8
2
votes
1 answer
addchild in a movieclip in a movieclip in a movieclip
I would addchild to a movieclip who is in a movieclip who is in another movieclip.
I try:
this.profil.bonome0.bonome.addChild(conteneurImage);
and it doesn't work but this does:
this.profil.bonome0.addChild(conteneurImage);
how could I access to…
2
votes
6 answers
AS3 : AddChild based on Array Value
Let's say I have an array, each item in the array has a corresponding library item.
I'd like to do something like :
var rando = Math.round(Math.random()*3)
var myArray = new Array ["ball", "wall", "fall"]
var i:myArray[rando] = myArray[rando] new…

victorkhugo
- 131
- 1
- 3
- 12
1
vote
3 answers
addChild with effects, such as Tweener OR transitions
Is it possible to use addChild with tweener or transitions, I mean not only bring the child to the stage, but at the same time make this animated?
especially in this type of code:
var background=new MovieClip ;
var…

user1212216
- 41
- 2
- 9
1
vote
1 answer
ScrollPane doesn't work with dynamic content in as3
scrollPane.setSize(400,400);
scrollPane.source=emptyc;
Where emptyc is a container in which I add content dynamically (i.e. by addChild method) doesn't work. It simply doesn't scroll at all.
Neither does work if I add content using scrollPane as a…

user1212216
- 41
- 2
- 9
1
vote
2 answers
AS3 Global class that can add objects to stage
So I recently learnt that by importing a class into my main class I can access its functions from any other class. BUT.... one of my functions in the imported class needs to add display objects to the stage. I accessed the static function just fine…

senor tee
- 47
- 9
1
vote
3 answers
addChildViewController and remove it
In my project's main ViewController, once users of the app click the "Start" button, I add the next view to the screen:
UIViewController *nextController = [[GamePlayViewController alloc] initWithNibName:@"GamePlayView" bundle:nil];
[self…

RanLearns
- 4,086
- 5
- 44
- 81
1
vote
1 answer
Actionscript3.0 addChild removeChild XML
I dont know if for my problem addChild and removeChild method is what i exactly need but as i read around the web that's the technique i need to work with.
This is my Xml file:
Logo e effekt…

AXheladini
- 1,776
- 6
- 21
- 42
1
vote
5 answers
AS3 stage.addChild / stage.removeChild << Must be child of caller
If im usin function to add a mc to the stage like so:
var myChild:MC= new MC();
function somefunc()
{
stage.addChild(myMC)
}
but when I try to remove the mc by:
stage.removeChild(myMC)
I get The supplied DisplayObject must be a child of the…

Ric
- 13
- 1
- 1
- 3
1
vote
2 answers
move element into different element
I have a xml. I want to have the element move into
RMA-21001
RMA t.b.v. order_id…

RSp
- 11
- 1