ACKtion
11-06-2009, 04:31 AM
Hey guys, I am stuck. I keep getting the same error I have been stuck on this for hours. :confused:
here's my error:
1136: Incorrect number of arguments. Expected 0.
here's my code:
the error is supposedly on line 24 which is: volSlider = new VolumeSlider(this, volume_mc);
package com.wide.audio
{
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
public class Player extends MovieClip
{
public var channel:SoundChannel;
public var sound:Sound;
public var progDisplay:ProgressDisplay;
public var volSlider:VolumeSlider;
public function Player()
{
//constructor function
play_mc.buttonMode = true;
pause_mc.buttonMode = true;
pause_mc.visible = false;
progDisplay = new ProgressDisplay(this, prog_mc.drag_mc, prog_mc.bar_mc, time_txt);
volSlider = new VolumeSlider(this, volume_mc);
play_mc.addEventListener(MouseEvent.CLICK, playSong);
pause_mc.addEventListener(MouseEvent.CLICK, pauseSong);
}
public function playSong(event:MouseEvent = null):void
{
/*ranelin_tribe_live_nature_boy.m4a*/
//rocky theme.mp3
var soundFile:String = "this_one_trane.mp3";
if(channel)
{
channel.stop();
}
sound = new Sound();
sound.load(new URLRequest(soundFile));
channel = sound.play(progDisplay.resumeTime);
progDisplay.init();
play_mc.visible = false;
pause_mc.visible = true;
}
public function pauseSong(event:MouseEvent = null):void
{
progDisplay.resumeTime = channel.position;
progDisplay.disable();
channel.stop();
play_mc.visible = true;
pause_mc.visible = false;
}
}
}
here's my error:
1136: Incorrect number of arguments. Expected 0.
here's my code:
the error is supposedly on line 24 which is: volSlider = new VolumeSlider(this, volume_mc);
package com.wide.audio
{
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
public class Player extends MovieClip
{
public var channel:SoundChannel;
public var sound:Sound;
public var progDisplay:ProgressDisplay;
public var volSlider:VolumeSlider;
public function Player()
{
//constructor function
play_mc.buttonMode = true;
pause_mc.buttonMode = true;
pause_mc.visible = false;
progDisplay = new ProgressDisplay(this, prog_mc.drag_mc, prog_mc.bar_mc, time_txt);
volSlider = new VolumeSlider(this, volume_mc);
play_mc.addEventListener(MouseEvent.CLICK, playSong);
pause_mc.addEventListener(MouseEvent.CLICK, pauseSong);
}
public function playSong(event:MouseEvent = null):void
{
/*ranelin_tribe_live_nature_boy.m4a*/
//rocky theme.mp3
var soundFile:String = "this_one_trane.mp3";
if(channel)
{
channel.stop();
}
sound = new Sound();
sound.load(new URLRequest(soundFile));
channel = sound.play(progDisplay.resumeTime);
progDisplay.init();
play_mc.visible = false;
pause_mc.visible = true;
}
public function pauseSong(event:MouseEvent = null):void
{
progDisplay.resumeTime = channel.position;
progDisplay.disable();
channel.stop();
play_mc.visible = true;
pause_mc.visible = false;
}
}
}