A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: simple code but error why?

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    17

    simple code but error why?

    I have a simple code:
    myMusic = new Sound(myMusicMc);
    myMusic.loadSound("distortion.mp3");

    There is a button, on the button there is this event:
    on (press) {
    myMusic.play();
    }

    I have created a movieclip myMusicMc
    but when i test it I get the following error:

    Error opening URL "file:///C|/DOCUME%7E1/SADEKA%7E1/LOCALS%7E1/Temp/distortion.mp3"

    why

  2. #2
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Are you positive the song is in the same file as your .fla?

  3. #3
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    I am not sure, either your mp3 is not in the same directory as the swf, that is beeing generated or flash can't resolve the path correctly.
    Try saving the fla to d:\test\myFla.fla or whatever, copy the mp3 there and try again.

    @ostil: In the same Fla??? why's that?
    My letters on the F1 key have faded, how are yours today?

  4. #4
    Senior Member corky§urprise's Avatar
    Join Date
    Jun 2005
    Posts
    346
    The error means it cannot find the file. That url means that i can assume you have not saved the file. Save the file in the same folder, and the problem will go.

  5. #5
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    McUsher,

    First of all its Osteel, Ostil is my brother

    Well it doesnt really matter if you say .fla or swf since both files will be in the same folder. But I suppose I should have said swf instead to avoid confusion

    Sorry

  6. #6
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    Oh sorry, i am mixing you two up all the time

    I normally don't publish in same dir as the fla, but that doesn't matter.
    I just thought (as you said in the same _file_ as the fla) that you were
    thinking of linkage.. i bet you wanted to say _folder_ instead
    My letters on the F1 key have faded, how are yours today?

  7. #7
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    sorry, double post *
    Last edited by Osteel; 12-15-2005 at 02:06 PM.

  8. #8
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Haha ok ok

    *Ahem*

    FOLDER!

    ps , dont worry everyone else mixes us up as well

  9. #9
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    tbh it was a mix-up on purpose, as u mixed up File 'n Folder..
    My letters on the F1 key have faded, how are yours today?

  10. #10
    Registered User
    Join Date
    Nov 2005
    Posts
    17
    Thanks Guys:
    McUsher, Osteel and corkysurprise
    I have saved the sound "distortion.mp3" file in the same directory as soun-tyro.fla. Now I get no "file URL error" however now the sound does not play. Sound card is not on mute and sound volume is on.

  11. #11
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Hey,

    Just noticed something. Try moving the code to your main timeline ...

    code:

    myMusic = new Sound(myMusicMc);
    myMusic.loadSound("distortion.mp3");

    myButton.onRelease = function(){
    myMusic.play();
    }



    Try that

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