PDA

View Full Version : a popup message


ZBC
11-10-2005, 03:52 AM
I working a a project and need a flash movie that will check a php file for a message being sent to that user. I know how to tell javascript to popup a message from flash but I don't know how I would tell flash to over and over again check that file for a message being sent. This is how it will work, a user will post a message in php to a database.Then flash will find that message and popup the 'message' and flash at the same time will delete the message from the database. It's pretty simple, I just don't know away to do it. Can anyone help??

thephosphorbox
11-11-2005, 03:43 PM
Use an interval to check every x amount of seconds, I would imagine.


function checkForMsg() {
// whatever code you use to load the PHP file
}

msgInterval = setInterval(checkForMsg, 5000);


That will run the message check function every 5 seconds until the interval is cleared with a clearInterval command.

ZBC
11-12-2005, 06:32 PM
Thanks that helps alot!
So I when a message is send and the data recived then I clearInterval to checkformsg() or clearInterval to the variable msgInterval?