# Loadmovie - Random variable not working!

**URL:** <https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653>\
**Category:** Uncategorized\
**Created:** [May 16, 2002, 5:55am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653 "2002-05-16T05:55:49Z")\
**Posts on this page:** 10\
**Page:** 1

<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:** [May 16, 2002, 5:55am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/1 "2002-05-16T05:55:49Z")

</div>

The tutorial in The Best of Kirupa isn’t working for me!

When I try doing this:

rn = Math.round(Math.random()\*1000000);  
loadVariablesNum (“flashdata.txt?reload=”+rn,0);

I get a debug error:

Error opening URL “file:///C|/pathtofolder/flashdata.txt?reload=263757”

Where the reload variable is the random number and flashdata.txt is the file that contains the variable I need.

Please help! I hate cache!

---

<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:** [May 16, 2002, 6:37am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/2 "2002-05-16T06:37:11Z")

</div>

I’ll have to think about that. I’ve never had that problem myself… but I usually don’t use that feature until I’m ready to upload the file to an online server…

---

<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:** [May 16, 2002, 6:45am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/3 "2002-05-16T06:45:06Z")

</div>

ok, yes… that makes sense. You cannot use that when doing a test movie from inside Flash. Most of the time I’ll just comment out that loadVariable command with // then place a second loadVariable command just below it without the ?reload feature in it.  
Then when I’m publishing for online usage I’ll delete that line and remove the comment tags from the first one.

---

<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:** [May 17, 2002, 6:18am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/4 "2002-05-17T06:18:58Z")

</div>

WTH are you talking about??? :x 8o  
I don’t understand a word…

---

<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:** [May 17, 2002, 6:30am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/5 "2002-05-17T06:30:44Z")

</div>

There is no cache from the Flash program. You are not using a browser to view any of the files. So, you don’t need that random variable additive when doing tests from inside the Flash program. Only use it in a final production swf when you’re ready to upload that file to the internet.

I don’t think that I can say it more clearly 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:** [May 17, 2002, 6:46am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/6 "2002-05-17T06:46:55Z")

</div>

You mean that that random variable thing works only online???

---

<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:** [May 17, 2002, 7:28am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/7 "2002-05-17T07:28:32Z")

</div>

yup… So just leave it out till your ready to upload.

---

<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:** [May 17, 2002, 8:52am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/8 "2002-05-17T08:52:21Z")

</div>

Hmm… You think it’ll work on localhost?

I have Personal Web Server and I have the Inetpub/wwwroot folder and I have the [http://localhost/](http://localhost/) thing.

---

<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:** [May 17, 2002, 9:28am UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/9 "2002-05-17T09:28:42Z")

</div>

It might. I believe it will work in any situation where you are using a browser to view the swf or the html with the swf embeded in it, even if that’s local. It just doesn’t work in the Flash program test mode… as far as I know. I’ve never tried it that 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:** [May 17, 2002, 5:47pm UTC](https://forum.kirupa.com/t/loadmovie-random-variable-not-working/2653/10 "2002-05-17T17:47:33Z")

</div>

Hey you were right, it works!  
Thanks!
