Thanks, you helped me to see the way that I need to follow. I use
<font> and the new code is below
Usage :
notificationWindow.addMessage("info", "this is info message");
notificationWindow.addMessage("error", "this is error message");
notificationWindow.addMessage("warn", "this is warn message");

<canvas>
        <debug name="myDebugger" width="400" height="250"/>
        <class name="debuggerWindow">
                <window name="notificationWindow" title="Notification Window"
                        width="250" height="400" resizable="true" clip="true">
                        <vscrollbar />
                        <text name="messageArea" multiline="true"
                                selectable="true" clickable="true"
                                width="${parent.width-30}"/>
                </window>
                <text name="message" />
                <method name="addMessage" args="type, msg"><![CDATA[
                        switch (type) {
                                case "info" :
                                        
notificationWindow.messageArea.addText('<font
color="#0099FF">'+message.text+'</font>');
                                        break;
                                case "error" :
                                        
notificationWindow.messageArea.addText('<font
color="#EE0000">'+message.text+'</font>');
                                        break;
                                case "warn" :
                                        
notificationWindow.messageArea.addText('<font
color="#FFCC00">'+message.text+'</font>');
                                        break;  
                        }
                        message.setAttribute('text',msg);
                ]]>
                </method>       
        </class>
        <simplelayout spacing="10" />
        <debuggerWindow name="notificationWindow"/>
        <edittext name="messageEdittext" width="300" />
        <button text="Send message">
                <text name="message" visible="false"/>
                <handler name="onclick">
                        var isim = "cem";
                        var formatMessage = parent.messageEdittext.text;
                        message.setAttribute('text', formatMessage);
                        message.format("%s : %w \n", formatMessage, isim);
                        parent.notificationWindow.addMessage("info", 
message.text);
                        parent.messageEdittext.clearText();
                </handler>
        </button>
</canvas>

Regards

2010/7/15 P T Withington <[email protected]>:
> The way the debugger does this is to use a single <text> object and use 
> internal HTML to change the colors of the text.  The problem with that is 
> that there is no platform-independent way -- swf and DHTML use different 
> markup.  swf uses <font> and DHTML uses <span>.  In the debugger this 
> difference is handled in the platform-dependent console window code.
>
>

Reply via email to