|
-
Scrolling through sound
I am producing a file that will allow you to control the content of the timeline with a scrollbar. This function works OK.
I am also playing a voice (content being read) over the top. This sound needs to be controlled as well. So basically anyone watching the file can scroll the flash backwards or forwards and both the animation + sound will play the appropriate section.
Below is the code I currently have. As I said, the scrolling of the content works perfectly, but I currently don't have the control of the sound.
Is this even possible?
Hopefully someone can help?
Cheers
--------
var segs:Number = 0; //This is where we will store the segs played
var misonido:Sound = new Sound();
misonido.attachSound("misonido"); //misonido is the linkage id of the sound in the library
misonido.start(0); //Start from the beginning
var pausado:Boolean = false;
function resumeSound(){
if(pausado){ //check if the sound was paused
// trace(segs/1000); //The number stored is in miliseconds, so you need to
//make it seconds
misonido.start(segs/1000);
pausado = false; //sound is not paused anymore
}
}
function stopSound(){
segs = misonido.position;
stopAllSounds();
pausado = true;
}
myButton.onEnterFrame = function() {
this._x = _currentframe + 0;
};
myButton.onPress = function() {
delete this.onEnterFrame;
stopSound()
startDrag(this, false, 0, this._y, 550, this._y);
onEnterFrame = function () {
gotoAndStop(Math.round(myButton._x + 0));
};
};
// Below set the button release frame count.
myButton.onRelease = myButton.onReleaseOutside = function () {
stopDrag();
resumeSound()
onEnterFrame = nextFrame;
this.onEnterFrame = function() {
this._x = _currentframe + 0;
};
};
Tags for this Thread
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
|