Results 1 to 2 of 2

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

  1. #1
    dunkspot
    Guest

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •