September 28, 2009

Forcing the Browser to crash using ActionScript

Filed under: ActionScript, Flex — Anthony @ 11:59 pm

I just discovered this little trick, I'm not sure how useful it is but it works.

Simply create a class that throws an error in the constructor. This will cause the browser to crash and close.

 
 
package
{
   public class BrowserCrasher
   {
      public function BrowserCrasher( )
      {
         throw new Error( 'goodbye browser' );
      }
   }
}
 

Enums and static initializers in AS3

Filed under: ActionScript, OOP — Anthony @ 10:24 pm

I just came across the idea of static initializers in Java and was wondering if they are available in ActionScript as well.

I found a couple posts on the subject.

post 1

post 2