# Preload problem

**URL:** <https://forum.kirupa.com/t/preload-problem/101923>\
**Category:** Uncategorized\
**Created:** [February 17, 2004, 11:25pm UTC](https://forum.kirupa.com/t/preload-problem/101923 "2004-02-17T23:25:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_Hed](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@Rob\_Hed](https://forum.kirupa.com/u/Rob_Hed)\
**Post date:** [February 17, 2004, 11:25pm UTC](https://forum.kirupa.com/t/preload-problem/101923/1 "2004-02-17T23:25:10Z")

</div>

I am using some actionscript that loads swf like a photogallery. It works great! But when i add a preloader to the swf file being loaded, it doesn’t appear. However it does work when i link to it directly ([http://www.neteclipse.com/images/3dvid2.swf](http://www.neteclipse.com/images/3dvid2.swf)) I am stumped.

The Site is [www.neteclipse.com](http://www.neteclipse.com) and go to the 3d video section under portfolio. The videos come up but it need the preloader.

P.S. Make sure you have broadband  
any ideas?

---

<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:** [February 18, 2004, 11:19am UTC](https://forum.kirupa.com/t/preload-problem/101923/2 "2004-02-18T11:19:24Z")

</div>

Are you using components? If you are, search the forums for similar problems, it has been explained numerous times.

Otherwise you may need to check your code or post your fla.

---

<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:** [February 18, 2004, 2:53pm UTC](https://forum.kirupa.com/t/preload-problem/101923/3 "2004-02-18T14:53:52Z")

</div>

Check your paths. If you’ve used \_root, that’s where your problem is. When loading an swf into another, \_root will target the main timeline of the host movie for the main movie and everything inside it.

---

<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:** [February 19, 2004, 5:17pm UTC](https://forum.kirupa.com/t/preload-problem/101923/4 "2004-02-19T17:17:59Z")

</div>

I attached my preloader that i got from Kirupa.

As far as the other part of the code this should look familiar Voetsjoeba.

// modified slideshow by Inflicted  
// www.inflicted.nl  
// Not without the help of J.Lott  
// Voetsjoeba and others at kirupa  
// This is not real XML, but what the he\*\*, it works!  
var xmlText = new XML();  
xmlText.tf = textBox;  
xmlText.onData = function(data) {  
this.tf.html = true;  
this.tf.htmlText = data;  
};  
[//xmlText.load](https://xmlText.load)(“text/text\_example.txt”);  
next.onPress = function() {  
if (myPic\<3 && !fadein && !fadeout) {  
// 4 = the amount of pics  
fadeOut = true;  
myPic++;  
input = myPic;  
}  
};  
back.onPress = function() {  
if (myPic\>1 && !fadein && !fadeout) {  
fadeOut = true;  
myPic–;  
input = myPic;  
}  
};  
loadbox.\_alpha = 0;  
myPic = 1;  
// initiate change to new image when buttons are clicked  
this.onEnterFrame = function() {  
// when a new Photo is selected, fade out, load new image, and fade in  
if (loadbox.\_alpha\>10 && fadeout) {  
loadbox.\_alpha -= 100;  
}  
if (loadbox.\_alpha\<10) {  
var xmlText = new XML();  
xmlText.tf = textBox;  
xmlText.onData = function(data) {  
this.tf.html = true;  
this.tf.htmlText = data;  
};  
xmlText.load(“text/web”+mypic+".txt");  
loadMovie(“images/web”+mypic+".swf", “loadbox”);  
fadeOut = false;  
fadeIn = true;  
}  
if (loadbox.\_alpha\<100 && fadein && !fadeout) {  
loadbox.\_alpha += 10;  
} else {  
fadeIn = false;  
}  
};

---

<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:** [February 19, 2004, 10:04pm UTC](https://forum.kirupa.com/t/preload-problem/101923/5 "2004-02-19T22:04:00Z")

</div>

i bet its a path problem

---

<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:** [February 20, 2004, 12:18am UTC](https://forum.kirupa.com/t/preload-problem/101923/6 "2004-02-20T00:18:59Z")

</div>

Are you loading into movieclips or \_x and \_y positions? If you 're loading into clips then use the “this” keyword, ie  
[AS]  
onClipEvent(enterFrame){  
loadedBytes = this.getBytesLoaded();  
totalBytes = this.getBytesTotal();  
}  
[/AS]

---

<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:** [February 20, 2004, 12:51am UTC](https://forum.kirupa.com/t/preload-problem/101923/7 "2004-02-20T00:51:57Z")

</div>

thanks Carixpig. I did that and i took out any \_root I saw and it worked! Excellent…i am very happy that is working.

Thanks to all for your help!

P.S. Did any of you look at the site. It is only partly done but any thoughts on the design? I still have sound, contact page, and the portfolio page is only partly done. The home page is lame also but other than that.

---

<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:** [February 20, 2004, 5:53pm UTC](https://forum.kirupa.com/t/preload-problem/101923/8 "2004-02-20T17:53:42Z")

</div>

There is one little thing left that is not working. The loadText variable (percentage loaded text) is not passing correctly. No idea why. I know it is a path problem but i don’t know how to fix it. Weird.

bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
loadBar.\_width = getPercent_100;  
loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
gotoAndStop(“3dimage”);  
}

any ideas

---

<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:** [February 20, 2004, 10:09pm UTC](https://forum.kirupa.com/t/preload-problem/101923/9 "2004-02-20T22:09:52Z")

</div>

is your loadText object in another MC? if so the path would go -

whateverMCname.loadText = Math.round(getPercent\*100)+"%";

---

<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:** [February 20, 2004, 10:23pm UTC](https://forum.kirupa.com/t/preload-problem/101923/10 "2004-02-20T22:23:00Z")

</div>

No it is not. It is on the root of that movie clip. You can see the file attached a couple threads up. I have modified it since then but you can at least see what is going on if you want.

---

<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:** [February 21, 2004, 3:52am UTC](https://forum.kirupa.com/t/preload-problem/101923/11 "2004-02-21T03:52:08Z")

</div>

Address loadBar and loadText as this.loadBar and this.loadText

---

<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:** [February 23, 2004, 4:18pm UTC](https://forum.kirupa.com/t/preload-problem/101923/12 "2004-02-23T16:18:20Z")

</div>

I tried that before but that didn’t work either. It seems like it should work…very weird.
