2 Replies Latest reply on Sep 1, 2007 7:01 AM by punstc

    File Reference and XML

    punstc
      Hey everyone, i've been working on an mp3 player that runs off of xml i have it set up so that for each instance of a song it attaches movie clips onto the stage that serves as buttons. I'm trying to add a download button so when you click it it will download the file. I'm trying to do this with the file reference class but i've been working on it for a week with no luck what so ever. if anyone has any ideas it would be so greatly appreciated heres my code and xml.

      there may be some unnecessary code in there i was messing around trying different things.
        • 1. Re: File Reference and XML
          Level 7
          You didn't actually ask a question, or state what your problem is. Pasting
          in 500 lines of code and just saying it doesn't work probably won't get you
          too many replies. Someone can't just paste in and test your code since you
          have remote files and such. What doesn't work? Have you tested your global
          download list to see if it's populated properly? I'm betting it is. I'd
          guess your problem is that FileReference.download expects a fully qualified
          url and you are giving it "test1.mp3".

          --
          Dave -
          Head Developer
          http://www.blurredistinction.com
          Adobe Community Expert
          http://www.adobe.com/communities/experts/


          • 2. Re: File Reference and XML
            punstc Level 1
            Sorry if it wasnt clear. But to be completely truthful i'm not sure what it is thats not working. I'm trying to populate the file reference by the xml. everything works except when i test the movie online when i click the download button the save file opens but it says undefined and clicking save does absolutely nothing.

            So my guess is that my problem lies in my file reference to the button.

            this part

            var url:String = "_global.download ";

            _root["downloadbut"+i].onRelease = function() {
            if(!theFileRef.download(url,_global.songname
            .mp3)) {
            trace("dialog box failed to open.");
            } else {
            trace("dialog box has open.");
            }

            }
            trace(_global.songname )
            }
            }

            i was hoping to know if anyone knew how to properly populate the file reference with xml.

            Sorry. Hope that is more clear.