# \[Question\] Why cant classes acces objects on stage?

**URL:** <https://forum.kirupa.com/t/question-why-cant-classes-acces-objects-on-stage/293064>\
**Category:** flash\
**Created:** [July 22, 2009, 6:46pm UTC](https://forum.kirupa.com/t/question-why-cant-classes-acces-objects-on-stage/293064 "2009-07-22T18:46:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashmxboy](https://avatars.discourse-cdn.com/v4/letter/f/779978/32.png) [@flashmxboy](https://forum.kirupa.com/u/flashmxboy)\
**Post date:** [July 22, 2009, 6:46pm UTC](https://forum.kirupa.com/t/question-why-cant-classes-acces-objects-on-stage/293064/1 "2009-07-22T18:46:40Z")

</div>

Hi:)

Im trying to get used to packages and classes in AS3. Im used to put all code on the first frame of the timeline, but now i have 442 lines of code on the first frame. Yeah 442. And this is for a game engine so i thought i should put it inside some classes to make it easier to read an reusable. But i have noticed that if i create a class called Code and make a instance of that class like this:  
[AS]var codeObject:Code = new Code();[/AS]  
i get a bunch of errors because the class cant Acess the stage and the display list. Why??  
i found a workaround by linking the class to a movieClip and and do this:  
[AS]MovieClip(parent);[/AS]  
But im just wondering why classes cant acess the stage:h: Anybody knows why??

Thanks:D
