Forum Discussion

KaiDean's avatar
KaiDean
Community Member
5 months ago

Sound effect stops working when moving from one slide to another

Here is my scenario. I have a popup window that plays a sound effect. This is a slide layer in the master. When I trigger the popup to show on any initial slide the sound effect plays as expected. BUT, when you move to any other slide, the visual works as expected but the sound effect no longer plays. I have tried everything I can think of but nothing seems to work. It is very odd that it works initially but stops once you move slides. 

Anyone have any suggestions?

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    Hi Kai,

    The good news is, this scenario should (and does!) definitely work (as its something I have used for lots of gamified learning builds)

    So, the first thing Im thinking is - is your layer properties set to "RESET TO INITIAL STATE" and "allowing seeking" = NO? If not, do both of those and test it.

    Failing that, are other layers (not on your Master slide) set to close other slide layers when they open? If so, they will shut down your Master layer before it begins to play the audio potentially.

    (this is why it can be very tricky to set it up like this - with layers in the Master slides) because we need to remember that we need to set every single layer in our build (whether inside or outside master) to not close other slide layers, and instead handle this all manually (or at least, be very careful and deliberate when we do let them close layers)

    Its difficult to diagnose more than this without seeing the file or knowing more about your setup.

    Sure, try the above and let's see :)

    • KaiDean's avatar
      KaiDean
      Community Member

      Hi Andrew.

      Thanks for these. Unfortunately I tried all of these first to no avail.

      The slide layer is definiately not being hidden/closed by other layers (I always turn this off everytime I create a new slide layer, I wish we could have it as a global setting!) as the visual is staying on-screen as expected plus the sound effect is working on a single slide every time. It only stops working when you move from one slide to another, it is very odd behaviour, I cannot think of any other reason why the audio would stop. Back when I was a Flash developer I used to use a comand called stopAllSounds(); which did exactly that but there is nothing I am aware of that would stop a sound from playing specifically.

       

  • KaiDean's avatar
    KaiDean
    Community Member

    I have just tried something else, I removed the audio from the original slide layer and put it into it's own but this had the same effect.

    • AndrewHanley's avatar
      AndrewHanley
      Community Member

      Kai Dean
      I have just tried something else, I removed the audio from the original slide layer and put it into it's own but this had the same effect.

       For advanced things like this Kai, I would always recommend audio be placed in its own layer. 100% good idea that I would stick with.

      Ensure that layer is set to automatically close at end (in layer properties) and it should be watertight.

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    lol. Now, Kai - you cant just drop in wonderful Actionscript references and not expect me to go weak at the knees! XD
    I LOVED Flash and had many successful years writing games and apps in it. Wonderful wonderful program and IDE. Still miss it today....

    Anyways!!!!

    I cant think of any other reason your audio wouldnt play if its on a layer that you are correctly triggering to Show/Hide the layer when needed.

    Does it "Hide Layer when timeline ends"? This is my only other possibility - if a layer is already showing, then giving it another SHOW command does nothing. The layer doesnt reset and will appear "not to work". Perhaps this in your case?

    If not, the next thing is to share your file here if you can. That way we can both dive in and ensure that:

    on mouseUp = function() {
         g_kaisSound.attachSound("cheer.mp3");
         g_soundThrow.start(0,1);
    }

    ;)

    • KaiDean's avatar
      KaiDean
      Community Member
      Andrew Hanley

      lol. Now, Kai - you cant just drop in wonderful Actionscript references and not expect me to go weak at the knees! XD
      I LOVED Flash and had many successful years writing games and apps in it. Wonderful wonderful program and IDE. Still miss it today....

      Anyways!!!!

      I cant think of any other reason your audio wouldnt play if its on a layer that you are correctly triggering to Show/Hide the layer when needed.

      Does it "Hide Layer when timeline ends"? This is my only other possibility - if a layer is already showing, then giving it another SHOW command does nothing. The layer doesnt reset and will appear "not to work". Perhaps this in your case?

      If not, the next thing is to share your file here if you can. That way we can both dive in and ensure that:

      on mouseUp = function() {
           g_kaisSound.attachSound("cheer.mp3");
           g_soundThrow.start(0,1);
      }

      ;)

      LOL!

      I miss Flash too, I still think in terms of ActionScript when builidng Storyline. I built in Flash for about 15 years all the way from Flash 3 I think.

      The slide layer does hide when the timeline ends, I tested that too by removing that setting and doing it manually on the layer. I also made sure the layer is actually being hidden by adding a red box to the layer with no animations. Alas, it was hiding correctly.

      Unfortunately, I cannot share my file, it is a senstive piece of project work.

      I think I am out of ideas, my last option is to make a new slide layer from scratch and see if that helps, sometimes this works on dodgy slides so I will give a try with layers.

      On a complete side note, I live just outside the city of Stoke-on-Trent in the UK, the city centre of Stoke-on-Trent is Hanley. I don't recommend a visit but amusing all the same.

      Thanks for your help, much appreciated, your profile image looks familiar, do you go to any conferences? 

      • AndrewHanley's avatar
        AndrewHanley
        Community Member
        Kai Dean
         

        On a complete side note, I live just outside the city of Stoke-on-Trent in the UK, the city centre of Stoke-on-Trent is Hanley. I don't recommend a visit but amusing all the same.

        Thanks for your help, much appreciated, your profile image looks familiar, do you go to any conferences? 

        Yeah I get a royalty every year for them to use my name in their town :P

        I know Stoke on Trent well. Nice part of the world. Think Ive only visited Hanley once though... and cant remember it, so maybe that says it all!

        Re: conferences. Its been a while since I did any of those so I dont think its from that you know me. Maybe the old Flash community and forums etc?
        The last conferences I attended where for mobile apps, and the last conferences I spoke at where alll the way back when I started in game development and was blessed to get to the big shows round the world and play with the newest tech and consoles etc. From there I went to multimedia development (in the awesome Macromedia Director! RIP) and from there to Flash AS for games and mobile apps, and then in to Flash eLearning (manual SCORM packaging is fun!) and from there to Storyline.

  • KaiDean's avatar
    KaiDean
    Community Member

    Nope, that didn't work either. Interestingly, I only showed the audio layer without the visuals and it still stopped working once I moved to the next slide.

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    Kai, I'll try to put a quick tech demo here. See if we can't crack this nut together.

    In order for me to make this as close as possible to what you need, can you explain exactly how and what your audio part is working. What when how etc.