# AS2 attachMovie with initObject

**URL:** <https://forum.kirupa.com/t/as2-attachmovie-with-initobject/75814>\
**Category:** flash\
**Created:** [January 12, 2005, 10:50am UTC](https://forum.kirupa.com/t/as2-attachmovie-with-initobject/75814 "2005-01-12T10:50:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daheroes](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@daheroes](https://forum.kirupa.com/u/daheroes)\
**Post date:** [January 12, 2005, 10:50am UTC](https://forum.kirupa.com/t/as2-attachmovie-with-initobject/75814/1 "2005-01-12T10:50:26Z")

</div>

Hello All.

I’ve managed to accomplish much by myself, but I find myself coming back to this great site for help.

Ok. I’m attaching a clip to \_root using .attachMovie, and the clip I’m attaching is an instance of a class. Normally, attachMovie() returns a reference to the newly created clip. However, when you’re using the optional initObject commands, it seems it doesn’t return anything. That is, I’m using this:

```auto
var x = _root.attachMovie("blank", "line" + thickness + color, _root.getNextHighestDepth()).initialize(parent, thickness, color, opacity, angle, length, startX, startY);

```

And x is always undefined.

Is there any way around this? Can anyone help me? Is your favorite color red?

Well, I’ll be grateful for any help I can get on this one, folks.

-Brekk
