Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-06-2009, 04:31 AM   #1
ACKtion
Registered User
 
Join Date: Jul 2009
Posts: 5
Default Incorrect number of arguments, line 23

Hey guys, I am stuck. I keep getting the same error I have been stuck on this for hours.

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;
}
}
}

Last edited by ACKtion; 11-06-2009 at 04:33 AM.
ACKtion is offline   Reply With Quote
Old 11-06-2009, 04:52 AM   #2
RogerClark
Senior Member
 
Join Date: Sep 2009
Location: Melbourne, Australia
Posts: 1,040
Default

It looks like the constructor function for you VolumeSlider class does not take any arguments.

look in VolumeSlider.as and you'll probably see some code reads something like

ActionScript Code:
public function VolumeSlider() {

If it doesn't look like this you're probably not instantiating the class you think your are, i.e. Flash may have made a dummy class for you if VolumeSlider is a symbol in the library which is not correctly linked to your AS file
RogerClark is offline   Reply With Quote
Old 11-06-2009, 05:15 AM   #3
ACKtion
Registered User
 
Join Date: Jul 2009
Posts: 5
Default

Thanks for getting back to me so soon.
I have a volume slider function. here is my volume slier class code.

package com.wide.audio
{
//soundclass
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import gs.*;

public class VolumeSlider
{
public var vol:MovieClip;
public var volDrag:MovieClip;
public var volBar:MovieClip;
public var volBarX:Number;
public var player:Player;

public function VolumeSlider(p:Player, v:MovieClip)
{
player = p;
vol = v;
vol.slider_mc.mask = vol.mask_mc;
volDrag = vol.slider_mc.drag_mc;
volBar = vol.slider_mc.bar_mc;
volBarX = volBar.x;
vol.buttonMode = true;
}

}

}
ACKtion is offline   Reply With Quote
Old 11-06-2009, 09:14 AM   #4
RogerClark
Senior Member
 
Join Date: Sep 2009
Location: Melbourne, Australia
Posts: 1,040
Default

My guess is that you have some pathing or package problem.

Is the class attached to a symbol in the library?
RogerClark is offline   Reply With Quote
Reply


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 03:42 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.