Audio file preloader won't move on when done

  • phil_roy
  • Born
  • Born
  • phil_roy
  • Posts: 1

Post 3+ Months Ago

I recently looked at http://www.kennybellew.com/tutorial to create a preloader that loads an MP3 in the first frame of my main timeline. The tutorial told me to create a movie clip and place it on the first frame of the timeline. Inside that clip, I have the following code...

Code: [ Select ]
onClipEvent(load) {
_root.stop();
myMusic = new Sound();
myMusic.loadSound("loop.mp3");
_root.loadBar._xscale=0;
myMusic.onLoad = function() {
    myMusic.start(myMusic, 999);
    
    // this code added by phil
    firstSoundVolume=80;
    _root.myMusic.setVolume(firstSoundVolume);
    //
}
}

onClipEvent(enterFrame) {
    mySoundBytesTotal = myMusic.getBytesTotal();
    mySoundBytesLoaded= myMusic.getBytesLoaded();
    mySoundLoading=Math.round((mySoundBytesLoaded/mySoundBytesTotal)*100);
if (mySoundLoading!=nul) {
  _root.loadBar._xscale=mySoundLoading;
}
}
  1. onClipEvent(load) {
  2. _root.stop();
  3. myMusic = new Sound();
  4. myMusic.loadSound("loop.mp3");
  5. _root.loadBar._xscale=0;
  6. myMusic.onLoad = function() {
  7.     myMusic.start(myMusic, 999);
  8.     
  9.     // this code added by phil
  10.     firstSoundVolume=80;
  11.     _root.myMusic.setVolume(firstSoundVolume);
  12.     //
  13. }
  14. }
  15. onClipEvent(enterFrame) {
  16.     mySoundBytesTotal = myMusic.getBytesTotal();
  17.     mySoundBytesLoaded= myMusic.getBytesLoaded();
  18.     mySoundLoading=Math.round((mySoundBytesLoaded/mySoundBytesTotal)*100);
  19. if (mySoundLoading!=nul) {
  20.   _root.loadBar._xscale=mySoundLoading;
  21. }
  22. }


I just need the fuel gauge to get to 100% and then for the project to proceed playing. But I can't get it to work. I can get the sound to load and keep looping (but the timeline never moves) or I can get the timeline to continue, but the sound gets killed of once our of the first frame.

I've tried adding
_root.gotoandPlay (2);
but this never seems too work.

I have another preloader in the first frame of the main timeline also. However this one monitors the graphics being loaded and has no stop or start commands. This is because there are few graphics and it loads quickly....but I then need the sound to load and then the main timeline to start playing.

Phil
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 23 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.