To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-14-2006, 06:27 AM   #1
hansverst
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.
hansverst is offline   Reply With Quote
Old 11-14-2006, 11:34 AM   #2
Chris_Seahorn
up to my .as in work
 
Chris_Seahorn's Avatar
 
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();
I'm using a flat text file to emulate your cgi return but you get the idea
http://flashnow.servebbs.com/examples/hansverst2.html

Last edited by Chris_Seahorn; 11-14-2006 at 11:46 AM.
Chris_Seahorn is offline   Reply With Quote
Old 11-14-2006, 01:52 PM   #3
hansverst
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
__________________
hansverst is offline   Reply With Quote
Old 11-14-2006, 01:53 PM   #4
Chris_Seahorn
up to my .as in work
 
Chris_Seahorn's Avatar
 
Join Date: Dec 2004
Posts: 4,364
Glad to help
Chris_Seahorn is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:47 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.