# Controlling sound from separate class

**URL:** <https://forum.kirupa.com/t/controlling-sound-from-separate-class/285846>\
**Category:** Uncategorized\
**Created:** [April 7, 2009, 9:05am UTC](https://forum.kirupa.com/t/controlling-sound-from-separate-class/285846 "2009-04-07T09:05:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryrocks](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@ryrocks](https://forum.kirupa.com/u/ryrocks)\
**Post date:** [April 7, 2009, 9:05am UTC](https://forum.kirupa.com/t/controlling-sound-from-separate-class/285846/1 "2009-04-07T09:05:54Z")

</div>

Hey,

Is it possible to start and stop a sound file from a separate class?

In the first class, “House”, I have called the MP3 using the following:

```auto

public var mySoundReq:URLRequest = new URLRequest("tune.mp3");
public var mySound:Sound = new Sound(); 

stage.addEventListener(Event.ENTER_FRAME, playSong);

public function playSong(event:Event):void
	{
		mySound.load(mySoundReq);
		mySound.play(1,100);
		stage.removeEventListener(Event.ENTER_FRAME, playSong);
	}

```

I want to be able to stop and start the music from another class called “Door.as”

I tried:

```auto

...

private var _house_mc:MovieClip;

...

_house_mc = parent.getChildByName("house_mc") as MovieClip;

...

_house_mc.mySound.stop();

```

I get the error:  
ReferenceError: Error #1069: Property stop not found on flash.media.Sound and there is no default value. at Door/control\_sound\_fnt()

Any advice/suggestions?

Thanks in advance 🙂
