Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flash General Questions > Flash 8 General Questions

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-21-2005, 08:03 AM   #1
escapelab
Registered User
 
Join Date: Oct 2005
Posts: 2
Default FileReference in AS 1?

Does anyone know how to use fileReference with AS1? It says it is available in AS1 in the help section, but gives no example. I am unsure how you would do >

import flash.net.FileReference;

in Actionscript 1.

Thanks.
escapelab is offline   Reply With Quote
Old 10-21-2005, 03:25 PM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

Howdy and Welcome...

I've never heard of such thing in AS 1... I have not installed Flex Builder 2, so I have no access to the documentation... Can you copy and paste the whole thing in the doc so that I can read some more and try to think from then on???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 10-21-2005, 03:37 PM   #3
Xeef
Off-Line
 
Xeef's Avatar
 
Join Date: Aug 2004
Location: Ibiza/Spain language :Hungarian/German/ abit English
Posts: 6,539
Default

for CyanBlue :

Quote:
FileReference (flash.net.FileReference)
Object
|
+-flash.net.FileReference

public class FileReference
extends Object

The FileReference class provides a means to upload and download files between a user's computer and a server. An operating-system dialog box prompts the user to select a file to upload or a location for download. Each FileReference object refers to a single file on the user's hard disk and has properties that contain information about the file's size, type, name, creation date, modification date, and creator type (Macintosh only).

FileReference instances are created in two ways:

When you use the new operator with the FileReference constructor: var myFileReference = new FileReference();
When you call FileReferenceList.browse(), which creates an array of FileReference objects
During an upload operation, all of the properties of a FileReference object are populated by calls to FileReference.browse() or FileReferenceList.browse(). During a download operation, the name property is populated when onSelect has been invoked; all other properties are populated when onComplete has been invoked.

The browse() method opens an operating-system dialog box which prompts the user to select any local file for upload. The FileReference.browse() method lets the user select a single file; the FileReferenceList.browse() method lets the user select multiple files. After a successful call to the browse() method, call the FileReference.upload() method to upload one file at a time. The FileReference.download() method prompts the user for a location to save the file and initiates downloading from a remote URL.

The FileReference and FileReferenceList classes do not let you set the default file location for the dialog box generated by browse() and download() calls. The default location shown in the dialog box is the most recently browsed folder, if that location can be determined, or the desktop. The classes do not allow you to read from or write to the transferred file. They do not allow the SWF file that initiated the upload or download to access the uploaded or downloaded file or the file's location on the user's disk.

The FileReference and FileReferenceList classes also do not provide methods for authentication. With servers that require authentication, you can download files with the Flash Player browser plug-in, but uploading (on all players) and downloading (on the stand-alone or external player) fails. Use FileReference event listeners to ascertain whether operations have successfully completed and to handle errors.

For uploading and downloading operations, a SWF file can access files only within its own domain, including any domains that are specified by a cross-domain policy file. If the SWF that is initiating the upload or download doesn't come from the same domain as the file server, you must put a policy file on the file server.

While calls to the FileReference.browse(), FileReferenceList.browse(), or FileReference.download()methods are executing, SWF file playback pauses on the following platforms: the Flash Player plug-in for Mac OS X, the external Flash Player for Macintosh, and the stand-alone player for Mac OS X 10.1 and earlier. The SWF file continues to run in all players for Windows and in the stand-alone player for Macintosh on Mac OS X 10.2 and later.

Availability: ActionScript 1.0; Flash Player 8
eleminate the import and strict typeing
eg.:
//
import flash.net.FileReference;
var fileRef:FileReference = new FileReference();
-->
fileRef = new flash.net.FileReference()
Xeef is offline   Reply With Quote
Old 10-21-2005, 04:12 PM   #4
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

Thanks, Xeef...

As far as I can tell, 'Availability: ActionScript 1.0; Flash Player 8' is wrong... What do you say, Xeef???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 10-21-2005, 05:25 PM   #5
Xeef
Off-Line
 
Xeef's Avatar
 
Join Date: Aug 2004
Location: Ibiza/Spain language :Hungarian/German/ abit English
Posts: 6,539
Default

not realy tested it but it's seams to work whit AS 1.0


import is AS 2.0
which MM use in there example
Xeef is offline   Reply With Quote
Old 10-22-2005, 02:28 AM   #6
escapelab
Registered User
 
Join Date: Oct 2005
Posts: 2
Default

Thanks Xreef, just tried that and was able to bring up the dialogue box so it seems to be working!
escapelab is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:44 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.