PDA

View Full Version : 1st post- small issue


icewater1
05-24-2003, 02:55 AM
trying to start a .mp3 file sort of in the middle of a movie... the first scene is the loading sequence....then onto the 2nd scene if the loading sequence hasn't been skipped.... ok so far so good.
Now, at the start of the 2nd scene i have placed the .mp3 file to play using the the following code:

cheer_sound = new Sound();
cheer_sound.attachSound("music_sound");
_root.onEnterFrame = function() {
mouse_sound.start(0, 1);
};

my problem is that the code works fine until the music starts playing....it sounds as though it's looping over itself on each frame... any clue what i'm missing?

TIA

CyanBlue
05-24-2003, 05:31 AM
Howdy and Welcome... ;)

Is there any reason why you have used onEnterFrame handler for the sound start??? That's where it is looping... I am not sure why you have two sounds, cheer_sound and mouse_sound, right there in one frame... Maybe you need to tell us what you want to do...

This would be the example of the code if you need to play one sound over and over...cheer_sound = new Sound(this);
cheer_sound.attachSound("music_sound");
cheer_sound.start(0, 9999);Add 'this' whether you need it or not... That will save you some sweat... The second argument in start() function will be the one that tells the sound object how many times it needs to loop... And, I'd avoid using scene if I were you... Scenes are just plain devil... Use frame label in one scene instead...

Let me know... ;)

Oh... Please use code formatting (http://www.actionscript.org/forums/misc.php3?action=bbcode#buttons) next time you post your code... That's more readable... :)

icewater1
05-25-2003, 01:09 AM
CyanBlue, tis trully amazing what one overlooks, or even just doesn't know... Thanks I changed my numerous names for the same music file and removed the onEnterFrame tag and well, it flows smoothly now. thanks again.


BTW...sorry for the AS color syntax errors.