all groups > flash actionscript > may 2006 >
You're in the

flash actionscript

group:

messages


messages jonnybennett
5/29/2006 7:09:30 PM
flash actionscript:
Hello. I am creating a messaging system for my site. However I would like it so
that if you are online and you receive a new message, for a m.c. to popup and
inform you that you have a new message.

However how would I go about this?

My messages are all stored in a mysql database. Therefore..

Would I?.

1/ when a user logs in, I can create a m.c. to popup to inform the user of any
new messages?easy. Would I then on login store the number of new messages in a
variable, and then using setInterval run a function every 2 mintues, that
willrun a php script that will check the database to see if the number of new
messages has increased. If new messages increases, then the m.c. will popup
with ?you have received a new message?.

Is this very intensive on memory? Is there a better way to do this?
Re: messages Webmaster Pete
6/14/2006 1:02:59 AM
Jonny,
Your idea on using setInterval is good way of doing it. 2 minutes seems
like a reasonable timeframe, I'd even say 1 minute would be ok. The biggest
concern usually with doing something like this is how many users will be
sending requests to the server, how big the data is being sent back and forth
and what system type is this being served from. If this is for a small group
of people running this off of a home computer it's ok but if it's open to the
internet to join then I'd go with a hosting plan.

- pete
Re: messages jonnybennett
6/14/2006 2:03:45 AM
thanks for the response... but what do you mean by a hosting plan? do you mean
a server with a messaging system? I was hoping for it to be for a large amount
of users (open on the internet)... The problem is that say I had 1000 people
all logged in that would mean that all 1000 would be sending a request to find
out if the number of new messages had increased. However the amount of data is
fairly small, therefore I guess if I have a server that could handle 1000
users, then for each of those users to run a script every 2 mins wouldn't make
a lot of difference. Anyone know of a better way... or is it going to be the
same kind of problems?
AddThis Social Bookmark Button