iiley's profileAll about iiley and AsWi...PhotosBlogLists Tools Help

Blog


    June 29

    Serveral AsWing new demo are online

    They are JCholorChooser, pallette, and component resizer, they are here:
    June 20

    Real single line TextField??

    You create a TextField with multiline = false, and then publish it, well, you think the textfield just accept single line text, you press Enter, no newline entered, you paste a new line, it is filtered. Seems every thing runs well...
     
    But how about when you press Ctrl+Enter when your swf runs in Internet Explorer? On my machine, new line is entered, the single line textfield became a two line textfield.(Tested on Windows2000+IE6+FP8 plugin)
     
    This is weird and annoying, but here is a solution:
    Add a handler to the onScroller event, when your single line textfield scrolled, means newline is entered, then you can find out the newline code and deleted it from your textfield text, sample code:
     
    yourTextField.onScroller = function(textField:TextField){
     var str:String = textField.text;
        //only check it when Ctrl or Enter pressed
     if(Key.getCode() == Key.CONTROL || Key.getCode() == Key.ENTER){
      for(var i:Number=0; i<str.length; i++){
       if(str.charCodeAt(i) == 13){
        textField.text = str.substring(0, i) + str.substring(i+1);
        return;
       }
      }
     }
    }
     
    Well, maybe adding some thing to prototype to make all TextField avoid this issue is cool, but i'v not fixed it out in a while, welcome to discuss.
    June 06

    JSlider Done

    JSlider component is done today, it's on svn now. It come with most features from swing JSlider except value labes, but we added a new feature to replace it, it is value tip(similar to flex slider component's value tip).
     
    See the demo here: