-
[CS3] Screen with sound and rollover that stops it too. HELP!!!
Your help will be reaaally appreciated.
I have a screen with text and a voiceover audio that reads it. There is a rollover button on a word that opens up a popup. When this button opens the sound stops.
I would like to be able to resume the sound where it stopped once I leave the rollover popup.
Is this possible? Thanks so much.
Mercedes
-
pausing a sound in as3....roundabout activity
Good Day Mercedes,
Unfortunately as3 doesn't seem to have a pause. What you would have to do is keep the position in a variable and then stop the sound. On rolling out of the hotspot you would then have to get the sound to play from the stored point.
-Plasnid
A little pain never hurt anyone
-
Screen with sound and rollover
Hi Plasnid and so grateful for your quick reply.
Could you share the code for this variable? I am really new to Flash.
Thanks a lot,
Mercedes
-
Good Day Mercedes,
Here is how I would structure what you're after. Ideally this should be in a class, but it will work like this. joy is a reference to a sound the in library.
PHP Code:
var position:Number;
var sounder:joy;
var channel:SoundChannel;
function init():void{
initPosition();
initSound();
channel = sounder.play();
overPauseMc.addEventListener(MouseEvent.MOUSE_OVER, overAction);
overPauseMc.addEventListener(MouseEvent.MOUSE_OUT, outAction);
}
function initSound(){
sounder = new joy();
}
function initPosition():void{
position = 0;
}
function overAction(e:MouseEvent):void{
trace(channel.position);
position = channel.position;
channel.stop();
}
function outAction(e:MouseEvent):void{
channel = sounder.play(position);
}
init();
Have fun!
-Plasnid
A little pain never hurt anyone
-
Sound in screen
Thanks so much Plasnid.
By the way, what is your experience with game design? I need to design an educational game (called serious game) where I can have avatars, levels, scoring and quizzes.
I do have something in very rough form.
Please let me know if you would be interested in collaborating in this project and also let me know your rates.
Mercedes
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
|