Flex开发总结

2个月的Flex开发,遇到不少问题。包括官方的bug。记录下来

 

1. IDE的问题:经常遇到Flex不编译,eclipse中设置成自动编译,还是不行。解决办法:更改mxml文件,随便找个地方价格空格,保存,只要没语法问题就会编译。

   以前用WebSphere开发的时候,也经常遇到jsp编译问题,解决办法仍然是更改文件,copy到WebSphere的部署目录下,WebSphere就会重新编译jsp文件

 

  如果上面的办法还是行不通,可能是你的配置出问题

  .flexProperties,.actionScriptProperties 看上去正确也不能编译,你需要重建配置Flex Project 属性,是flex builder的bug,官方网站有讨论

 

2. 在TextInput 的KeyDown事件中处理更改text属性问题:

  问题描述:当你需要输入2009-09-09,程序自己添加" - ".

 

 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:Script>
  <![CDATA[
   private function handleKeyDown(event:KeyboardEvent):void
   {
    if(event.keyCode != Keyboard.BACKSPACE && event.keyCode != Keyboard.DELETE)
    {
     if(txt.text.length == 2 || txt.text.length == 5 || txt.text.length == 8){      
      txt.text += "-";          
      txt.setSelection(txt.text.length, txt.text.length);
      txt.validateNow();     
     }
    }
   }
  ]]>
 </mx:Script>
 <mx:TextInput id="txt" keyDown="handleKeyDown(event)" x="221" y="192"/>
</mx:Application>

 

 

https://bugs.adobe.com/jira/browse/SDK-18364

Setting TextInput text attribute in enter handler does not change displayed text

 

If you enter text into a halo TextInput and in your enter handler set the text to something else that text change is lost.

The reason is that user's enter handler which sets the text runs before the change handler. The change handler calls textFieldChanged() which overwrites _text with the value from textField.text so the user's change is lost.

If the user's enter handler calls validateNow() after setting the text, the change sticks because commitProperties is called before the change handler.

 

未完,待续。。。。空了在写

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值