View Full Version : attachSound (HELP)
eDdi3
08-07-2003, 05:15 PM
Is it possible to attachSound and when you play the sound clip let the sound clip play while downloading at the same time instead of having to wait untill it downloads fully. How do i go about doing this?
binkyboo
08-07-2003, 11:35 PM
I'm working on a similar issue and finally resolved my problem. I'm loading an external mp3. When the mp3 is 25% loaded, the file begins playing.
soundObj = new Sound(this);
soundObj.loadSound("http://www.geocities.com/ajaychhaya/project/sounds/sound1.mp3", true);
checkProgress = setInterval(checkLoad, 50);
startEarly = setInterval(playIt, 50);
function checkload() {
obj = soundObj;
lBytes = obj.getBytesLoaded();
tBytes = obj.getBytesTotal();
percentLoaded = (lBytes/tBytes)*100;
_root.progressBar._xscale = percentLoaded;
if (lBytes>tBytes) {
clearInterval(checkProgress);
}
}
function playIt() {
if (percentLoaded > 25) {
trace("trudat");
clearInterval(startEarly);
soundObj.start();
}
}
eDdi3
08-08-2003, 01:55 PM
I am new to actionscript. Thanks for replying. One more question is. Where exactly do i place this actionscript?
on the frame action>>right click on the first frame of your movie>>open actionscripts>> and put the code there
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.