Skip to main content
Participant
March 14, 2012
Question

1136 incorrect number of arguments. expected 0

  • March 14, 2012
  • 1 reply
  • 898 views

package  {

 

          import flash.display.MovieClip;

          import flash.utils.Timer;

          import flash.events.Event;

          import flash.net.URLLoader;

          import flash.net.URLRequest;

          import flash.events.*;

          import flash.events.TimerEvent;

 

 

          public class JuteBox extends MovieClip {

 

                    private var tracks:Array;

                    private var i:int=0;          //points to current track

                    private var pollTimer:Timer = new Timer(100);          //updates UI periodically

 

 

 

                    public function JuteBox(url:String="content/playList.xml") {

                              trace( "JuteBox" );

 

                              //load the playList

                              var loader = new URLLoader();

                              loader.load( new URLRequest(url));

                              loader.addEventListener( Event.COMPLETE, onListLoaded );

                              //set up the timer

                              pollTimer.addEventListener(TimerEvent.TIMER, updateUI );

                              pollTimer.start();

 

                              //initizlize the interface

 

                              //buttons

                              play_btn.addEventListener( MouseEvent.CLICK,

                                        function (e) { tracks.play() }

                                        );

 

 

                              //sliders

 

                              //text box

 

                              // constructor code

                    }//con

 

                    private function onListLoaded(e:Event):void {

                              trace( "onListLoaded");

                              var loader = e.target;

                              //populate the array tracks

                              var playList = new XML( loader.data );

                              trace( playList.Song );

                              tracks = [];

                              for each (var song in playList.Song) {

                                        tracks.push( new Track ( song.@src ));

                              }

 

 

                    }//onbListLoaded

 

                    //updates the interface perdically

                    private function updateUI(e:Event=null):void {

 

                    }//updateui

 

                    //advances to next track

                    private function next(e:Event=null):void {

 

 

                    }//next

 

                    //goes to previous track

                    private function prev(e:Event=null):void {

 

 

                    }//prev

 

          }//class

 

}//pack

I'm sure it is something obvious but I can't find it. 

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
March 14, 2012

Is that the entire error message?  Does it point to the red code you highlighted?  What is the Track class... I don't see it getting imported - does it take an argument?

debate789Author
Participant
March 14, 2012

Ya the message reads 1136: Incorrect number of arguments.  Expected 0.

Really stupid question but what do you mean track class getting imported. 

Ned Murphy
Legend
March 14, 2012

For the line you highlighted in red you appear to be creating a new Track object... 

                    tracks.push( new Track ( song.@src ));

which means you should have imported that class if it being used.

Why did you highlight that line?.