Results 1 to 2 of 2
  1. #1
    MSgt. Shooter Person
    Join Date
    May 2011
    Posts
    65

    Default AS3 - Has anyone succeeded in getting Event Listeners to Work?

    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");
    }

  2. #2

    Default

    Be sure you have set the myWidget.enableInitCallback=true; in your class constructor or preInitialize() method.


 

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.