If you attempt to actually return a value in a void method, the compiler generates an error. : Return : Function Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Function » Return »

 

If you attempt to actually return a value in a void method, the compiler generates an error.


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){


    }
    private function sampleMethod (  ):void {
      return "some value";  // This causes the compiler to generate an error.
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Function
» Return