1084 expecting rightparen before colon
I am getting this error code and can't figure out why, any help would be appreciated, thanks, here is my code
import fl.events.SliderEvent;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundTransform;
import flash.events.MouseEvent;
import flash.net.URLRequest;
//these variables will store instances of sound related classes
var snd:Sound;
var channel:SoundChannel;
var trans:SoundTransform;
//these variables will be used to keep track of the currently selected song as well as the volume and pan settings
var currSong:String;
var currVol:Number = .5;
var currPan:Number = 0;
//array variable to hold the playlist
var songList:Array = new Array("TapTouch.mp3", "Sparkles On Her Dress.mp3", "Looking Up.mp3", "Shelter.mp3", "Healing Invitation.mp3", "Faster.mp3");
//for loop to populate the song title boxes displayed on the jukebox and remove the mp3 extension
for(var i = 0; i < songList.length; i++)
{
var str:String = songList[i] as String;
str = str.replace(".mp3", "");
var clip = this["song" + (i+1)].title;
clip.text = str;
}
//make the sliders invisible until needed
panSlide.visible = false;
volSlide.visible = false;
//add event listeners for mc buttons to play songs
song1.addEventListener(MouseEvent.CLICK, chooseSong);
song2.addEventListener(MouseEvent.CLICK, chooseSong);
song3.addEventListener(MouseEvent.CLICK, chooseSong);
song4.addEventListener(MouseEvent.CLICK, chooseSong);
song5.addEventListener(MouseEvent.CLICK, chooseSong);
song6.addEventListener(MouseEvent.CLICK, chooseSong);
//create chooseSong function
function chooseSong(e:MouseEvent):void
{
//this switch statement sets the value of the currSong variable to the song associated with the button clicked
switch (e:currentTarget.name)
{
case "song1":currSong = "../MP3s" + songList[0] as String;
break;
case "song2":currSong = "../MP3s" + songList[1] as String;
break;
case "song3":currSong = "../MP3s" + songList[2] as String;
break;
case "song4":currSong = "../MP3s" + songList[3] as String;
break;
case "song5":currSong = "../MP3s" + songList[4] as String;
break;
case "song6":currSong = "../MP3s" + songList[5] as String;
break;
//this if statement checks to see wether the snd variable is currnetl populated by a sound, if it is it will stop the playback of that sound and created a new sound instance for the variable
}
if (snd != null)
{
channel.stop();
}
snd = new Sound();
//load a sound into the new sound class instance, remember that the value of currSong has been set by clicking the song button
snd.load(new URLRequest(currSong));
//create a new SoundChannel instance in the channel variable to play the song
channel = new SoundChannel;
//create a new instance of the SoundTransform class (trans variable) it requires two parameters
trans = new SoundTransform(currVol, currPan);
//play the sound
channel = snd.play();
//associate the sound playing in the channel object with the new soundTransform instance
channel.SoundTransform = trans;
}
|