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:
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:
...
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