This content has been marked as final. Show 5 replies
check the sound class in the flash help files. you must have already created a member of the class to use the loadSound() method.
you can also use the stop() and start() methods of the sound class and the position property to control your sound including pausing, ff'g and rewinding.
I have tried using the position class to pause the sound file, below is the code that i used, however it doesn't work, maybe there is an error somewhere??
When i trace the variable soundPosition, in the pause button, it is undefined, so i believe the code which isnt working is the line "soundPosition = mySound.position" because if i set the position to any random number, this works?!?
you only need to create one sound object. re-creating it in each of your button handlers is causing a problem:
that's great thank you so much for that, i had the sound class declared inside of the play button function this is where i was going wrong?!!!!?
You mention previously that i could use the position property to make the sound pause, ff and rewind. How would i use this to make the track ff/rewind???
Many thanks it is greatly appreciated :D
stop your sound and start a loop when those buttons are pressed. in each loop iteration increase (for ff) or decrease (for rewind) soundPosition.
you'll usually need to give the user some visual feedback about soundPosition so they can see how far they are advancing or rewinding. on release start your sound using the updated soundPosition.