|
|
|
#1 |
|
Member
Join Date: Mar 2003
Location: Netherland
Posts: 33
|
Split var
Hello,
i am try to make a KoolMoves chat. Now it's almost finish, but only one problem. I have 2 Dynamic text fields, one = txt1.text and two = txt2.text I wanna split one line (from the perl script), the text a user is get from a other user, and who's online (the names). So the perl script (see http://www.screensave.nl/get.pl) when you call it, it will show a line like this; i=text1;text2;text3&p=user1;user2;user3 etc.. But how can i split the line, so that it first split the [ i ] text and value and after that the [ p ] the usernames in a other dynamic text field in just one update.. I use the code below for the text update, and try a lot to change to make it posable to update text and users but till now no success, so i realy hope some one can help me. Thank you Hans update= function (){ _root.loadVariables("http://www.screensave.nl/get.pl", "POST"); records = i.split(';'); for (var b = 0; b < records.length; b++){ txt1.text=txt1.text+records[b]+'\n'; } i = ""; _root.txt1.text.scroll += 18;_level0.dwn = 1; } setInterval( update, 5000, ); update();
__________________
Last edited by hansverst; 11-14-2006 at 06:49 AM. |
|
|
|
|
|
#2 |
|
up to my .as in work
Join Date: Dec 2004
Posts: 4,364
|
Code:
update= function (){
txt1.text="";
var result_lv= new LoadVars();
result_lv.onLoad = function(success) {
if (success) {
myusers = result_lv.p.split(';');
for (var b=0; b < myusers.length; b++){
txt1.text+= myusers[b]+'\n';
}
} else {
//do something else
}};
var send_lv = new LoadVars();
send_lv.sendAndLoad("http://flashnow.servebbs.com/examples/split.txt", result_lv, "POST");
}
setInterval( update, 5000, );
update();
![]() http://flashnow.servebbs.com/examples/hansverst2.html
__________________
KM-CODEX - Resources for Koolmoves Users in-R-tube Free YouTube Search-View-Retrieve Tool made With SWF Studio & Koolmoves 7 Last edited by Chris_Seahorn; 11-14-2006 at 11:46 AM. |
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2003
Location: Netherland
Posts: 33
|
Thank you Chris
Hi Chris tnx for reply,
And i get the idea, and works just fine now! i think it's working better now with 'sendAndLoad' Thank you for your help. Hans
__________________
|
|
|
|
|
|
#4 |
|
up to my .as in work
Join Date: Dec 2004
Posts: 4,364
|
Glad to help
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|