Results 1 to 5 of 5
  1. #1

    Default Scaleform DOUBLE_CLICK Issue

    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 ;

    Code:
    var xOffset:Number;
    var yOffset:Number;
    then the following functions and EventListners

    Code:
    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);
    }
    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 this

    Code:
    btn_docs.doubleClickEnabled = true;
    btn_email.doubleClickEnabled = true;
    and then wrote the functions in order to achieve this

    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);		
    }
    Again this worked fine in the Scaleform launcher inside Flash. It let me drag the icons and double click to go to the frames.

    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
    Last edited by sidearse92; 07-27-2012 at 05:45 PM.

  2. #2

    Default

    Would just like to add, its AS3 and I have published it via Flash Player 10.2

  3. #3

    Default

    Just another update. Still havn't found a way to fix this.

    I removed the drag feature to see if it was conflicting however it still did the same issue.

    For the time being i have changed the event listeners that are responsible for taking you to the desired frames to be removed when dragging the icons about, and then put back on when you have stopped.
    I also made the DOUBLE_CLICK to be MOUSE_UP.

    So now i can drag them freely without activating the goto frame function, and then just click on them once to goto the frame.
    However if someone could help the double click feature would be a lot better.

    Thanks

  4. #4

    Default

    I am not sure why this is not working in UDK. I will try to test it out on my end, but I cannot promise I will get back to you very soon, as my time is limited. If I do find that this is a bug, I will let the team know about it.

  5. #5

    Default

    Ok thanks a lot for replying


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.