A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [CS3] Screen with sound and rollover that stops it too. HELP!!!

  1. #1
    Junior Member
    Join Date
    Aug 2008
    Posts
    3

    Unhappy [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

  2. #2
    Space Midget Wrangler
    Join Date
    Sep 2002
    Posts
    129

    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

  3. #3
    Junior Member
    Join Date
    Aug 2008
    Posts
    3

    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

  4. #4
    Space Midget Wrangler
    Join Date
    Sep 2002
    Posts
    129
    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_OVERoverAction);
        
    overPauseMc.addEventListener(MouseEvent.MOUSE_OUToutAction);
    }
    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

  5. #5
    Junior Member
    Join Date
    Aug 2008
    Posts
    3

    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center