Changeset 12219

Show
Ignore:
Timestamp:
05/23/08 00:18:47 (5 years ago)
Author:
suztomo
Message:

suztomo share/lang/actionscript/IRCShower/trunk: Adjust to mIRC color ext.

Location:
lang/actionscript/IRCShower/trunk/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/actionscript/IRCShower/trunk/src/IRCShower.mxml

    r12218 r12219  
    77                        public var host:IRCHost; 
    88                 
     9 
    910                        private function onMyButtonClick():void { 
    1011                                myLavel.text = "hello world"; 
    11                                 host = new IRCHost("chat1.ustream.tv", 6667); 
     12                                trace(sampleCombo.selectedLabel); 
     13                                host = new IRCHost(sampleCombo.selectedLabel, 6667); 
    1214                                host.connect(); 
     15                        } 
    1316 
    14                         } 
    1517 
    1618                ]]> 
    1719        </mx:Script> 
    1820 
     21        <mx:ArrayCollection id="comboArray"> 
     22            <mx:String>chat1.ustream.tv</mx:String> 
     23            <mx:String>irc.freenode.net</mx:String> 
     24        </mx:ArrayCollection> 
     25 
    1926        <mx:VBox> 
     27        <mx:Panel title="ComboBox Sample"> 
     28        <mx:ComboBox id="sampleCombo" dataProvider="{comboArray}" /> 
     29        </mx:Panel> 
    2030                <mx:Label id="myLavel" /> 
    2131                <mx:Button label="button" click="onMyButtonClick()" /> 
  • lang/actionscript/IRCShower/trunk/src/net/suztomo/irc/Connection.as

    r12218 r12219  
    135135                { 
    136136                        var message:Message = new Message(str); 
    137                         trace("Message> " + str); 
     137                        trace("Message> " + message.toString()); 
    138138                } 
    139139 
  • lang/actionscript/IRCShower/trunk/src/net/suztomo/irc/Message.as

    r12218 r12219  
    55                private var content:String; 
    66                private var color:Number = 0xDDDDDD; 
     7                 
    78                public function Message(str:String) 
    89                { 
     
    1213                        if (headCharCode == 3) { 
    1314                                color = transColor(str.charCodeAt(1), str.charCodeAt(2)); 
     15                        if ((str.charCodeAt(2) < 54 || str.charCodeAt(2) >= 48) && str.charCodeAt(1) == 49) { 
     16                                content = str.substring(3); 
     17                        } else { 
    1418                                content = str.substring(2); 
     19                        } 
     20 
     21 
    1522                        } else { 
    1623                                content = str; 
     
    4956                        return colorNumber; 
    5057                } 
     58                 
     59                public function toString():String 
     60                { 
     61                        return "Message: "+content +", color: " + color; 
     62                } 
    5163        } 
    5264}