Results 1 to 13 of 13
  1. #1

    Default WidgetInitialized in Scaleform 4 (AS3)

    UPDATE: As of January 2012 UDK, WidgetInitialized & Event Listeners are back!

    WidgetInitialzied() is not currently working in the Nov 2011 UDK integration of Scaleform 4. It should be in the next release of UDK however, as the fix has been completed but not included in the current release.

    Until then, you can use potential workarounds such as ExternalInterface.call() or FSCommands to notify Unreal that a CLIK widget is on the stage. For example:

    In ActionScript 3:

    Code:
    //parameter 1 = button instance name
    //parameter 2 = button path
    //parameter 3 = button instance name (without quotes)
    
    ExternalInterface.call("WidgetInit", "myAS3Button", "this.myAS3Button", myAS3Button);

    Then in UnrealScript:

    Code:
    var GFxObject MyAS3Button;
    
    function WidgetInit(string WidgetName, string WidgetPath, GFxObject Widget)
    {    
        switch(WidgetName)
        {                 
            case ("myAS3Button"):
    	    MyAS3Button = Widget;
                SetWidgetPathBinding(MyAS3Button, name(WidgetPath));
                break;
            default:
                break;
        }
    }
    
    defaultproperties
    {	
    	WidgetBindings(0)={(WidgetName="myAS3Button",WidgetClass=class'GFxClikWidget')}
    }
    Sorry about that folks.
    Last edited by Matt Doyle; 03-15-2012 at 04:30 PM.

  2. #2

    Default

    any chance of a patch?

  3. #3
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    80

    Default

    Hi, I have an issue here.

    Code:
    function WidgetInit(string WidgetName, string WidgetPath, GFxObject Widget)
    {    
    	switch(WidgetName)
        {                 
            case ("program"):
    		`Log("!!!!!!!! Widget = "$Widget);
    		`Log("!!!!!!!! GFxMyClass(Widget) = "$GFxMyClass(Widget));
        }
    }
    
    defaultproperties
    {
    	WidgetBindings.Add((WidgetName="program",WidgetClass=class'GFxMyClass'))
    
    	...
    }
    Where the widget is a MovieClip and GFxMyClass a GFxObject subclass. Widget returns a GFxObject, but GFxMyClass(Widget) returns none!
    Last edited by Meardon; 12-14-2011 at 05:15 AM.

  4. #4

    Default

    I get WidgetInitialized called.
    But then when I add an event listener for buttonPress on my button, the event doesnt happen when I click the button :/
    Last edited by Hades_; 12-27-2011 at 03:48 PM.

  5. #5

    Default

    Please can we get an update on this issue? AddEventListener is not working on AS3 GFxWidgets in the UDK December 2011 beta.

  6. #6
    Prisoner 849
    Join Date
    Nov 2007
    Location
    0,0,0
    Posts
    913
    Gamer IDs

    Gamertag: BobGneu

    Default

    It doesn't work, but you can go the other route for now, Hook in the event listener on the actionscript side and when it gets executed use the externalinterface.call route to get back to unreal script.
    About Me | My Blog | Solarity

    TechnicalHome | ScaleformTechnicalGuide | UnrealScriptReference | ReplicationHome | MasteringUnrealScriptBaptismByFire

    Kismet makes sense to me when i 'read' it seeming mostly logic based

  7. #7
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Posts
    198
    Gamer IDs

    Gamertag: Omar0O7

    Default

    Didn't the event names change in the December UDK? I believe I read something like that in another topic...
    I can't check it myself atm but all the event names (types) should be found here: [PATHTOUDKFOLDER]/Development/Flash/CLIK/gfx/events/EventTypes.as

  8. #8
    Prisoner 849
    Join Date
    Nov 2007
    Location
    0,0,0
    Posts
    913
    Gamer IDs

    Gamertag: BobGneu

    Default

    That file does not exist any longer. You will find that the ActionScript version is now added into the pathing.

    You may be able to play with the event labels, it has been renamed to buttonPress in AS3.0 land. 2.0 is still standard.

    scaleform.clik.events.ButtonEvent
    Code:
            public static const PRESS:String = "buttonPress";
            public static const CLICK:String = "buttonClick";
            public static const DRAG_OVER:String = "dragOver";
            public static const DRAG_OUT:String = "dragOut";
            public static const RELEASE_OUTSIDE:String = "releaseOutside";
    About Me | My Blog | Solarity

    TechnicalHome | ScaleformTechnicalGuide | UnrealScriptReference | ReplicationHome | MasteringUnrealScriptBaptismByFire

    Kismet makes sense to me when i 'read' it seeming mostly logic based

  9. #9

    Default

    As of January 2012 UDK, WidgetInitialized & Event Listeners are back!

  10. #10
    MSgt. Shooter Person
    Join Date
    Feb 2010
    Posts
    75

    Default

    Quote Originally Posted by Matt Doyle View Post
    UPDATE: As of January 2012 UDK, WidgetInitialized & Event Listeners are back!
    Just pointing out to folks that the CLIK_Components_AS3.fla has been updated too and the components there now have the enableInitCallback in them (like in the example pictures).

    We were using the December version and wondered where the enableInitCallback tickbox inside the components were... But with the latest build we could happily extend the components there and (re)created out component library All callbacks work now in AS3.

  11. #11
    MSgt. Shooter Person
    Join Date
    Aug 2012
    Location
    SI, NY
    Posts
    151
    Gamer IDs

    Gamertag: anointedknight PSN ID: captgrim21

    Default

    Hi guys, thanks for this update it clears up my current brick wall but I've only been able to make a crack in it.

    I'm pretty sure my issue deals with the fact that I'm using the Flash Develop/Vectorian Giotto mix and AS2.
    -I'm not sure if AS3 works with Vectorian Giotto (reason for my AS2 use, I started working on this yesterday so I'm still learning XD)

    Anyways I got the ExternalInterface call to work within my AS2 code for my SWF but when I logged the Widgetname back in UnrealScript it's getting none as it's input, I'm not sure how that is happening since I'm passing the buttonName in the ExternalCall. So here are small clips of the mentioned code XD:

    FlashDevelop AS2 externalcall:
    ExternalInterface.call("WidgetInit", "TestButton", "this.TestButton", _root.TestButton);

    UnrealScript default properties:
    WidgetBindings.Add((WidgetName = "TestButton", WidgetClass = class'GFxCLIKWidget'))

    UnrealScript WidgetInit:
    // Callback automatically called for each object in the movie with enableInitCallback enabled
    function WidgetInit(string WidgetName, string WidgetPath, GFxObject Widget)
    {
    `log("WidgetName: ");
    `log(Widgetname);
    //Determine which widget is being initialized and handleit accordingly

    switch(Widgetname)
    {
    case ("TestButton"):
    `log("BBQ");
    `Log("!!!!!!!! Widget = "$Widget);
    `Log("!!!!!!!! GFxCLIKWidget(Widget) = "$GFxCLIKWidget(Widget));
    //save reference to the button
    // the Widget is a cast to a GFxCLICKWidget to allow for event listeners - see WidgetBindings and ****!!!
    TestButton = GFxCLIKWidget(Widget);
    // Add a delegate for when this button is clicked
    TestButton.AddEventListener('CLIK_press', CloseMovie);
    break;
    default:
    break;
    }

    }



    Update:
    So the script log is returning:

    !!!!!!!! Widget = GFxObject_0
    !!!!!!!! GFxCLIKWidget(Widget) = None


    I'll keep trying but I'm not sure if it's something I'm doing or just the tools im using
    Last edited by NoxRequiem; 09-28-2012 at 02:01 AM. Reason: readability editing, updates still broken =\
    ~NOX~

  12. #12

    Default

    I can't support Vectorian unfortunately, and I don't believe you can use CLIK with Vectorian.

  13. #13
    MSgt. Shooter Person
    Join Date
    Aug 2012
    Location
    SI, NY
    Posts
    151
    Gamer IDs

    Gamertag: anointedknight PSN ID: captgrim21

    Default

    Thanks Matt
    ~NOX~


 

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.