Announcement

Collapse
No announcement yet.

AS3 - CLIK Events

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    AS3 - CLIK Events

    Here is a list of some of the CLIK Events that can be used in AS3 (Scaleform 4):

    UnrealScript Example:

    Code:
    MyCLIKWidget.AddEventListener('CLIK_buttonPress', OnButtonPress);
    Component Events

    CLIK_stateChange
    CLIK_show
    CLIK_hide

    Button Events

    CLIK_buttonPress
    CLIK_buttonClick
    CLIK_dragOver
    CLIK_dragOut
    CLIK_releaseOutside

    Slider Events


    CLIK_valueChange

    List Events

    CLIK_itemClick
    CLIK_itemPress
    CLIK_itemRollOver
    CLIK_itemRollOut
    CLIK_itemDoubleClick
    CLIK_indexChange (or possible: CLIK_clikIndexChange)

    Focus Events


    CLIK_focusIn
    CLIK_focusOut

    Drag Events


    CLIK_drop
    CLIK_dragStart
    CLIK_dragEnd

    #2
    yay! Thanks Matt!

    Comment


      #3
      hi ,how could i get a doubleClick event?
      i tried in uc files.

      button.AddEventListener('CLIK_doubleClick',xxx);
      but i failed.

      i use as2 version to to create my fla.and CLIK_click works fine.

      Comment


        #4
        how exactly do i get this to work? i have my button widgetinitialized in AS3 and it is fine but when I add Eventlisteners as explained by Matt Doyle , I don't get event calls to the event function.

        event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
        {
        local bool bWasHandled;
        bWasHandled = false;

        `log(" WidgetName: " @ WidgetName @ " Path: " @ WidgetPath @ " Widget: " @ Widget);
        switch(WidgetName)
        {
        case ('structbtn'):
        if (StructureBtn == none)
        {
        StructureBtn = GFxClikWidget(Widget);
        StructureBtn.AddEventListener('CLIK_buttonPress', OnStructBtnClicked);
        bWasHandled = true;
        }
        break;
        .................................................. ...........


        function OnStructBtnClicked(GFxClikWidget.EventData ev)
        {
        `log("Struct was clicked");
        }

        Comment


          #5
          How would I send a parameter to the OnButtonPress function?

          Code:
          MyCLIKWidget.AddEventListener("CLIK_buttonPress", function(){ OnButtonPress("parameter") });
          That's how I'd do it in actionscript, but it doesn't work in unrealscript...

          Comment


            #6
            Also, in the event handler:

            Code:
            function OnButtonPress(GFxClikWidget.EventData ev)
            {
                 ev.target.GetFloat("data");
            }
            ev.target is None

            AS3

            Thanks Matt for great tutorials

            Comment


              #7
              You must set the value of data first by calling SetFloat. Ex. SetFloat("data.asset", (i));

              The reason it is accessing none is because the variable has not been initialized.

              Comment


                #8
                Could anyone explain exactly how CLIK_dragStart and CLIK_dragEnd work? What I'm trying to do is create something that will tell me what button we interacted with when we began, and what button we interacted with when we ended, so that I can determine which side of the movie that we are dragging to and from(I am trying to create a barter system). So if you drag from the left side(buttons 0-49) to the right side(buttons 50-100) the function will know that we are selling something, and the inverse would be buying. If we interacted with our own buttons, then it would return, or if we interacted with the trade partners' buttons, then it would return.

                Comment


                  #9
                  Thank you so much! =)

                  Comment


                    #10
                    Matt --

                    Slight issue with one of the entries on the list. It looks like the correct event name for IndexChange is "CLIK_clikIndexChange".

                    See Line 29 in IndexEvent.as:

                    Code:
                            public static const INDEX_CHANGE:String = "clikIndexChange"; //LM: Evaluate.
                    Using the November 2012 UDK Beta, the following code did allow me to attach a index change event listener in UnrealScript:

                    Code:
                    GFxClikWidget(Widget).AddEventListener('CLIK_clikIndexChange', MyMethod);
                    However, the following code did not:

                    Code:
                    GFxClikWidget(Widget).AddEventListener('CLIK_indexChange', MyMethod);

                    Comment


                      #11
                      Originally posted by Melkster View Post
                      Matt --

                      Slight issue with one of the entries on the list. It looks like the correct event name for IndexChange is "CLIK_clikIndexChange".
                      I had to use CLIK_listIndexChange to get it to work (latest UDK Nov 2012).

                      From listevent.as in the same dir as indexevent.as:
                      Code:
                      public static const INDEX_CHANGE:String = "listIndexChange";
                      and:
                      Code:
                      DD_ShadowQuality.AddEventListener('CLIK_listIndexChange', DD_ShadowQuality_Change);

                      Comment


                        #12
                        What about

                        Code:
                        CLIK_click
                        CLIK_rollOver
                        CLIK_rollOut
                        is there no official documentation for this?

                        Comment

                        Working...
                        X