# Using a "factory" class globally

**URL:** <https://forum.kirupa.com/t/using-a-factory-class-globally/234348>\
**Category:** flash\
**Created:** [August 1, 2007, 3:19pm UTC](https://forum.kirupa.com/t/using-a-factory-class-globally/234348 "2007-08-01T15:19:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan0](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Dan0](https://forum.kirupa.com/u/Dan0)\
**Post date:** [August 1, 2007, 3:19pm UTC](https://forum.kirupa.com/t/using-a-factory-class-globally/234348/1 "2007-08-01T15:19:23Z")

</div>

Ok,  
So i have my “factory” class which holds some functions and variables/objects (eg. glow filters) used globally by many different instances. But every time I want to use somthing I am currently initiating a new object every time in the function. This is not good and can make the code messy. Is there a way I can have any instance anywhere being able to refference to this factory class without having to have the refferences passed to it previously. I guess what I am asking for is a global refference.  
I hope this is easy to answer,  
Thanks for reading/helping,  
Dan
