Google


   


You are here: CodeIdol.com > Flash > Flash and XML: A Developer's Guide > Multiplexed > Client With History

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

Client with History

The goal here is to extend the one-line input area and the one-line display of our Flash client so that we can view the past messages we sent and the ones that have come in. These displays will no longer be the same string. We will see messages from other clients, not just our own messages echoed back (Figure 20.1).

Figure 20.1. Text Fields for Display of Input and Output Histories

graphics/20fig01.jpg

ActionScript
function transmit()      {
   textOut+="                                                ";
   textOut= "<msg>"+textOut.slice( 0, 36)+"</msg>";
   socko.send( new XML(textOut) );
   textOut3= textOut2;
   textOut2= textOut1;
   textOut1= textOut0;
   textOut0= textOut;
 textOut="";
 }
function received(msg)   {
 textIn3= textIn2;
 textIn2= textIn1;
 textIn1= textIn0;
 textIn0= textIn;
 textIn = msg.toString();
 }

We created four lines each of input and output history. Rather than any fancy, smooth, onscreen scrolling, we just scroll the data through the variables (Figure 20.2).

Figure 20.2. Input and Output History

graphics/20fig02.jpg

    SAVE
    Digg
    Shown on del.icio.us del.icio.us
    See Whos Talking About This on Technorati Technorati
    I've Reddit reddit

    You are here: CodeIdol.com > Flash > Flash and XML: A Developer's Guide > Multiplexed > Client With History


    ADBRITE ads links
       
    Related tags







    Popular Categories
    Unix books and guides

    AJAX popular information
    C# language guides
    Windows books and cookbooks

    .......








    Business Key Top Sites

    be number one
    rate your site





    © CodeIdol Labs, 2007 - 2009