`
json615
  • 浏览: 3151 次
  • 性别: Icon_minigender_1
  • 来自: 成都
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

All I want to do is make flex easy

阅读更多
whatever your application is game or not,your must need to distinguish between click_event and double_click_event .As you kown flex have the double click enable .but that not enough .
  There is a usecase : some data in a datagrid .and now, user click the item in the grid show the itemdetail in another page .You can easy to build the application , but now the user what to do when user click (Single) is still show the detial page,but double click can edit the item. You must be think you can do it easy. like this:
   doubleclikcenable = true doubleclik=editItem() click=showDetailItem() 
   did you realy think it can be right?
No nonsense , I want to sleep now. show the code.

doubleclick = doClick( event ) click = doClick(event)

var isDoubleclick:String;
function doClick( event:MouseEvent):void{
  isDoubleclick = event.type;
   setTimeout( clickHandler , 300 );
}

function clickhandler():void{
   if( isDoubleclick == "click"){
      // Do the click function
   }

   if(isDoubleclick  == "DoubleClick" ){
     // Do the double Click
  }
}

It's for you double Click ... good night
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics