Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

user input string

Avatar of PsychoDazey
PsychoDazey asked on
Apache Flex
6 Comments1 Solution268 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="{Alert.show('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) 
             Alert.show("Unable to browse for files.");
Avatar of vindys80
vindys80Flag of India image

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

This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers