# Using Classes

**URL:** <https://forum.kirupa.com/t/using-classes/248999>\
**Category:** flash\
**Created:** [January 14, 2008, 3:29pm UTC](https://forum.kirupa.com/t/using-classes/248999 "2008-01-14T15:29:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geminione](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@geminione](https://forum.kirupa.com/u/geminione)\
**Post date:** [January 14, 2008, 3:29pm UTC](https://forum.kirupa.com/t/using-classes/248999/1 "2008-01-14T15:29:55Z")

</div>

I tried doing this with a function (see below), but realized that doesn’t work so thought I should use a class. My question is can a class reside in the document being used or do I have to write a myClass.as file and import it? I’m trying to create a projector file with no external links.

I’m trying to set something up where I have one button that can be shared for ten different actions all with different results (loads different info on the stage).

example buttons:  
product 1  
product 2  
product 3  
—\>\> there’d be a sub menu on the stage that those buttons load call “sub menu” I want that sub menu button to load info on the current product selected. If that makes sense.

Thanks.
