Click to See Complete Forum and Search --> : URLLoader class - What namespace?


tarsus
03-26-2009, 11:58 AM
I'm fairly new to ActionScript 3. I'm trying to use the URLLoader class, but it's not recognized at compile. What import statement do I need at the beginning of my script in order to have URLLoader available? It appears to be in the flash.net package according to this page:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLLoader.html

But even when I include this line, it doesn't work:
import flash.net;

Admittedly, I still don't have a full understanding of namespaces, packages, etc.

Incidentally, I'm getting really tired of online ActionScript 3 tutorials that give all detailed instructions except how to import the classes used!

tarsus
03-26-2009, 12:08 PM
Well, don't I feel stupid . . .

No import statement necessary! (As I'm sure every single one of you already knew.) Turns out, the URLLoader type won't be recognized in a document you've created as an ActionScript 2 file by mistake . . .