Hi guys,
I have been creating a simple scaleform system which has a few icons, which i can drag about. I wanted the icons to take you to another frame when double clicked.
To do this i added 2 movie clips for the icons inside a movieclip which is the parent. I gave the 2 icons each a instance name, btn_docs and btn_email.
I added the code to a new layer to make the icons drag able
i added the variables in order to drag ;
then the following functions and EventListnersCode:var xOffset:Number; var yOffset:Number;
I then tested with the ScaleForm launcher in Flash and it all worked ok. To add the double click i read that you need to enable the double click , so i added thisCode:btn_docs.addEventListener(MouseEvent.MOUSE_DOWN, btn_docs_onMouseDown); function btn_docs_onMouseDown(event:MouseEvent):void { xOffset = mouseX - btn_docs.x; yOffset = mouseY - btn_docs.y; stage.addEventListener(MouseEvent.MOUSE_MOVE, stage_onMouseMove); stage.addEventListener(MouseEvent.MOUSE_UP, stage_onMouseUp); } function stage_onMouseMove(event:MouseEvent):void { btn_docs.x = mouseX - xOffset; btn_docs.y = mouseY - yOffset; } function stage_onMouseUp(event:MouseEvent):void { stage.removeEventListener(MouseEvent.MOUSE_MOVE, stage_onMouseMove); stage.removeEventListener(MouseEvent.MOUSE_UP, stage_onMouseUp); } btn_email.addEventListener(MouseEvent.MOUSE_DOWN, email_onMouseDown); function email_onMouseDown(event:MouseEvent):void { xOffset = mouseX - btn_email.x; yOffset = mouseY - btn_email.y; stage.addEventListener(MouseEvent.MOUSE_MOVE, email_onMouseMove); stage.addEventListener(MouseEvent.MOUSE_UP, email_onMouseUp); } function email_onMouseMove(event:MouseEvent):void { btn_email.x = mouseX - xOffset; btn_email.y = mouseY - yOffset; } function email_onMouseUp(event:MouseEvent):void { stage.removeEventListener(MouseEvent.MOUSE_MOVE, email_onMouseMove); stage.removeEventListener(MouseEvent.MOUSE_UP, email_onMouseUp); }
and then wrote the functions in order to achieve thisCode:btn_docs.doubleClickEnabled = true; btn_email.doubleClickEnabled = true;
Again this worked fine in the Scaleform launcher inside Flash. It let me drag the icons and double click to go to the frames.Code:btn_docs.addEventListener(MouseEvent.DOUBLE_CLICK, opendocs); btn_email.addEventListener(MouseEvent.DOUBLE_CLICK, openemail); function opendocs(e:MouseEvent):void{ gotoAndPlay(3); } function openemail(e:MouseEvent):void{ gotoAndPlay(6); }
This is where the problem occurs, inside UDK everything works fine until i try to double click the icons and nothing happens. If i keep pressing the icon over and over, around 30 times, the function runs eventually.
I was just wondering if I am missing something, or does UDK have problems running the DOUBLE_CLICK?
Thanks



Reply With Quote


Bookmarks