3 Replies Latest reply: Apr 16, 2008 12:39 PM by 807591 RSS

    URL object syntax error - please help!


      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:

       // 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...