I am trying to make a web chatting application using flash, asp, and an access database. i made the windows to send and receive messages in flash.
Every 3 seconds it queries the database to see if there are any new messages for your user name. To do this I created a loadvars object, and send out the sting of data, &username=xxxxx to the server. the asp takes that, and checks if there are any new messages. if it finds one, it stores the information in variables. then deletes the record as to not be sent to you again. i am using the asp command object with select and delete statements to do that. when a message is found, it creates a string of text to send back to flash (response.write).
the response contains the sender and recipient of the message, the message, and a value to tell flash that something was found. after the data is loaded (myLoadVar.load) it takes the received info, and if a new message was located, it formats it, and sends it your window..... pretty simple there.....
now here is my question. for testing purposes i placed the IM window on the stage. i hardcoded who the sender and recipients are. i exported two swfs, the second having the sender and recipients names reversed. now i can open these two movies in flash player and have a real time conversation (with myself :) ).......
but when i place these two swf's into web pages, they don't work right. here is whats happening.....
i open two web pages, each opening one of the windows, so i can have a convo. on the first page, i send a message. the second one never receives it. i send something from the second window to the first, it never receives it.
if i check in the database now, i can see that there are two records created, but they are not being sent to the proper windows.
if i refresh the browser windows, they still don't go to the IM windows. if i close each IE window, and reopen each of the webpages, the messages start coming. only now, they come in, and they don't stop!!
i am thinking that the delete statement isn't being ran for some reason. but i think it would have to be, because it comes before the response.write in the ASP file.
i was thinking that maybe after the message is received and written maybe i should overwrite the variables with a blank string, or manually change the value that flash uses to verify if a new message is there. but this is a function, the variables should be destroyed when the function completes.....
but is all seems to work perfectly in flash player, not on web pages...
any ideas? (i know seeing code may be useful, but i am not sure how much of it to send....)