# 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:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![waffe](https://avatars.discourse-cdn.com/v4/letter/w/c37758/32.png) [@waffe](https://forum.kirupa.com/u/waffe)
#### Post date: [October 30, 2002, 7:11pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/1 "2002-10-30T19:11:34Z")

</div>

I have read over lots of preloader tuts and threads here at Kirupa, nothing seems to fit just write. I am loadind a external asp/txt file into flash and I would like to preload the file 1st before I display the data in Flash. Does the asp/txt file act like an external swf, or whats the deal here ?

---

<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: [October 30, 2002, 7:16pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/2 "2002-10-30T19:16:14Z")

</div>

Hrmm… I know you can preload loaded .swf files and dynamically loaded images and sounds, but I don’t think you can preload .txt files.

Not 100% on that, but as far as I know you can’t.

---

<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: [October 30, 2002, 7:20pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/3 "2002-10-30T19:20:58Z")

</div>

Here is a link of what I’m trying to do, but its a bit complex for me.  
If you have the time take a peak.

[www.smartwebby.com/Flash\_and\_ASP/Flash\_preloader.asp](http://www.smartwebby.com/Flash_and_ASP/Flash_preloader.asp)

---

<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: [October 30, 2002, 7:33pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/4 "2002-10-30T19:33:48Z")

</div>

I think that tutorial is pretty self explanitory, I don’t work with ASP or anything so I can’t test it out or try it or anything.

---

<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: [October 31, 2002, 1:03am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/5 "2002-10-31T01:03:38Z")

</div>

OK When I load my External asp/txt file I put an  
&end=true statement at the end of the file.

Then in flash I need to set up a proper if statement. I need two looping frames, a looping movieclip or a clipevent to check over and over to see if end is true yet. Once END is true, your other variables must all be loaded.

Help how do I do this???

Here is the link of the page I found this info at.

[http://www.actionscript.org/tutorials/beginner/loadVariables\_and\_loadVars/index2.shtml](http://www.actionscript.org/tutorials/beginner/loadVariables_and_loadVars/index2.shtml)

the term is Swonking:smirk:

---

<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: [October 31, 2002, 2:31am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/6 "2002-10-31T02:31:20Z")

</div>

Ermmm…

Frame 1

```auto
if (end == true){
//do this
}

```

Frame 2

```auto
gotoAndPlay(1);

```

I think that is how it would go. This is of course assuming your loop is on frames 1 and 2, edit as neccessary (if it works at 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: [October 31, 2002, 2:37am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/7 "2002-10-31T02:37:22Z")

</div>

Thanks,  
I think you need true in side of " ".

if (end == “true”){

I’ll be back:cool:

---

<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: [October 31, 2002, 2:40am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/8 "2002-10-31T02:40:13Z")

</div>

maybe…lol.

true itself is a statement and can be read in an if statement like that… actually, not that I think of it… I think it would be like this…

```auto
if (end) {
//do this
}

```

Because that says if end is true.

Where is if you are checking for not true, it would be…

```auto
if (!end) {
//do this
}

```

That says if this end is false, do this.

---

<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: [October 31, 2002, 2:44am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/9 "2002-10-31T02:44:34Z")

</div>

So I should change the asp/txt file to end instead of end=true.  
Because the true statement in the asp/txt file is not telling flash its true, flash just sees the text and runs accordingly.

I think

---

<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: [October 31, 2002, 2:50am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/10 "2002-10-31T02:50:07Z")

</div>

No, you should leave it as false…

I am reading this tutorial and I see nothing about anything being true or 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: [October 31, 2002, 7:20pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/11 "2002-10-31T19:20:19Z")

</div>

I E-mailed [actionscript.org](http://actionscript.org) and got them to post a Fla.

Check it out at; [http://www.actionscript.org/tutorials/beginner/loadVariables\_and\_loadVars/index2.shtml](http://www.actionscript.org/tutorials/beginner/loadVariables_and_loadVars/index2.shtml)  
In the paragraph called Swonking.

The fla. he posted are for loadvariables and loadvariablesNum.

Well $#^%!@$, I’m not using either one off those!!!

I load my asp/txt file like;  
file = new LoadVars();  
file.load(“[http://www.asp.txt](http://www.asp.txt)”);

So whats the difference and /or how could I begin to change my code to work with loadvariables or loadvariablesNum?

---

<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: [October 31, 2002, 8:26pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/12 "2002-10-31T20:26:47Z")

</div>

Um, I thought that was the whole point of a downloadable source file.

To see how they used the method.

You are loading a .txt file… they are loading a .txt file… I don’t see any confusion :-\

---

<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: [October 31, 2002, 8:37pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/13 "2002-10-31T20:37:08Z")

</div>

This is where I fall apart.

There are 3 ways to load a txt. file into flash

LoadVars-------------this is my way  
loadvariables------------- tutorial  
loadvariablesNum------- tutorial

I change my code to use loadvariables, but then nothing works because the rest of my code uses the LoadVars.

AAAAAhh:x

---

<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: [October 31, 2002, 10:02pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/14 "2002-10-31T22:02:09Z")

</div>

Well change your loadVars to loadVariables :-\

I am sorry, this really isn’t my area, I worked a little bit with loadVariables, but never 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:50am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/15 "2002-11-01T07:50:42Z")

</div>

why are developers choosing loadVariables over LoadVars, when its obviously LoadVars is more powerful!!

waffe, i can help u using LoadVars, but just tell me, wut do u need exactlly!

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, 8:07am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/16 "2002-11-01T08:07:37Z")

</div>

loadVars can solve yar timing problem, something like:

```php
fileURL = "textfile.txt"

myVars_obj = new LoadVars()
//u could have set of instructions onLoad of the text file like:
myVars_obj.onLoad = function () {
message.text = myVars_obj.message//it will assign message.text to MyVars_obj message
}

//and this will load ur text file

myVars_obj.load(fileURL)

```

this is very simple way

---

<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, 8:10am UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/17 "2002-11-01T08:10:37Z")

</div>

more powerful way is to define success parameter within the function:

```php
fileURL = "textfile.txt"

myVars_obj = new LoadVars()
myVars_obj.onLoad = function (success) {
if (success) {
message.text = myVars_obj.message
} else {
message.text = "Error loading file"
}
}

myVars_obj.load(fileURL)

```

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, 3:47pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/18 "2002-11-01T15:47:40Z")

</div>

My topic is still preloading a asp/txt file into flash.  
I must make sure all asp/txt is loaded before I populate a listbox.  
As you can see I found a tutorial on this topic at [actionscript.org](http://actionscript.org).  
The method of preloading an asp/txt file is called swonking, but it appears you can only do this with loadvariables/loadvariablesNum.

My code uses loadVars and since it is a more powerful way I would like to keep using it. But, is there a way to preload my asp/txt file in flash using 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, 3:51pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/19 "2002-11-01T15:51:25Z")

</div>

I did not see the 2nd page of info you left me h88, let me look it over and I’ll get back to ya.

Thanks

Bill

---

<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, 3:53pm UTC](https://forum.kirupa.com/t/preload-txt-asp/7428/20 "2002-11-01T15:53:38Z")

</div>

ok, but let me tell u, i could only help if it comes to loading txt, am not into asp!

yours,

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