simple play audio action script needed

Sep 12, 2012

I have created a simple flash movie (.swf) that plays and audio file when a invisible symbol/object is clicked.    It works alone but not when I publish in Articulate. Does anyone know of any action script I can use that works to play a simply audio file when clicked.  I am publishing the following action script with 2.0 settings for both the publish file and audio identifier file. 

pos = 0;
sound = new Sound();
sound.attachSound("mySound");

play_btn.onPress = function(){
    sound.start(pos, 1);
    play_btn._visible = false;
};

Can you help or direct me to someone who can.

Thanks,

Rick

2 Replies
Paul Kornman

I tried your code with the same results.

So, here's what I did to get around it.

I made a movieClip with the sound in it, starting at frame 5 and with a frame label of "start".

I put a 'stop();' script in frame 1, so the sound won't play until it should.

Make sure the clip is long enough for the whole sound.

Put the movieClip on the stage and give it a name. I called mine 'mcSound'.

I changed your code to be:

play_btn.onPress = function(){
    mcSound.gotoAndPlay("start");
    play_btn._visible = false;
};

Good luck,

Paul K.

This discussion is closed. You can start a new discussion or contact Articulate Support.