# Sound as property in class?

**URL:** <https://forum.kirupa.com/t/sound-as-property-in-class/221764>\
**Category:** flash\
**Created:** [April 7, 2007, 6:39am UTC](https://forum.kirupa.com/t/sound-as-property-in-class/221764 "2007-04-07T06:39:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nakor](https://avatars.discourse-cdn.com/v4/letter/n/d07c76/32.png) [@nakor](https://forum.kirupa.com/u/nakor)\
**Post date:** [April 7, 2007, 6:39am UTC](https://forum.kirupa.com/t/sound-as-property-in-class/221764/1 "2007-04-07T06:39:44Z")

</div>

I have a class where a property is a sound variable, but it doesn’t work.

Is this possible and I’m doing something wrong or will this never work?

Here is an example:

ActionScript Code:  
[LEFT][FONT=Courier New][COLOR=#000000] **class** [/COLOR] exampleClass[COLOR=#000000]{[/COLOR][/FONT]  
[FONT=Courier New] [COLOR=#0000ff]private[/COLOR] [COLOR=#000000] **var** [/COLOR] \_sound:[COLOR=#0000ff]Sound[/COLOR][/FONT]  
[FONT=Courier New] [COLOR=#000000] **function** [/COLOR] exampleClassCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR][/FONT]  
[FONT=Courier New] [COLOR=#0000ff]this[/COLOR].\_sound = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]Sound[/COLOR]COLOR=#000000[/COLOR][/FONT]  
[FONT=Courier New] [COLOR=#000000]}[/COLOR][/FONT]  
[FONT=Courier New][COLOR=#000000] **function** [/COLOR] [COLOR=#0000ff]loadSong[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR][/FONT]  
[FONT=Courier New] [COLOR=#0000ff]this[/COLOR].\_sound.[COLOR=#0000ff]loadSound[/COLOR]COLOR=#000000[/COLOR][/FONT]  
[FONT=Courier New] [COLOR=#000000]}[/COLOR][/FONT]  
[FONT=Courier New]}[/FONT][/LEFT]

Anyonegot any ideas?
