方法一:
function assignHandlers(target:*):void
{
  target["addEventListener"](Event.COMPLETE,eventHandler);
  target["addEventListener"](IOError.IO_ERROR,ioErrorHandler);
  .......
}

function eventHandler(e:event):void
{
.......
}

.......

function ioErrorHandler(e:event):void
{
  .......
}

方法二:
function configureListeners(dispatcher:IEventDispatcher):void 
{
    dispatcher.addEventListener(Event.COMPLETE, eventHandler);
    ....
    dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
 }

function eventHandler(e:event):void
{
.......
}

.......

function ioErrorHandler(e:event):void
{
  .......
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2021-08-01
  • 2021-10-13
猜你喜欢
  • 2021-07-01
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案