Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox addItem help

Status
Not open for further replies.

ts2032

Technical User
Mar 26, 2002
115
0
0
US
I am trying to populate a listbox control. Sometimes the listbox populates correctly, sometimes it does not. I am thinking it has something to do with the amount of time needed to complete the function, but am unsure.

this is the part of the switch statement.

case "\\A\\:":
myvararray = src.split("~");
myvar1 = myvararray[0];
totalcount++
lstOnline.addItem(myvar1.substr(4),myvararray[1]);
gotoAndPlay(4)
break;

I have placed trace statement to ensure that the function is being called each time, and that the function completes each time it is called. I have also verified that the label and data fields have data in them.

This function is called in the onData event of an xmlSocket object.

any assistance is greatly appreciated
 
there is nothing wrong with the code to add to the listbox so all i can think of ,and given it dont always happen, is that there is something amiss with the switch statement.
 
thanks Bill for your response. I figured out the problem right after I posted. The problem was that as the socket connected it went through multiple frames. Well, somewhere in there I had a keyframe with the listbox in it. In one keyframe it was one listbox, and in the next keyframe it was a different listbox. Both boxes had the same instance name, but were added separately, I guess. So I just deleted the one and put it on a new layer.... anyway all is working.

I did have one other question about sockets across domains. I use the socket as a chat program. It works well with the main room. I am trying to configure a private message type of function. I created a movie clip that does this. To make a long story short, the function works when run from my computer in preview mode...but when I put it on the web, it will not connect outside of the same domain....

any suggestions are appreciated..
 
Found the answer about the across domain issue...

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top