# \[f9 AS3\] Declaring an instance of each class

**URL:** <https://forum.kirupa.com/t/f9-as3-declaring-an-instance-of-each-class/219534>\
**Category:** flash\
**Created:** [March 17, 2007, 3:27pm UTC](https://forum.kirupa.com/t/f9-as3-declaring-an-instance-of-each-class/219534 "2007-03-17T15:27:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rezmason](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rezmason/32/30447_2.png) [@Rezmason](https://forum.kirupa.com/u/Rezmason)\
**Post date:** [March 17, 2007, 3:27pm UTC](https://forum.kirupa.com/t/f9-as3-declaring-an-instance-of-each-class/219534/1 "2007-03-17T15:27:19Z")

</div>

This will sound odd, but I would like to find a way for Flash to declare one instance of each class inside a package. That is to say, if a package com.rezmason.stuff contains five classes, some code makes an instance of each class in an array; but if, later on, I take out two classes, that same code only makes an instance for each of the three remaining classes within the package. Later still, if I add seven classes, the same code makes an instance fore each of those ten classes.

I doubt that this is possible, but I figured that if anyone would know, it would be you folks. Code with this kind of flexibility would greatly simplify managing the code in a project that frequently has classes being added, removed and swapped. If anyone has an idea, I’d like to hear it.
