# MovieClip-derived object not appearing?

**URL:** <https://forum.kirupa.com/t/movieclip-derived-object-not-appearing/120479>\
**Category:** Uncategorized\
**Created:** [August 24, 2004, 7:04pm UTC](https://forum.kirupa.com/t/movieclip-derived-object-not-appearing/120479 "2004-08-24T19:04:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oneirotekt](https://avatars.discourse-cdn.com/v4/letter/o/e68b1a/32.png) [@oneirotekt](https://forum.kirupa.com/u/oneirotekt)\
**Post date:** [August 24, 2004, 7:04pm UTC](https://forum.kirupa.com/t/movieclip-derived-object-not-appearing/120479/1 "2004-08-24T19:04:52Z")

</div>

Ach. I have a class that extends MovieClip called AxonClip, and a class that extends AxonClip called Target. I create several new Target objects like so:

```auto

   Targets* = new Target("Targ"+i);
   
   Targets*.attachMovie("TargetArt", "TarGuy"+i, iDepth);
   

```

Later I update the position of that Target by changing its \_x property. This _seems_ to happen, as I can then trace(\_x) and see that physics things are changing it. However, the clip never _appears_ no matter what I do. I suspect this is because my Target class is not actually inheriting all the properties and methods that MovieClip has. If this is the case, is there something I can put in my class declaration, constructor or elsewhere to make sure these things inherit from MovieClip?

Also, is the AttachMovie even necessary, is there a better way to do it like linking a clip from the library to the particular class?

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [August 24, 2004, 7:12pm UTC](https://forum.kirupa.com/t/movieclip-derived-object-not-appearing/120479/2 "2004-08-24T19:12:53Z")

</div>

you cant use new to instantiate a class instance that extends movieclip. You have to use attachMovie

Targets\* = parenttimeline.attachMovie(“TargetArt”, “TarGuy”+i, iDepth);

---

<div class="post-metadata">

**Author:** ![oneirotekt](https://avatars.discourse-cdn.com/v4/letter/o/e68b1a/32.png) [@oneirotekt](https://forum.kirupa.com/u/oneirotekt)\
**Post date:** [August 24, 2004, 7:51pm UTC](https://forum.kirupa.com/t/movieclip-derived-object-not-appearing/120479/3 "2004-08-24T19:51:41Z")

</div>

> [@senocular](#):
>
> you cant use new to instantiate a class instance that extends movieclip. You have to use attachMovie
> 
> Targets\* = parenttimeline.attachMovie(“TargetArt”, “TarGuy”+i, iDepth);

I’m not following you 100%… attachMovie doesn’t create anything, it just attaches a clip to an existing MovieClip, right? If I want to do the equivalent of that “new Target()” statement given that it’s a MovieClip, what do I use?

---

<div class="post-metadata">

**Author:** ![oneirotekt](https://avatars.discourse-cdn.com/v4/letter/o/e68b1a/32.png) [@oneirotekt](https://forum.kirupa.com/u/oneirotekt)\
**Post date:** [August 25, 2004, 5:09pm UTC](https://forum.kirupa.com/t/movieclip-derived-object-not-appearing/120479/4 "2004-08-25T17:09:30Z")

</div>

Okay, I’ve got an attachMovie clip of some sort to appear, but it doesn’t seem to be of the type I want it.

I’m really, really confused about that last optional parameter of attachMovie, which seems key to the whole idea. The code from the tutorial here:

[http://www.kirupa.com/developer/oop2/AS2OOPInheritance4.htm](http://www.kirupa.com/developer/oop2/AS2OOPInheritance4.htm)

has the “InitObject” written in brackets, with a call to a function in that Object’s class definition after the statement(?!). Yet other documentation (the AS dictionary on MM’s site) has it in square brackets. Can someone explain exactly how the whole InitObject thing works? What’s the syntax, and when it is necessary and not necessary?

(Thanks for the help so far, Senocular!)
