upload a file

  • [PT]volumes
  • Novice
  • Novice
  • No Avatar
  • Joined: Mar 28, 2005
  • Posts: 28
  • Status: Offline

Post September 27th, 2006, 4:38 am

hi all,

i'm a litle noob at flash, so i just whant to know how i do a thing like this,

Image

i'm trying to make a contact form with attachment with php + flash, the code i know but in flash i dont know i make the box and the 2 buttons do browse the file and put the path of the file in the box... :S

can some one help me please.

Regards.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 27th, 2006, 4:38 am

  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post September 27th, 2006, 8:07 am

True , you'll be using PHP or ASP ... i've seen a tutorial about that 1 ... i just cant remember where ...
ever tried google ?
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post September 27th, 2006, 8:08 am

http://www.flash-db.com/Tutorials/upload/

there ya go
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • [PT]volumes
  • Novice
  • Novice
  • No Avatar
  • Joined: Mar 28, 2005
  • Posts: 28
  • Status: Offline

Post September 27th, 2006, 8:15 am

classified wrote:
http://www.flash-db.com/Tutorials/upload/

there ya go


thanks for your help.

i already find that, and download the source code, but when i try tu put in my form (fla) i have some errors:

Code: [ Select ]
**Error** Scene=Scene 1, layer=code, frame=1:Line 9: The class or interface 'flash.net.FileReference' could not be loaded.
   listener.onSelect = function(selectedFile:FileReference):Void {

**Error** Scene=Scene 1, layer=code, frame=1:Line 19: The class or interface 'flash.net.FileReference' could not be loaded.
   listener.onOpen = function(selectedFile:FileReference):Void {

**Error** Scene=Scene 1, layer=code, frame=1:Line 23: The class or interface 'flash.net.FileReference' could not be loaded.
   listener.onHTTPError = function(file:FileReference, httpError:Number):Void {

**Error** Scene=Scene 1, layer=code, frame=1:Line 28: The class or interface 'flash.net.FileReference' could not be loaded.
   listener.onIOError = function(file:FileReference):Void {

**Error** Scene=Scene 1, layer=code, frame=1:Line 33: The class or interface 'flash.net.FileReference' could not be loaded.
   listener.onSecurityError = function(file:FileReference, errorString:String):Void {

**Error** Scene=Scene 1, layer=code, frame=1:Line 39: The class or interface 'flash.net.FileReference' could not be loaded.
   listener.onComplete = function(selectedFile:FileReference):Void {

**Error** Scene=Scene 1, layer=code, frame=1:Line 49: The class or interface 'flash.net.FileReference' could not be loaded.
   var imageFile:FileReference = new FileReference();

Total ActionScript Errors: 7      Reported Errors: 7
  1. **Error** Scene=Scene 1, layer=code, frame=1:Line 9: The class or interface 'flash.net.FileReference' could not be loaded.
  2.    listener.onSelect = function(selectedFile:FileReference):Void {
  3. **Error** Scene=Scene 1, layer=code, frame=1:Line 19: The class or interface 'flash.net.FileReference' could not be loaded.
  4.    listener.onOpen = function(selectedFile:FileReference):Void {
  5. **Error** Scene=Scene 1, layer=code, frame=1:Line 23: The class or interface 'flash.net.FileReference' could not be loaded.
  6.    listener.onHTTPError = function(file:FileReference, httpError:Number):Void {
  7. **Error** Scene=Scene 1, layer=code, frame=1:Line 28: The class or interface 'flash.net.FileReference' could not be loaded.
  8.    listener.onIOError = function(file:FileReference):Void {
  9. **Error** Scene=Scene 1, layer=code, frame=1:Line 33: The class or interface 'flash.net.FileReference' could not be loaded.
  10.    listener.onSecurityError = function(file:FileReference, errorString:String):Void {
  11. **Error** Scene=Scene 1, layer=code, frame=1:Line 39: The class or interface 'flash.net.FileReference' could not be loaded.
  12.    listener.onComplete = function(selectedFile:FileReference):Void {
  13. **Error** Scene=Scene 1, layer=code, frame=1:Line 49: The class or interface 'flash.net.FileReference' could not be loaded.
  14.    var imageFile:FileReference = new FileReference();
  15. Total ActionScript Errors: 7      Reported Errors: 7


regards.
  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post September 27th, 2006, 8:48 am

i need to download it and test it mySelf ...
but looks like you either missing a class , or the class path is wrong ...
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post September 27th, 2006, 8:54 am

ahhh ... my webserver wont work now , but nothing about classes there Will try it later on my laptop ...

Quote:
QUICK INSTALL

You need to have a Webserver with PHP support running

1. create a directory under your server web root and unzip files there
2. publish the swf there
3. create a "files" folder under your previous folder with write permissons (the PHP script attemps to create if it doesn't exists, but should have write permissons over the folder)
4. Check your example trough a browser (not from inside Flash) and webserver (i.e http://localhost/upload/upload.html)

Post your questions on http://www.flash-db.com/Board/


try the above ...
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • [PT]volumes
  • Novice
  • Novice
  • No Avatar
  • Joined: Mar 28, 2005
  • Posts: 28
  • Status: Offline

Post September 27th, 2006, 9:06 am

u didnt understand what i said.

I try to put the browse button of the example you show and the code in my swf file, and i have that errors that i show u.

the example works fine.
  • [PT]volumes
  • Novice
  • Novice
  • No Avatar
  • Joined: Mar 28, 2005
  • Posts: 28
  • Status: Offline

Post September 27th, 2006, 9:38 am

something is wrong here, try like this:


import flash.net.FileReference;
var fileUpload:FileReference = new FileReference();

only this 2 lines, and appears this error


**Error** Scene=Scene 1, layer=code, frame=1:Line 5: The class or interface 'flash.net.FileReference' could not be loaded.
var fileUpload:FileReference = new FileReference();

Total ActionScript Errors: 1 Reported Errors: 1


why the script dont call the function ?
  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post September 27th, 2006, 1:51 pm

What Version of flash are you running ?
and did you copy all of the codes & paste em into yer project ?
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • beebers22
  • Born
  • Born
  • No Avatar
  • Joined: Sep 09, 2008
  • Posts: 1
  • Status: Offline

Post September 9th, 2008, 1:09 pm

Be sure you are publishing your .swf file as a Flash 8.

I had the same problem and that is what I was doing wrong.

very simple, I hope it helps.

Regards.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6128
  • Loc: Seattle, WA
  • Status: Offline

Post September 9th, 2008, 9:30 pm

Quote:
Wed Sep 27, 2006 4:51 pm
The Beer Monocle. Classy.

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 50 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.