# Preloader for two scene music player

**URL:** https://forum.kirupa.com/t/preloader-for-two-scene-music-player/80127
**Category:** Uncategorized
**Created:** [February 19, 2005, 5:52pm UTC](https://forum.kirupa.com/t/preloader-for-two-scene-music-player/80127 "2005-02-19T17:52:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kidIcarus](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@kidIcarus](https://forum.kirupa.com/u/kidIcarus)
#### Post date: [February 19, 2005, 5:52pm UTC](https://forum.kirupa.com/t/preloader-for-two-scene-music-player/80127/1 "2005-02-19T17:52:07Z")

</div>

Hi all,

I’m fairly new to flash. I’ve been teaching it to myself since earlier this past summer. I’m having alot of difficulty adding a preloader to a music player I’ve built for a friends site. I’ve made preloaders before for my own site, you can check out the loader [here](http://www.retrospect.ca/paint.html) if you want, but that was just for a single scene movie and it was a standard movie not a music player.

The first scene of my music player is the preloader. I did this because my play button would not work properly if I put the preloader at the beginning of the movie. Here is the actionscript I’m using for this preloader:

loadedbytes = getBytesLoaded();  
totalbytes = getBytesTotal();  
loadedkbytes = Math.ceil(loadedbytes/1000);  
totalkbytes = Math.ceil(totalbytes/1000);  
if (loadedbytes == totalbytes) {  
nextScene();  
}  
percent = Math.ceil((loadedbytes/totalbytes)\*100  
\_root.loading.gotoAndStop(percent);

I don’t know what I’m doing wrong. I’m about ready to tear out all my hair and curl up into the fetal postition (I was up until 5am last night 'cause I didn’t want this thing to beat me). Is there a tutorial that would explain to me, step by step, how to create a preloader for a multiple scene movie, all the one’s I’ve tried following haven’t worked for me. Or perhaps someone here can point out what I’m doing wrong. Many thanks for any help!
