Announcement

Collapse
No announcement yet.

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

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

    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
    Be sure you have set the myWidget.enableInitCallback=true; in your class constructor or preInitialize() method.

    Comment

    Working...
    X