Commenta
2nd January , 2010
Hi everyone. Thanks for reading my post. I’m working on a flash document and I want load an external sound file and have a preloader. I know this is simple for a well versed AS coder but I’m not an expert by far and I am having trouble making them both work at the same time. If I comment out the preloader the sound will work. If I comment out the sound the preloader will work. I’m sure its just a simple syntax error but I don’t know where. Can someone take a look an help me out? I would so so appreciate it. Thanks ever so much, in advance.
P.S. happy New Year
stop()
this.onEnterFrame = function() {
var procentLoaded:Number = this.getBytesLoaded()/this.getBytesTotal()*100;
bar._xscale = procentLoaded;
if (procentLoaded == 100) {
this.gotoAndPlay(2);
}
} this.createTextField("status_txt",this.getNextHigh estDepth(),0,0,100,22);
// create a new Sound object
var my_sound:Sound = new Sound();
// if the sound loads, play it; if not, trace failure loading
my_sound.onLoad = function(success:Boolean) {
if (success) {
my_sound.start();
} else {
status_txt.text = "failed";
}
};
// load the sound
my_sound.loadSound("tidepool.mp3", true);
Original post by angie74
This entry was posted
on Saturday, January 2nd, 2010 at 10:11 pm.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.