Hard to respond without seeing the code (a link or a paste of the text would be good). But I suspect the code presumes event handlers that are not implemented in the snippet you are using. fileRef needs at least one event handler to handle what the user does when he selects an item for upload, and lots of other stuff.

You need some code that looks like this:

        p_fileReference.addEventListener(Event.CANCEL, onCancel);
        p_fileReference.addEventListener(Event.COMPLETE, onComplete);
        p_fileReference.addEventListener( IOErrorEvent.IO_ERROR, onIOError);
        p_fileReference.addEventListener(Event.OPEN, onOpen);
        p_fileReference.addEventListener(ProgressEvent.PROGRESS, onProgress);
//        p_fileReference.addEventListener( SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
        p_fileReference.addEventListener(Event.SELECT, onSelect);

This code should be called when you instantiate the fileRefrence.

the "on" parameters above are references to functions that handle events. Their declarations look something like this:

    public function onSelect(p_event:Event) :void {
    public function onCancel(p_event:Event) :void {
    public function onOpen(p_event:Event) :void {
    public function onComplete (p_event:Event) :void {
    public function onProgress (p_event:ProgressEvent):void{
    public function onIOError(p_event:IOErrorEvent) :void {

Hope this helps.

Regards
Hank


On 7/6/06, Clint Tredway <[EMAIL PROTECTED]> wrote:
code from the docs. I am just trying to get a file upload working so I can make sure I understand it correctly.


On 7/5/06, Carson Hager < [EMAIL PROTECTED]> wrote:

What code are you referring to?
 
 
 
Carson

____________________________________________
 
Carson Hager
Cynergy Systems, Inc.
http://www.cynergysystems.com
 
Email:  [EMAIL PROTECTED]
Office:  866-CYNERGY
Mobile: 1.703.489.6466

 


From: [email protected] [mailto:[email protected]] On Behalf Of Clint Tredway
Sent: Tuesday, July 04, 2006 11:32 PM
To: [email protected]
Subject: [flexcoders] file uploads

I am using the code from the docs and Flex Builder is telling this 1120: Access of undefined property fileRef.   and that the selectHandler and completeHandler are undefined properties as well. I am declaring the var fileRef, so i dont get why its doing this... very frustrating...


--
diabetic? http://www.diabetesforums.com
Bill Cosby - A word to the wise ain't necessary - it's the stupid ones that need the advice.




--
diabetic? http://www.diabetesforums.com
Bill Cosby - A word to the wise ain't necessary - it's the stupid ones that need the advice.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to