# Preload txt/asp

**URL:** https://forum.kirupa.com/t/preload-txt-asp/7428
**Category:** Uncategorized
**Created:** [October 30, 2002, 7:11pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428 "2002-10-30T19:11:34Z")
**Posts on this page:** 19
**Page:** 2

<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: [November 1, 2002, 4:06pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/21 "2002-11-01T16:06:45Z")

</div>

I use txt to test my work locally, but when I go live it is an asp file.  
All that I have read tells me there is no difference between the two as long as they are formatted the same. So, no worry it’s all good.🙂

---

<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: [November 1, 2002, 4:09pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/22 "2002-11-01T16:09:02Z")

</div>

cool then, i assume its working right now, wish u all the best :)!

yours,

h88

---

<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: [November 1, 2002, 5:11pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/23 "2002-11-01T17:11:33Z")

</div>

Does this actually preload the txt file?  
How do I out put the messages?

---

<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: [November 1, 2002, 5:30pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/24 "2002-11-01T17:30:37Z")

</div>

Well, are you getting anything at all from the ASP script?

---

<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: [November 1, 2002, 5:49pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/25 "2002-11-01T17:49:24Z")

</div>

Yes I am getting data from the asp script. But it is not preloading because I have to hit my reload button which populates the list box. The list box should populate on its own. When the code calls the listbox to populate, the asp file is not loaded yet and does not populate.

---

<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: [November 1, 2002, 6:07pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/26 "2002-11-01T18:07:57Z")

</div>

> \*Originally posted by waffe \*  
> \*\*Does this actually preload the txt file?  
> How do I out put the messages? \*\*

yep, it does, and if u want to output ur message, give the dynamic text field a variable called message and itll work fine

---

<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: [November 1, 2002, 6:21pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/27 "2002-11-01T18:21:58Z")

</div>

> \*Originally posted by waffe \*  
> \*\*Yes I am getting data from the asp script. But it is not preloading because I have to hit my reload button which populates the list box. The list box should populate on its own. When the code calls the listbox to populate, the asp file is not loaded yet and does not populate. \*\*

could i have a look at the code uve done =) !

yours,

---

<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: [November 1, 2002, 6:38pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/28 "2002-11-01T18:38:24Z")

</div>

