We help IT Professionals succeed at work.

URGENT : The class 'flash.net.FileReference' could not be loaded.

Robinsonx6
Robinsonx6 asked
on
we are using Flash MX PRO 2004 to do a file upload to a PHP page

we are recieving the following error in the activescript

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 27: The class 'flash.net.FileReference' could not be loaded.
     listener.onOpen = function(selectedFile:FileReference):Void {

have we missed something or do we need to import the class into FlashMX project?


This is our code snippet for the actionscript

import flash.net.FileReference;
var listener:Object = new Object();
listener.onSelect = function(selectedFile:FileReference):Void {
statusArea.text += "Attempting to upload " + selectedFile.name + "\n";
selectedFile.upload("http://www.helpexamples.com/flash/file_io/uploadFile.php");
};
Comment
Watch Question

Top Expert 2008
Commented:
Hi,

'flash.net.FileReference'  comes with Flash 8 not with Flash MX pro 2004
You need Flash 8 to compile ur code..

Rgds
Aneesh

Author

Commented:
thanks for the answer