1 Reply Latest reply on Sep 23, 2014 4:30 AM by Ned Murphy

    Can't figure out why I'm getting error #1034

    caro_pukenis

      var handsUpChannel:SoundChannel = new SoundChannel();

      var handsUp:Sound = new Sound();

        handsUp.load(new URLRequest("audioFiles/finalAudio/song1.mp3"));

      var watUpChannel:SoundChannel = new SoundChannel();

      var watUp:Sound = new Sound();

        watUp.load(new URLRequest("audioFiles/finalAudio/song2.mp3"));

      var cowboyChannel:SoundChannel = new SoundChannel();

      var cowboy:Sound = new Sound();

        cowboy.load(new URLRequest("audioFiles/finalAudio/song3.mp3"));

      var casualChannel:SoundChannel = new SoundChannel();

      var casual:Sound = new Sound();

        casual.load(new URLRequest("audioFiles/finalAudio/song4.mp3"));

       

        handsUp.addEventListener(MouseEvent.MOUSE_DOWN, handsUpStart);

        watUp.addEventListener(MouseEvent.MOUSE_DOWN, watUpStart);

        cowboy.addEventListener(MouseEvent.MOUSE_DOWN, cowboyStart);

        casual.addEventListener(MouseEvent.MOUSE_DOWN, casualStart);

       

       

      function handsUpStart(event:MouseEvent):void  {

        handsUpChannel = handsUp.play();

       

      }

      function watUpStart(event:MouseEvent):void  {

        watUpChannel = watUp.play();

       

      }

      function cowboyStart(event:MouseEvent):void  {

        cowboyChannel = cowboy.play();

       

      }

      function casualStart(event:MouseEvent):void  {

        casualChannel = casual.play();

       

      }

       

       

      I'm trying to play audio using a MovieClip object. I have multiple other objects with the exact same code, just changing the variables, working perfectly.

       

      All it says is:

       

      TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@1327340d1 to flash.media.Sound.

        at flash.display::Sprite/constructChildren()

        at flash.display::Sprite()

        at flash.display::MovieClip()

        at Unit2_AudioFail_fla::MainTimeline()

       

      help please