# \[as3\]if.. | not working animation

**URL:** <https://forum.kirupa.com/t/as3-if-not-working-animation/286170>\
**Category:** flash\
**Created:** [April 11, 2009, 8:16am UTC](https://forum.kirupa.com/t/as3-if-not-working-animation/286170 "2009-04-11T08:16:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skabszo](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@skabszo](https://forum.kirupa.com/u/skabszo)\
**Post date:** [April 11, 2009, 8:16am UTC](https://forum.kirupa.com/t/as3-if-not-working-animation/286170/1 "2009-04-11T08:16:16Z")

</div>

Ive got this simple code:

```auto

import flash.events.MouseEvent;

var myImageMovie:ImageMovie = new ImageMovie();
myImageMovie.x = 20;
myImageMovie.y = 20;

var myImageMovie2:a2 = new a2();
myImageMovie2.x = 20;
myImageMovie2.y = 20;

var myImageMovie3:a3 = new a3();
myImageMovie3.x = 20;
myImageMovie3.y = 20;

ab.buttonMode = true;
ab2.buttonMode = true;
ab3.buttonMode = true;
ab.addEventListener (MouseEvent.CLICK,open);
ab2.addEventListener(MouseEvent.CLICK,open);
ab3.addEventListener(MouseEvent.CLICK,open);

function open ($event:MouseEvent) {
    if(this.contains(myImageMovie)) {
        this.removeChild(myImageMovie);
    }
    if(this.contains(myImageMovie2)) {
        this.removeChild(myImageMovie2);
    }
    if(this.contains(myImageMovie3)) {
        this.removeChild(myImageMovie3);
    }
    if ($event.target == ab) addChild(myImageMovie);
    if ($event.target == ab2) addChild(myImageMovie2);
    if ($event.target == ab3) addChild(myImageMovie3);
    //
}

```

in library ive got ImageMovie,a2 and a3 mc’s. on stage buttons ab,ab2,ab3. Ive got only ONE question - why added mc’s from library are only ‘putted’ on stage;if in it is some animation it didn’t pass. MCs appeard on stage and its all… why?
