PDA

View Full Version : FileUpload Question


Rabel
05-16-2007, 06:34 PM
This is a question for people who have used/worked on the fileupload.fla file that comes with flash. I am trying to make a remove button for the file. Right now it only has the browse button, any help is really apprieciated.

Thanks
Randy

mcmcom
05-16-2007, 07:26 PM
what exactly do you want to remove, the filename from the upload control or the file from the server?

mcm

Rabel
05-16-2007, 07:35 PM
thanks mcmcom, sorry the filename from the upload control

Rabel
05-16-2007, 08:49 PM
I guess you dont know how to delete the filename from the upload control, so it would be good to know how to use the delete file from the server - could you explain that then.
Thanks

mcmcom
05-16-2007, 08:50 PM
you could just use some code in any button. Something like this could work

on(release){
this.TheUploadControl.TheTextBoxName.Text = "";
}


i dont know the controls name or the textbox but if you use the TARGET button in the Actionscript panel you should get the names.

hth,
mcm

Rabel
05-16-2007, 09:06 PM
"This is a question for people who have used/worked on the fileupload.fla file that comes with flash."

Come on this is why I wanted someone who has worked on the file before - Could someone who has worked with this file please offer some insight.

mcmcom
05-16-2007, 09:25 PM
Ok listen man, this is FREE help, so try to keep the snide remarks to yourself. A quick peek at the .fla shows me two areas where filenames are stored. Just like i said in my original post, there is nothing special or different about them Status Text is a standard text box, imagesCb is a standard combobox. if you need the filename cleared from something else be more specific and leave the attitude at home.

Status Text

//clears the status area text
statusArea.text = "";


display image combo box :

//clears all items from the combobox
imagesCb.items.clear();


hope this helps you,
mcm

Rabel
05-16-2007, 11:03 PM
Listen mcmcom, while I do appreciate the help you are trying to give - the first line in my question is "This is a question for people who have used/worked on the fileupload.fla file that comes with flash." And what FREE help shouldnt be correct or good help - then you dont know how forums work or maybe Ive had it wrong with all the help I have given. And when people see that there are more than one post then they will sometimes not look at the question.

Clearing the status_txt does not do everything to remove it and maybe its as easy as getting this to work

//the onCancel() method is called, and passed a reference to the FileReference object
fileRefListener.onCancel = function (fileRef:FileReference):Void {
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text +="User terminated file upload. \n";
}

but I think it has to do with this area too

fileRefListener.onSelect = function (fileRef:FileReference):Void {
uploadButn.enabled = true;
reDrawPB("progressBar", 738, 340);
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "File is selected to upload \n";
status_txt.vPosition = status_txt.maxVPosition;
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "-------------------------------FILE DETAILS------------------------- \n";
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "File Size: " + fileRef.size + " bytes" + '\n';
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "File Type: " + fileRef.type + '\n';
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "File Name: " + fileRef.name + '\n';
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "Date Created: " + fileRef.creationDate + '\n';
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "Date Modified: " + fileRef.modificationDate + '\n';
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "--------------------------------------------------------------------------- \n";
}
because the preloader will be moved off the screen and I guess uploadButn.enabled = false; - I am not using the combo box for what I am doing so I wont need to do anything with that. I tried this

bt.onPress = function() {
fileRef.cancel()
}

and it doesnt work.

Any Ideas?

Rabel
06-04-2007, 10:06 PM
Nothing?