# Shoutbox: here i am again

**URL:** <https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617>\
**Category:** Uncategorized\
**Created:** [February 2, 2003, 6:12pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617 "2003-02-02T18:12:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fishtank](https://avatars.discourse-cdn.com/v4/letter/f/b3f665/32.png) [@fishtank](https://forum.kirupa.com/u/fishtank)\
**Post date:** [February 2, 2003, 6:12pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/1 "2003-02-02T18:12:14Z")

</div>

well, after hours of work, i realized how it could work (i had the problem of not updating the messages, caused by loading them directly from the text-doc and not from the php-script). I now know how to load the variables from a php-script, but the flash-movie still shows the old messages.

whooo, im wild. :crazy: :q: :bounce:

---

<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 2, 2003, 7:00pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/2 "2003-02-02T19:00:29Z")

</div>

Sounds like a cache problem. Try this to prevent that…

[http://www.kirupa.com/developer/actionscript/tricks/cache.asp](http://www.kirupa.com/developer/actionscript/tricks/cache.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:** [February 2, 2003, 7:10pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/3 "2003-02-02T19:10:48Z")

</div>

so if i want to load variables from a phpscript called view.php, it would have to look like this?

```php

myIdentifier=Math.round(Math.random()*10000);
loadVariablesNum("view.php"+myIdentifier,1,"GET");

```

btw, thanks for that quick answer :love: 😉

[edit] that doesnt work, the script sends “\_level0.text”, what is displayed in the shoutbox.

---

<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 2, 2003, 7:13pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/4 "2003-02-02T19:13:16Z")

</div>

No, you are a tad off, you left off the query string identifier…

```php
myIdentifier=Math.round(Math.random()*10000);
loadVariablesNum("view.php?uniq="+myIdentifier,1,"GET");

```

I added ?uniq= at the end of view.php like it shows in the tutorial.

---

<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 2, 2003, 7:18pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/5 "2003-02-02T19:18:19Z")

</div>

i do not understand that. dont know why i should add

“?unique=”

ive got no variable called unique in my phpscript. im sorry for my beeing so dumb… :chinaman:

---

<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 2, 2003, 7:19pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/6 "2003-02-02T19:19:22Z")

</div>

It is a query string variable. You don’t need it in your PHP script.

It basically just confuses your browser into thinking that the file loading is a completely different file than before because it chooses a random number to tack onto the end of that query string.

This makes your browser cache that file and next time it loads it thinks it is a different file and will not load the cached version, but instead will show the new version.

---

<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 2, 2003, 7:24pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/7 "2003-02-02T19:24:23Z")

</div>

aha… i see

---

<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 2, 2003, 7:33pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/8 "2003-02-02T19:33:20Z")

</div>

🙂 I hope that was the problem. Because if not, I have no clue what else to try.

There are also other ways of preventing cache of files.

Macromedia say:

[http://www.macromedia.com/support/flash/ts/documents/prevent\_caching.htm](http://www.macromedia.com/support/flash/ts/documents/prevent_caching.htm)

---

<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 2, 2003, 8:42pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/9 "2003-02-02T20:42:33Z")

</div>

Lost:

I actually have to disagree about the way used in the trick, when your using Math.Random and Math.Round, there is a 1% possiblity or even more to get the same number again. However, as time always goes forward, i recommend going with this way:

myIdentifier=new Date().getTime()  
myLoadVars = new LoadVars();  
myLoadVars.variablewhatever = “something goes here”;  
myLoadVars.send(“view.php?random=”+myIdentifier, this,“GET”);

---

<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 2, 2003, 9:01pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/10 "2003-02-02T21:01:44Z")

</div>

heres the code of my view.php:

```php

<?php
$filename = "shoutupdate.txt";
$fp = fopen($filename,"r");
$savedtext = fread($fp, 80000); 
fclose($fp);

print "text=$savedtext";
?>

```

in the flashmovie in the first frame i load the variables, a textbox with the variable text displays what the people wrote…

---

<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 2, 2003, 11:25pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/11 "2003-02-02T23:25:23Z")

</div>

> \*Originally posted by h88 \*  
> \*\*Lost:

I actually have to disagree about the way used in the trick, when your using Math.Random and Math.Round, there is a 1% possiblity or even more to get the same number again. \*\*

True for a shoutbox. It wouldn’t be good to get the same number, but for just a standard site I don’t think that would be a problem. Given people would usually clean their temp files before the chance of getting the same number if you ask me.

---

<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 3, 2003, 9:10am UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/12 "2003-02-03T09:10:13Z")

</div>

thanks h88, it works now, but i now use 2 similar scripts, so the movie cant save the variables when they are loaded from a different script then before…

heres the shoutbox, its not ready yet:

[http://195.230.176.35/flashexp/shoutbox/gb/shoutbox0r.swf](http://195.230.176.35/flashexp/shoutbox/gb/shoutbox0r.swf)

thanks guys…

---

<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 3, 2003, 9:13am UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/13 "2003-02-03T09:13:23Z")

</div>

Congrats!

---

<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 3, 2003, 6:54pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/14 "2003-02-03T18:54:53Z")

</div>

the only problem is that i “reload” the swf. now i do not know, if i load the swf with LoadMovie, is that possible?

its something like that:

when the user presses “post”, the swf sends the variables to the php-script. then theres a “GetURL”, which points to the swf itself. could that cause problems?.

---

<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 3, 2003, 6:57pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/15 "2003-02-03T18:57:19Z")

</div>

could you post the FLA so I could take a look at how it is set up?

---

<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 3, 2003, 7:02pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/16 "2003-02-03T19:02:01Z")

</div>

shure…  
but it’s built quite complicated because of my cache problem…  
i tried to solve it by loading the variables from 2 different scripts…

btw, you should actually allow the file extension .rar for attachments… the rar would take 24 kb, the zip takes 38 kb…

and one more thing…

do NOT copy my design… 😉

---

<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 3, 2003, 7:41pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/17 "2003-02-03T19:41:04Z")

</div>

Didn’t you get the open source files from me in the first place? Why would I copy your design? lol 😛 I’ll take a look at it. I’ll let you know what i find.

---

<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 3, 2003, 7:49pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/18 "2003-02-03T19:49:12Z")

</div>

Don’t do the getURL to reload the SWF. That is not necessary. You only need to load the varaibles. Reloading the SWF is the same as pointing it to the first frame. And try using LoadVars instead of loadVariableNum…If you need my file again its here:

[http://www.kirupaforum.com/showthread.php?s=&threadid=12463&highlight=PHP](http://www.kirupaforum.com/showthread.php?s=&threadid=12463&highlight=PHP)

---

<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 3, 2003, 8:42pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/19 "2003-02-03T20:42:24Z")

</div>

well, i used your php-files, modiefied them…  
and anyone can copy my design :beam:

the problem is, when i do not reload the movie, the php script sends the old text, and not the one with the text the user just added…

---

<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 3, 2003, 9:08pm UTC](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617/20 "2003-02-03T21:08:10Z")

</div>

it doesnt work

☹

i now post the whole shoutbox (swf + phpfiles + data file)

plz help me, im almost dead… i cant solve this cache problem…

[Next page](https://forum.kirupa.com/t/shoutbox-here-i-am-again/12617.md?page=2)
