all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

shoutbox


shoutbox bertjeb
4/26/2005 12:00:00 AM
flash actionscript: Hello

I've created a little shout box in flash
http://www.creative-web/shoutbox/test.html

the problem is that i want flash to check if some one else has added a
message. So when the content of the xml has changed, flash needs to reload the
content and display it.

any suggestions are welcome!!
Re: shoutbox Sivakanesh
4/26/2005 12:00:00 AM
I recently had this problem too and was scraching my head for a while. I
wanted Flash to load news items from an xml file that will be updated regularly.
But I realised that since XML is state-less, flash doesn't actually get the
xml from the server everytime you visit the site. Instead it uses it from
cache, unless you empty it. So I had to write a .NET webservice to load fresh
data into flash.

Re: shoutbox bertjeb
4/27/2005 12:00:00 AM
i 've used this script (wich i got from Urami):
thisXML.load("messages.xml?"+ new Date().getTime());
So the xml is loaded every time i want to....
But i only want it to be loaded:
- when i've written a message (wich is easy)
- when another user has written a message (wich for me isn't that easy)

Re: shoutbox Sivakanesh
4/27/2005 12:00:00 AM
Yeah I can see that can be a pain, because you don't know what time someone
made a comment.
Have you thought of using the dir command if you are using windows.
You could create a directory listing in a text file. And then merge it
another file (so you can add the 'variable=' text for loading into flash).
In this way you at least have a list of files in a directory. You can run the
dir command using fscommand.

If you want to try this out and need more help let me know.
Re: shoutbox Jan-Paul K.
4/27/2005 12:00:00 AM
Hi,

try writing a serverside script that returns a variable with the last
modification date of the file upon calling.
Now use as loadVariables to call this script every xx-seconds and check if the
value has changed since the last call, if so reload the XML with the
thisXML.load("messages.xml?"+ new Date().getTime()); mehtod mentioned above.

Regards,
Paul
Re: shoutbox bertjeb
4/27/2005 12:00:00 AM
Thanks for the reply's!

Sivakanesh,
since i'don't know if the visitors on the site are using windows, i can't use
your suggestion, but thanks for the idea...

Jan-Paul K.
i'm going to try to write a php script tomorow, the idea of checking the
modification date didn't crossed my mind, but seems very logical :-)

i would have been a lot easier though if flash would have had such a feature...
Re: shoutbox bertjeb
5/4/2005 12:00:00 AM
I 've written the script and retrieve the variable in flash.
Everything is working fine except this little thing:
I've loaded an swf in a scroll pane. In this swf a load the xml and use the
data from the xml. To refresh the data I reload the swf in the scroll pane
using:
// box is the name of the scroll pane
box.refreshPane();
The problem is that sometimes the scoll pane doesn't scroll (on mac it never
scrolls - in internet explorer it depends on the speed of the machine - and in
mozilla most of the time it works) The more messages that are added the more
frequent the problem appears in internet explorer...
My guess it has something to do that the scroll bar checks the heigth of the
content before it's loaded.
Is there anyone who has experienced the same and has a solution for it?

The adress of the shoutbox has changed (I've integrated it already in my site):

http://www.creative-web.be

click on "gastenboek"

thanks for any help!!
AddThis Social Bookmark Button