Question
I have a preloader, but...
I have an mp3 file in a Flash movie using Flash MX.
The movie purely consists of the mp3 file and a stop and play button.
I would like the music (or movie) to play when 50% loaded and I am searching the net to find a way.
I already have a preloader which works perfectly using the following actionscript...but I'd like to know what to tweak in order to make the music (movie) play when 50% loaded. My current action script is as follows...
lBytes = _root.getBytesLoaded();
tBytes = _root.getBytesTotal();
percentLoaded = Math.floor((lBytes/tBytes)*100);
loader.bar._xscale = percentLoaded;
loader.percent.text = percentLoaded + "% of " + Math.floor(tBytes/1024) + "K loaded.";
if (lBytes>=tBytes && tBytes>0) {
if (count>=12) {
gotoAndStop("main");
} else {
count++;
gotoAndPlay("preload");
}
} else {
gotoAndPlay("preload");
}
....I know that there are other ways of playing mp3 on Flash (ie. Media Playback Component and a multitude of templates on the net) however I find that the Flash players that load the mp3 externally play at different speeds in different browers, so becuase of this I choose to have the mp3 located within the flash movie to avoid any inconsistancies amongst browsers. All I require is actionscript that makes the music (or movie) play when 50% loaded.
I'm gonna continue to search for an answer, and if I find a solution I will update my post.
Thanks!
You can see the swf file in the following htm page...
http://www.plobs.com/theme_song.htm
The movie purely consists of the mp3 file and a stop and play button.
I would like the music (or movie) to play when 50% loaded and I am searching the net to find a way.
I already have a preloader which works perfectly using the following actionscript...but I'd like to know what to tweak in order to make the music (movie) play when 50% loaded. My current action script is as follows...
lBytes = _root.getBytesLoaded();
tBytes = _root.getBytesTotal();
percentLoaded = Math.floor((lBytes/tBytes)*100);
loader.bar._xscale = percentLoaded;
loader.percent.text = percentLoaded + "% of " + Math.floor(tBytes/1024) + "K loaded.";
if (lBytes>=tBytes && tBytes>0) {
if (count>=12) {
gotoAndStop("main");
} else {
count++;
gotoAndPlay("preload");
}
} else {
gotoAndPlay("preload");
}
....I know that there are other ways of playing mp3 on Flash (ie. Media Playback Component and a multitude of templates on the net) however I find that the Flash players that load the mp3 externally play at different speeds in different browers, so becuase of this I choose to have the mp3 located within the flash movie to avoid any inconsistancies amongst browsers. All I require is actionscript that makes the music (or movie) play when 50% loaded.
I'm gonna continue to search for an answer, and if I find a solution I will update my post.
Thanks!
You can see the swf file in the following htm page...
http://www.plobs.com/theme_song.htm
