# Preloader troubles

**URL:** https://forum.kirupa.com/t/preloader-troubles/11523
**Category:** Uncategorized
**Created:** [January 18, 2003, 2:44pm UTC](https://forum.kirupa.com/t/preloader-troubles/11523 "2003-01-18T14:44:53Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![hsadan](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hsadan](https://forum.kirupa.com/u/hsadan)
#### Post date: [January 18, 2003, 2:44pm UTC](https://forum.kirupa.com/t/preloader-troubles/11523/1 "2003-01-18T14:44:53Z")

</div>

I have a preloader that kinda breaks up so that the scene progresses as the loading progresses  
apparently this causes my swf to restart when i load a movie with that preloader into it :-\  
the code goes like this

```auto

onClipEvent (enterFrame) {
	var bytes = _root.getBytesTotal();
	var bytes_loaded = _root.getBytesLoaded();
	if (bytes_loaded >= bytes*20/100) {
		_root.gotoAndPlay(2);
	} else {
		_root.gotoAndStop(1);
	}
}

```

er, i’m not too good at explaining, hope you get the idea.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 6:33am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/2 "2003-01-19T06:33:28Z")

</div>

Your math is off is all.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 7:16am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/3 "2003-01-19T07:16:30Z")

</div>

er could u be more specific as to which part is wrong…=)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 7:20am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/4 "2003-01-19T07:20:40Z")

</div>

the getBytesLoaded and getBytesTotal functions return a number between 0 and 1.  
Now do the math.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 7:37am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/5 "2003-01-19T07:37:01Z")

</div>

er  
yea, that’s **very** helpful  
thx alot  
still can’t get it to work, tho  
thx for the reply

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 7:40am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/6 "2003-01-19T07:40:08Z")

</div>

ok then,  
attach the file in a post and let me see it, I’ll fix it and explain…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 7:43am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/7 "2003-01-19T07:43:34Z")

</div>

…thanks alot:)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 8:17am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/8 "2003-01-19T08:17:00Z")

</div>

ok my friend,

sorry but there are so many fundamental errors in this fla that it is going to take some time to go over this.

I will get back to you if I can…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 9:42am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/9 "2003-01-19T09:42:48Z")

</div>

Thanks so much for your help…  
this was but my first actionscript experimenting :-\

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 12:46pm UTC](https://forum.kirupa.com/t/preloader-troubles/11523/10 "2003-01-19T12:46:42Z")

</div>

hey!

did u check out the tutorials on this site??

it will show u how to do them =)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 12:49pm UTC](https://forum.kirupa.com/t/preloader-troubles/11523/11 "2003-01-19T12:49:34Z")

</div>

yep i sure did…but there isn’t one on breaking up the preloader so that the loading sequence progresses as the loading does … is there? :sigh:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 19, 2003, 6:46pm UTC](https://forum.kirupa.com/t/preloader-troubles/11523/12 "2003-01-19T18:46:03Z")

</div>

I see what you are trying to do here and After I looked at it really you just have a couple of things wrong, I think you are making it more difficult then it really is, I can’t right now but I will post a fla if noone else gives you an answer today

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 20, 2003, 3:39am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/13 "2003-01-20T03:39:28Z")

</div>

not exactly sure by what u mean sorry 😏

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 25, 2003, 3:42am UTC](https://forum.kirupa.com/t/preloader-troubles/11523/14 "2003-01-25T03:42:15Z")

</div>

thanks for your time, but i managed to get it fixed (all i had to do was change \_root to \_parent, figured that \_root would mean taking the main .swf instead of the individual)
