views:

15

answers:

1

At the URLLoader reference there is the following example:

       private function completeHandler(event:Event):void {
                var loader:URLLoader = URLLoader(event.target); 
       }

I cannot understand the URLLoader(event.target) syntax. It's not a call to the constructor, it's not a method invocation or a static method invocation. What is it?

+2  A: 

It's a cast. In this example they are simply casting the event.target, which was a URLLoader as such.

sberry2A
Thanks. I had forgotten the actionscript syntax of casting (I was thinking that it's the same with Java)
yanis