# Problem with loading

**URL:** https://forum.kirupa.com/t/problem-with-loading/264529
**Category:** Uncategorized
**Created:** [June 26, 2008, 9:38pm UTC](https://forum.kirupa.com/t/problem-with-loading/264529 "2008-06-26T21:38:33Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Sendoushi](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sendoushi](https://forum.kirupa.com/u/Sendoushi)
#### Post date: [June 26, 2008, 9:38pm UTC](https://forum.kirupa.com/t/problem-with-loading/264529/1 "2008-06-26T21:38:33Z")

</div>

i’ll just past here all the code and explain later the problem i’m having:

this.createEmptyMovieClip(“empresa1”, 1);  
//posiçao e alpha do empresa  
empresa1.\_x= 0;  
empresa1.\_y= 0;  
//loadmovie do empresa  
empresa1.loadMovie(“random/empresa/1.jpg”);  
//preloader  
a = empresa1.getBytesLoaded();  
b = empresa1.getBytesTotal();  
if ( a == b ) {\_parent.gotoAndPlay (2);}  
stop();

this is working on only one frame, no more frames for this code, as you can see with the stop action.  
so there are two things here: one - it would work, two - A would never be equal to B.  
well if i get the if deleted, the animation from the \_parent won’t happen, and with if it will, so, on one time A is equal to B, it works, but still a problem… it does like if empresa1 is empty! it doesnt load the image, the animation is done but image is still loading.  
the idea of doing this was so that the image would softly appear through a mask.  
sorry english, any doubt i’ll give an answer…

please help me

---

<div class="post-metadata">

### Author: ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)
#### Post date: [June 27, 2008, 11:29am UTC](https://forum.kirupa.com/t/problem-with-loading/264529/2 "2008-06-27T11:29:21Z")

</div>

hey. send me a private message in portuguese 🙂

maybe ill be able to help you. thats a really bad english dude 😛

---

<div class="post-metadata">

### Author: ![Sendoushi](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sendoushi](https://forum.kirupa.com/u/Sendoushi)
#### Post date: [June 27, 2008, 2:31pm UTC](https://forum.kirupa.com/t/problem-with-loading/264529/3 "2008-06-27T14:31:15Z")

</div>

yes kind of… just a poor translation from portuguese to english.  
still having the problem, please help i don’t know why is this happening, please tell me what you don’t understand.

---

<div class="post-metadata">

### Author: ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)
#### Post date: [June 27, 2008, 2:42pm UTC](https://forum.kirupa.com/t/problem-with-loading/264529/4 "2008-06-27T14:42:46Z")

</div>

got it.  
dont you think there’s something missing in there to display load progress? something like… hmm… onEnterFrame ?

lol

this.createEmptyMovieClip(“empresa1”, 1);  
//posiçao e alpha do empresa  
empresa1.\_x= 0;  
empresa1.\_y= 0;  
//loadmovie do empresa  
empresa1.loadMovie(“random/empresa/1.jpg”);  
//preloader  
this.onEnterFrame = function(){  
a = empresa1.getBytesLoaded();  
b = empresa1.getBytesTotal();  
if ( a == b ) {  
\_parent.gotoAndPlay (2);  
delete this.onEnterFrame  
}  
}

---

<div class="post-metadata">

### Author: ![Sendoushi](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sendoushi](https://forum.kirupa.com/u/Sendoushi)
#### Post date: [June 27, 2008, 2:54pm UTC](https://forum.kirupa.com/t/problem-with-loading/264529/5 "2008-06-27T14:54:28Z")

</div>

strange… but it works! thanks… do you have msn or something?

---

<div class="post-metadata">

### Author: ![Sendoushi](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sendoushi](https://forum.kirupa.com/u/Sendoushi)
#### Post date: [June 27, 2008, 3:02pm UTC](https://forum.kirupa.com/t/problem-with-loading/264529/6 "2008-06-27T15:02:10Z")

</div>

ok new problem around this one… thanks for the help pantas, stupid error and now a stupid question:  
this.onEnterFrame = function(){  
a = empresa1.getBytesLoaded();  
b = empresa1.getBytesTotal();  
c = Math.ceil((a/b)\*100);  
this.preloader.text = c;  
if ( a == b ) {  
\_parent.gotoAndPlay (2);  
delete this.onEnterFrame  
}  
}  
if ( a == b ) {\_parent.gotoAndPlay (2);}  
stop();

here it is the final code, preloader is supposed to be a dynamic text with the instance preloader. but it isn’t working, do you know why? maybe another stupid error.

---

<div class="post-metadata">

### Author: ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)
#### Post date: [June 27, 2008, 3:19pm UTC](https://forum.kirupa.com/t/problem-with-loading/264529/7 "2008-06-27T15:19:25Z")

</div>

check your private messages. sent you my contact
