# Shape (instance?) question

**URL:** <https://forum.kirupa.com/t/shape-instance-question/228197>\
**Category:** Uncategorized\
**Created:** [June 6, 2007, 2:07am UTC](https://forum.kirupa.com/t/shape-instance-question/228197 "2007-06-06T02:07:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasxa](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sasxa](https://forum.kirupa.com/u/sasxa)\
**Post date:** [June 6, 2007, 2:07am UTC](https://forum.kirupa.com/t/shape-instance-question/228197/1 "2007-06-06T02:07:53Z")

</div>

hello,

can you guys tell me how this code works, im having trouble understanding what’s going on…

```auto

//class import, declaration, constructor etc.

var myRect:Shape = new Shape();
/* fill shape, drawRect.... */

var a:Sprite = new Sprite();
stage.addChild(a);
a.addChild(myRect);

var b:Sprite = new Sprite();
stage.addChild(b);
b.addChild(myRect);

```

ok, say I have some code like that- what happens is that only sprite b has fill, I can’t see fill in sprite a… Why? Shouldn’t myRect shape behave like instance and appear in both sprites? or I’m moving it from one to another?

Sasxa
