A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: loading MP3 from url

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    3

    loading MP3 from url

    Sound Tutorial on Flashkit,com
    i made a Sound/MP3 player with help from the tutorial above. it all works fine from my hard drive. but as soon as i try putting a URL in the loadSound method it doesnt work anymore.

    if i type loadSound("example.mp3", false); it works fine
    if i type loadSound("http://blah/example.mp3", false); it doesnt work

    if i upload 'loadSound("example.mp3", false);' to the place where example.mp3 is located, it doesnt work either.

    help..?? what am i missing? what do i do wrong?

    ps. im pretty much a n00b, i dont really know what im doing :P

  2. #2
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Two possibilities:
    1. The URL is wrong.
    2. The URL is in a different domain to the Flash movie.
    The first you can check and correct yourself,
    the second is a built in security feature of Flash and is to be considered a good thing.

  3. #3
    Junior Member
    Join Date
    Oct 2003
    Posts
    3
    1. the URL is correct, i copied & pasted it directly from the adress bar in explorer so.. that cant go wrong

    2. the .swf is either in the same directory of the same 'domain' as the MP3 is, or on my hardrive.. so i dont think its that either.

    anything else..?

  4. #4
    Member
    Join Date
    Jan 2004
    Location
    USA
    Posts
    42

    lol

    Make sure\try the following:

    Try using \ (Backslash) instead of forward slash [Flash sometimes wants one over the other, but i thought it was / forward slashes ]

    Instead of "Mysound.mp3" try "/Mysound.mp3"

    Make sure it is cleary known as a string to flash (Make sure not to just type Mysound.mp3 type with qoutes-"Mysound.mp3")

    Make sure you are loading it correctly. Heres an example:

    MS = new Sound()
    MS.loadsound("MySound.mp3")
    MS.start()


    Now it looks like the above you have done right, to flash the Server should appear the same as your harddrive (atleast when loading files are concerened) Could you post a copy of your file? And the name of you server? (I dont want your password or username and crap, just whats the homepage of the server your tryin this on?)
    I will own you, with ease, have a nice day.

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