;

PDA

Click to See Complete Forum and Search --> : [F9] FileReference


Pugger
08-02-2006, 01:20 AM
Quick question.

Are you able under AS3 to browse and select a file on a persons computer, say an mp3 file and play it?

Perhaps using the FileReference class?

ty

jason merchant
08-02-2006, 03:08 AM
You can do that in AS2, by simply uploading it to the server and then playing it.

Pugger
08-02-2006, 03:24 AM
I dont want to upload it to a server. I would much prefer if a user can select a song off of there hard disk. The swf will play it from there.

jason merchant
08-02-2006, 03:48 AM
Flash is pretty strict on security, I don't think you will see that anytime soon. However, the end user can't tell the difference if you just upload it an then delete them after a while, only problem would be if you don't have alot of hosting space.

Fall_X
08-02-2006, 04:16 AM
However, the end user can't tell the difference if you just upload it an then delete them after a while, only problem would be if you don't have alot of hosting space.
They will notice if they're on a slow connection. Plus it's not only hosting space, it's also bandwidth, and not only yours but also the user's bandwidth.

Pugger
08-02-2006, 04:27 AM
Flash is pretty strict on security...
Yeah, i was hoping they might of lightened up a little. I'll have a go at home. Maybe I can figure out a way to find out the location of the file.
They will notice if they're on a slow connection. Plus it's not only hosting space, it's also bandwidth, and not only yours but also the user's bandwidth.
Yep thats why I do not want to use that solution.

Fall_X
08-02-2006, 04:35 AM
Well, the only property that might give you any kind of indication is FileReference.name - but I doubt it will give you a full path. Haven't tried it yet though, so let us know how it works out.

Pugger
08-02-2006, 05:37 AM
Yeah from what I read, FileReference.name can only give you the name of the file, and not the file path. But I will try it out, and I'll give you a bell on progress.

tonypa
08-02-2006, 05:54 AM
Quoting the docs:
"The FileReference API does not allow you to read from or write to the transferred file and does 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."

Pugger
08-02-2006, 07:43 AM
I see. Thanks tonypa.

tonypa
08-08-2006, 07:11 AM
Moved to AS3 forum.

DangerAhead
02-27-2007, 03:39 PM
Yeah. it's annoying. AND you'll discover a host of annoyances with the FileReference Class.

If you start using it and run into problems Yahoo Groups has a great Flexcoders forum (AS 3.0) that talks about all the issues with this Class.