3 Replies Latest reply on Jul 27, 2009 1:27 PM by hclselvs

    Typecasting String to Function in AS3

    hclselvs

      Hi,

       

      I would like to typecast a String to Function. The following is the code snippet,

       

       

       

       

       

       

      var

       

       

       

      var funcionVar:Function = functionName as Function;

       

      bt.addEventListener(MouseEvent.CLICK,funcionVar);

       

      public function onSearch(event:MouseEvent) {

      // Code here

       

      }

       

      While converting String to Function, it is returning null value. Is there any possible ways to achieve this?

       

      Thanks,
      Srinivasan S

       

       

       

      functionName:String = "onSearch" ;