# LoadVars weird

**URL:** <https://forum.kirupa.com/t/loadvars-weird/117158>\
**Category:** Uncategorized\
**Created:** [July 25, 2004, 12:54am UTC](https://forum.kirupa.com/t/loadvars-weird/117158 "2004-07-25T00:54:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unikrl8](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/unikrl8/32/548_2.png) [@unikrl8](https://forum.kirupa.com/u/unikrl8)\
**Post date:** [July 25, 2004, 12:54am UTC](https://forum.kirupa.com/t/loadvars-weird/117158/1 "2004-07-25T00:54:02Z")

</div>

For some reason I had to do this to steal myvariable from my text file, otherwise it wouldn’t recognize it…

actionscript:

```auto

loadText = new loadVars();
loadText.load("max.txt");
loadText.onLoad = function(success) {
	if (success) {
blarg = loadText.toString();
maxpics = blarg.slice(8,blarg.indexOf("&"));
nextFrame(); 
}
} 

```

text:

```auto
&maxpics=12

```

Is there someway to wait until the variable is correctly loaded or something… :-\ this is really bugging me.

-thanks in advance

also what is success in the if statement? I can’t really find any good sources for the _undocumented actionscript_ like fscommand and sending to PHP. Any links would be uber-helpful :-o

---

<div class="post-metadata">

**Author:** ![McGiver](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@McGiver](https://forum.kirupa.com/u/McGiver)\
**Post date:** [July 25, 2004, 1:09am UTC](https://forum.kirupa.com/t/loadvars-weird/117158/2 "2004-07-25T01:09:21Z")

</div>

the success variable tells you if the loading was successfull or not. its either true or false.

onLoad is called when the loading process finished.

so basically:  
loadText.onLoad = function(success) {  
if (success) {  
/your code here  
}  
}  
already waits till the code is finished if it possible to load it

---

<div class="post-metadata">

**Author:** ![unikrl8](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/unikrl8/32/548_2.png) [@unikrl8](https://forum.kirupa.com/u/unikrl8)\
**Post date:** [July 25, 2004, 8:51pm UTC](https://forum.kirupa.com/t/loadvars-weird/117158/3 "2004-07-25T20:51:42Z")

</div>

coolio thx, sorry for writing way more than I needed too, that’s a bad tendency of mine 🙂
