Hi all,
I’ve got a flash application that loads flash advertisements into a container and rotates through several SWFs on a schedule… I don’t have access to it, I just make the ads that play.
I’m having a problem getting sound through to these ads though.
Originally, I added the sounds as a layer and it played throughout the movie, but we decided it gets pretty annoying after the first time you hear it (The ads play continuously for 4-5 minute time blocks)
I modified my code to add the sound into the library, set the linkage for actionscript and then call the sound using the following code:
if (_root.hasPlayed != “Yes”) {
var my_sound:Sound = new Sound();
my_sound.attachSound(“ep_teddy_bear”);
my_sound.start(0,0);
_root.hasPlayed = “Yes”
}
This worked when the SWF was loaded by itself, but when another SWF calls it, it doesn’t work. I then changed the code to this:
if (_root.hasPlayed != “Yes”) {
newSound = new Sound ();
newSound.loadSound (“ep_teddy_bear.mp3”, true);
newSound.start (0,0);
_root.hasPlayed = “Yes”
}
this worked both locally and when i loaded it through a simple movie clip that loads the swf into a movieclip called “container”, HOWEVER, again when i uploaded it it didn’t work. I even tried it with no condition in the IF statement, thinking there was a problem with using the _root object, but still no go. I know it CAN play sound, because i already did, i just want it to play once.
any help would be much appreciated.
cheers