-
3DFA hobby scripter
-
A Senior Newbie - How Odd
Originally Posted by LewxX²
Or if someone knows how to open the file-browsing dialog box with a button, that would be great, too!
To open the file browsing dialogue from a button, my understanding is that you just create the button, and on the 'button down' action, run a script that has the following code:
PHP Code:
// Initialise
var ChooseFileTypes = '*mp3;*exe' // Types of files to be selected
WhichFilesSelected = new Array // Array in which the output will go
// Now open the file open dialogue and capture data in array
WhichFilesSelected = Application.fileOpenMultiDialog (ChooseFileTypes)
// Now cycle through the array, and do something with the output
for (a=0; a<=WhichFilesSelected.length ; a++)
{
// Do something with each file 'WhichFileSelected[a]'
}
Your array 'FilesSelected' should contain the names of all files selected.
HOWEVER: This doesn't work on export. If I can get hold of the support e-mail address, I'll send it to them ! Is 4.9.8.7 just a beta test version or am I missing something fundamental?
Cheers,
M.
Edit: This has been reported to support using the 'e-mail support' option from the website, since I figured an attachment was not needed.
Last edited by ForumNewbie; 06-05-2008 at 10:06 AM.
-
3DFA hobby scripter
-
Senior Member
The Application class is internal only, not part of Flash, and is only intended for use with standalone executables. In any case, this class is renamed to Executable in the next release to avoid a name conflict with Flex.
Cheers,
kusco
(3DFA Support Team)
-
A Senior Newbie - How Odd
Thanks Kusco,
That's a shame. Would have been nice functionality. So to do this, I guess it would have to be done with some sort of external script.
All the same, it would be nice if 3DFA told you it wasn't compatible with Flash when compiling, rather than just crashing. Also, I found that this doesn't work in the executable after I compiled it, so I think this will need a bit of testing once the name changes have been completed.
I'll have a think about a PHP script that might work instead.
Morgan.
-
3DFA hobby scripter
Kusco, could you include the flash.net.FileReference in the next release?
to make the following script work?
PHP Code:
//Allow this domain System.security.allowDomain("http://localhost", "127.0.0.1"); import flash.net.FileReference;
// The listener object listens for FileReference events. var listener:Object = new Object();
listener.onSelect = function(selectedFile:FileReference):Void { statusArea.text += "Attempting to upload " + selectedFile.name + "\n"; selectedFile.upload("http://localhost/upload/upload.php"); };
// the file is starting to upload. listener.onOpen = function(selectedFile:FileReference):Void { statusArea.text += "Uploading " + selectedFile.name + "\n"; }; listener.onHTTPError = function(file:FileReference, httpError:Number):Void { imagePane.contentPath = "error"; imagePane.content.errorMSG.text = "HTTPError number: "+httpError +"\nFile: "+ file.name; }
listener.onIOError = function(file:FileReference):Void { imagePane.contentPath = "error"; imagePane.content.errorMSG.text = "IOError: "+ file.name; }
listener.onSecurityError = function(file:FileReference, errorString:String):Void { imagePane.contentPath = "error"; imagePane.content.errorMSG.text = "SecurityError: "+SecurityError+"\nFile: "+ file.name; }
// the file has uploaded listener.onComplete = function(selectedFile:FileReference):Void { statusArea.text += "Upload finished.\nNow downloading " + selectedFile.name + " to player\n"; details.text = "" for(i in selectedFile) details.text +="<b>"+i+":</b> "+selectedFile[i]+"\n" downloadImage(selectedFile.name); };
var imageFile:FileReference = new FileReference(); imageFile.addListener(listener);
to make the follow swf possible:
http://www.flash-db.com/Tutorials/upload/upload.swf
-
Senior Member
wow, too bad this doesn't work on export...
-
3DFA hobby scripter
yeah
-
Senior Member
So, will this ever be available in 3DFA?
-
3DFA hobby scripter
-
3DFA hobby scripter
I got it to work!
Test it & Download source here:
http://flash.lifestylepics.de/upload/
The only thing that doesn't works:
browse([typelist:Array])
I can't set the typelist,
in Adobe flash:
browse([{description: "Image Files", extension: "*.jpg;*.gif;*.png"}]);
works, but in 3DFA it doesn't!
-
3DFA hobby scripter
So I finally created a working multiple file uploader: http://flash.lifestylepics.de/multi_upload/en/
Last edited by LewxX²; 07-29-2008 at 03:09 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|