troubleshooting Question

user input string

Avatar of PsychoDazey
PsychoDazey asked on
Apache Flex
6 Comments2 Solutions268 ViewsLast Modified:
I have an application that allows the user to upload fies to the server and store the path in a database so they can be associated with a certain record; this part works fine.  Now I want the user to be able to add a short description.  I am planning to use a popup (or similar control) to display when the user clicks the file upload button.  The user will then enter a description of 300 characters or less and the application will then pass that string to the function that uploads the file, so it can be added to an array.

Can someone give me an example of how to do this?  My current code is below.
//button that calls upload function
<mx:HBox width="100%" height="10%" horizontalAlign="center" >
					<mx:Button label="Add Attachment" click="Program.upload();"/>
					<mx:Button label="Remove" click="{'Other code here')}"/>

public static function upload():void 
         // listen for the file selected event
         // listen for the upload complete event
         fileRef.addEventListener(Event.SELECT, selectHandler);
         fileRef.addEventListener(Event.COMPLETE, completeHandler);
         fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA   , uploadCompleteHandler);
         fileRef.addEventListener(IOErrorEvent.IO_ERROR, onIOError)

         // browse for the file to upload
         // when user selects a file the select handler is called
             var success:Boolean = fileRef.browse();
         catch (error:Error) 
   "Unable to browse for files.");

Open in new window


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros