-
[CS3] Total n00b here, need simple help
K, trying to essentially make a multimedia enclosure with audio and video file, and have followed this tutorial in terms of making the buttons trigger the file with the following as:
Code:
var loadSnd:URLRequest = new URLRequest("filepath.mp3");
var thisSnd:Sound = new Sound();
thisSnd.load(loadSnd);
var sndTrans:SoundChannel = new SoundChannel();
playAudioBtn.addEventListener(MouseEvent.CLICK, playF);
pauseAudioBtn.addEventListener(MouseEvent.CLICK, pauseF);
function playF(eventMouseEvent):void {
SoundMixer.stopAll();
sndTrans = thisSnd.play();
}
function pauseF(eventMouseEvent):void {
sndTrans.pause();
}
Basically I substituted all instances of "stop" which worked, for "pause" which didn't work. Before I did the stopF worked just fine. Is there a simple way to go from a stop function to a pause function?
TIA
-
Developing For Dunkets
not as simple as you might hope. At least it wasn't in AS2. I haven't messed with AS3 sound but if you go to the help files and search for Sound, then find the sound object you'll find a complete list of all its properties. In as2 there is a position property. Also, it is sound.start() but now is sound.play(). However, you used to store sound.position in a variable and then pass it as a parameter to sound.start(). I doubt too much as changed so you might see if sound.position still exists. Also, there may be a new property I don't know about capable of pausing a sound -that would be nice-. If there is that would be easier. Hopefully this will help you figure it out.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|