A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: [F9] FileReference

  1. #1
    hmm Pugger's Avatar
    Join Date
    Sep 2003
    Location
    Perth, Australia
    Posts
    616

    [F9] FileReference

    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

  2. #2
    Member
    Join Date
    May 2006
    Posts
    70
    You can do that in AS2, by simply uploading it to the server and then playing it.

  3. #3
    hmm Pugger's Avatar
    Join Date
    Sep 2003
    Location
    Perth, Australia
    Posts
    616
    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.

  4. #4
    Member
    Join Date
    May 2006
    Posts
    70
    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.

  5. #5
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    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.

  6. #6
    hmm Pugger's Avatar
    Join Date
    Sep 2003
    Location
    Perth, Australia
    Posts
    616
    Quote Originally Posted by jason merchant
    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.
    Quote Originally Posted by Fall_X
    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.

  7. #7
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    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.

  8. #8
    hmm Pugger's Avatar
    Join Date
    Sep 2003
    Location
    Perth, Australia
    Posts
    616
    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.

  9. #9
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    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."

  10. #10
    hmm Pugger's Avatar
    Join Date
    Sep 2003
    Location
    Perth, Australia
    Posts
    616
    I see. Thanks tonypa.

  11. #11
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Moved to AS3 forum.

  12. #12
    Maya * ActionScript Addict DangerAhead's Avatar
    Join Date
    Jun 2000
    Location
    San Francisco
    Posts
    299

    FileReference not good

    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.
    Geordie Martinez
    www.citizenparanoid.com | email

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center