# Library Movie clip "visibility" problem

**URL:** <https://forum.kirupa.com/t/library-movie-clip-visibility-problem/304250>\
**Category:** flash\
**Created:** [February 4, 2010, 8:18am UTC](https://forum.kirupa.com/t/library-movie-clip-visibility-problem/304250 "2010-02-04T08:18:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nighteagle](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@nighteagle](https://forum.kirupa.com/u/nighteagle)\
**Post date:** [February 4, 2010, 8:18am UTC](https://forum.kirupa.com/t/library-movie-clip-visibility-problem/304250/1 "2010-02-04T08:18:25Z")

</div>

I have a movie clip “target” in my library (and it’s exported for action script)  
I the action script attach this to the movie scene and everything works fine

```auto
var newTarget = this.attachMovie("target", "target1", depth);

```

After I’ve added a xml file and moved this part of the code in the xml onload event handler it stopped working.

```auto
imagesXML.onLoad = function() {
var newTarget = this.attachMovie("target", "target1", depth);
}

```

When I try to trace the newTarget object the result is undefined and in the first version the trased message was “\_level0.target1” so i suppose that the problem is in the first parameter of the attachMovie method…

Do you have any ideas what’s wrong with my code. Thank you.
