3 Replies Latest reply on Apr 16, 2008 5:39 PM by 807591

    URL object syntax error - please help!

    807591
      Hi,

      I am trying to add sound to my applets, i am using the URL object and declared an new object called mysong etc... Java compiler is not letting me assign url vale to my object "mysong" code is below for reference:

      <b>code:</b>
       // Use the absolute URL of the sound file
       URL oursong = new URL;
       oursong = "http://www.servername.net/media/sound.mp3";                                     
                                              
       AudioClip a = getAudioClip(oursong);
      <b>error desc:</b>
      /tmp/4230/spaceinvader.java:186: '(' or '[' expected
                                              URL oursong = new URL;
                                                                   ^
      whats the correct syntax for what im trying to do? - Thank you very much...