# Agrument cound mismatch. Expected 0, got 1!

**URL:** <https://forum.kirupa.com/t/agrument-cound-mismatch-expected-0-got-1/287866>\
**Category:** flash\
**Created:** [May 7, 2009, 7:42am UTC](https://forum.kirupa.com/t/agrument-cound-mismatch-expected-0-got-1/287866 "2009-05-07T07:42:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThinkKirupa](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@ThinkKirupa](https://forum.kirupa.com/u/ThinkKirupa)\
**Post date:** [May 7, 2009, 7:42am UTC](https://forum.kirupa.com/t/agrument-cound-mismatch-expected-0-got-1/287866/1 "2009-05-07T07:42:07Z")

</div>

[COLOR=“Green”][SIZE=4] **SOLVED - see thread** [/SIZE][/COLOR]

[COLOR=“DarkRed”]ArgumentError: Error #1063: Argument count mismatch on Cars\_fla::MainTimeline/addCar(). Expected 0, got 1.[/COLOR]

I understand that it expects 0. But I don’t understand from where it get’s 1 parameter…?

[SIZE=“2”][COLOR=“RoyalBlue”]Main timeline code[/COLOR][/SIZE]

```auto

import Car;							
import flash.display.MovieClip;
import flash.events.MouseEvent;

add_btn.addEventListener(MouseEvent.CLICK, addCar);

function addCar()
{
	var car1:Car = new Car( 1, 1, mcVolvo)
	addChild(car1);
	car1.x = 200;
	car1.y = 200;
}

```

[COLOR=“RoyalBlue”][SIZE=“2”]_ **Car** _ class code[/SIZE][/COLOR]

```auto

package 
{
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.text.TextField;
    
    public class Car extends MovieClip
    {
        private var _weight:Number;
        private var _topSpeed:Number;
        private var _movieclip:MovieClip;
                
        function Car( weight:Number, topSpeed:Number, movieclipClass:Class )
        {
            _weight = weight;
            _topSpeed = topSpeed;
            _movieclip = MovieClip(new movieclipClass());
            
            this.addChild(_movieclip);
        }
    }
}

```
