Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-17-2012, 12:29 AM   #1
Registered User
Join Date: May 2012
Posts: 2
Default 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;
case "song2":currSong = "../MP3s" + songList[1] as String;
case "song3":currSong = "../MP3s" + songList[2] as String;
case "song4":currSong = "../MP3s" + songList[3] as String;
case "song5":currSong = "../MP3s" + songList[4] as String;
case "song6":currSong = "../MP3s" + songList[5] as String;
//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)
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;
yzhellnot is offline   Reply With Quote
Old 05-17-2012, 01:26 AM   #2
Registered User
Join Date: May 2012
Posts: 2

Sorry, the error code is
1084 syntax error expecting rightparen before colon
yzhellnot is offline   Reply With Quote
Old 05-17-2012, 08:11 AM   #3
Holosuit User
wvxvw's Avatar
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw

switch (e:currentTarget.name) - this looks bad. Probably it was interpreted as a lable (not sure because I don't know which one takes precedence, the identifier or a keyword) and all the code after that was already gibberish for the compiler.
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 11:49 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.