fileURL = “asp.txt”  
file = new LoadVars()  
file.onLoad = function (success) {  
if (success) {  
message.text = myVars\_obj.message  
} else {  
message.text = “Error loading file”  
}  
}  
file.load(fileURL)  
myArray = new Array(1);  
file.onLoad = loaditems;  
function loaditems() {  
for (i=0; i\<file.NumItems; i++) {  
var ID = eval(“file.ID”+i);  
var Link = eval(“file.Link”+i);  
var Desc = eval(“file.Desc”+i);  
myArray\* = new Array(2);  
myArray\*[0] = ID;  
myArray\*[1] = link;  
myArray\*[2] = Desc;

```
	onChange = function () { screen.loadSound(listbox.getSelectedItem().data["Link"], true);};
	
}

```

}

Then to populat my list box, I have this code in a different layer and frame.

for (i=0; i\<myArray.length; i++) {  
listbox.addItem(“Read “+(i)+””, DataProvider);  
var DataProvider = {ID:myArray\*[0], link:myArray\*[1], Desc:myArray\*[2]};

---

<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: [November 1, 2002, 6:44pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/29 "2002-11-01T18:44:45Z")

</div>

in line no. 5:

message.text = myVars\_obj.message

it should be as refrenced in ur LoadVars Object name:

message.text = file.message

check it out, maybe that was 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: [November 1, 2002, 6:47pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/30 "2002-11-01T18:47:12Z")

</div>

Off topic:

h88 - what does your handle stand for?

just curious…

Rev:elderly:

---

<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: [November 1, 2002, 6:49pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/31 "2002-11-01T18:49:57Z")

</div>

hehe, man, its refered to my first letter of my name and 88 as of my date of birth, sux right :\*(

---

<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: [November 1, 2002, 6:52pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/32 "2002-11-01T18:52:41Z")

</div>

No, not at all…

In SF, there was just a lawsuit to stop Old Navy from selling merch with 88 on it (they said it stood for HH, or Heil Hitler in gang speak)…

Also, it could be interpreted as hates (h+8’s)…

Just curious, asking questions… being an old fart wanting to keep in touch… =)

Rev:elderly:

---

<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: [November 1, 2002, 7:06pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/33 "2002-11-01T19:06:38Z")

</div>

Not doing it, same problem as above.  
Have you looked at the tutorial on [actionscript.org](http://actionscript.org).  
Because there the files are preloading.  
How in your code do the files preload?  
I would like to set up a simple “Loading” sign so I can see that the files are preloading.

🙂

---

<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: [November 1, 2002, 7:08pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/34 "2002-11-01T19:08:25Z")

</div>

btw, ur code had some problem, in line 14, in the " for" statement!

ill look it up now for u.

yours,

---

<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: [November 1, 2002, 7:16pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/35 "2002-11-01T19:16:08Z")

</div>

This is my asp file that flash is reading

&ID0=100&Link0=1045\_4311.mp3&Desc0=wow&

&ID1=101&Link1=1045\_4311.mp3&Desc1=o&

&ID2=102&Link2=soulen.mp3&Desc2=neato&

&ID3=103&Link3=thumpen.mp3&Desc3=great&

&numItems=4&

&EOF=true

numItems tells how many rows there are.

EOF is from [actionscript.org](http://actionscript.org). It works with flash like this

if (EOF == “true”) {  
gotoAndPlay(4);  
} else {  
gotoAndPlay(2);  
}

Thus, the preloader in flash for the asp file.  
But this does not go with loadVars.:-\

---

<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: [November 1, 2002, 7:29pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/36 "2002-11-01T19:29:47Z")

</div>

hi waffe,

i did that example for u, it would show Loading… while the movie is loading, and onload, it will show the txt content, satisfied?=)

yours,

h88

---

<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: [November 1, 2002, 7:52pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/37 "2002-11-01T19:52:56Z")

</div>

I do believe I can work with that. The if statement will turn into  
if (success){  
gotoAndPlay(4);  
} else {  
gotoAndPlay(2);  
}

So it does not populate the list box before its ready…

OOOOO YAAAAAAA:)

You time is well appreciated

Thanks h88

---

<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: [November 1, 2002, 7:56pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/38 "2002-11-01T19:56:40Z")

</div>

okay, i think that wut u need:

```php
stop(); 
message.text = "Loading...";
fileURL = "asp.txt" ; 
file = new LoadVars(); 
file.onLoad = function (success) { 
     if (success) { 
          message.text = urTargetVariableInAsp.txt
		  myArray = new Array();  
          for (i=0; i<this.NUMITEMS; i++) {  
               var ID = eval("this.ID"+i);  
               var Link = eval("this.Link"+i);  
               var Desc = eval("this.Desc"+i);  
               myArray* = [ID, Link, Desc];   
               var DataProvider = {ID:myArray*[0], link:myArray*[1], Desc:myArray*[2]};   
               listbox.addItem("Read "+(i)+"", DataProvider); 
          } 
          listbox.onChange = function () { 
               screen.loadSound(listbox.getSelectedItem().data["Link"], true); 
          } 
     } else { 
          message.text = "Error loading file"; 
     } 
} 
file.load(fileURL) ;

```

wish it helps,

yours,

---

<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: [November 1, 2002, 11:19pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/39 "2002-11-01T23:19:51Z")

</div>

I believe we are done with this thread.

Your code works quite well, I had to change a few things to get it all to mold properly. O, and thanks for fixing up my array, I was getting doubles when I loaded it.

You rule--------h88!!

Kirupa Rocks.😛

[Previous page](https://forum.kirupa.com/t/preload-txt-asp/7428.md?page=1)
