Functions in duplicate Movieclips

I’m currently doing my project thingy, and encounter some difficulties. Hope there is someone who could help me, or guide me. Thanx!

I will have 5 type of buttons. Each type I will duplicate (+1) at some condition.
Each button is sharing a same functions, just some difference in value and positions.

Button type’s name:bug1, bug5, bug10, bug20, bug50


function dupBug(target:MovieClip, xpos:Number, ypos:Number) {
    i++;
    target.duplicateMovieClip(target+i,i,this.getNextHighestDepth());
    this[target+i]._x = xpos;
    this[target+i]._y = ypos;

    //target.duplicateMovieClip(i,i,{_x:520, _y:380});

}

dupBug(bug1,500,350);
dupBug(bug5,300,350);

This code, I’m trying to have a short list of changes on: MovieClip, x position, y position.
**Q1.**But some how it only reads 1 line of the code, and the position is not right.
**Q2. **I wanted it to +1 every time I do a action, but it would only add up to maximum of 1, and the duplicated button is not functional. Am I doing something wrong here?


**bug1**.onRelease = function() {
	this.stopDrag();
	if ((eval(this._droptarget) == bulb) && (bulbx == "on")) {
		_root.total = _root.total+point1;
		this._x = bulb._x;
		this._y = bulb._y;
		this.count = "yes";
		bulbx = "off";
		dupBug(this);
	} else if ((eval(this._droptarget) == bg_remove) && (this.count == "yes")) {
		_root.total = _root.total-point1;
		this.gotoAndPlay(2);
		dupBug(this);
		this.count = "no";
		bulbx = "on";
	} else if ((eval(this._droptarget) == bg_remove) && (this.count == "no")) {
		this.gotoAndPlay(2);
		dupBug(this);
	} else {
		this.gotoAndPlay(2);
		dupBug(this);
	}
};

The script here basically implement to every buttons that is duplicated.
I’m still trying to make everything into another function so I could share / manage it easily between all 5 buttons.

**Q1. **Currently I’m using the exact Instants Name. So its not very convenient if I have a duplicated button of bug1 . How could I change it accordingly?

Its much more easier if you download my fla and have a look, so you would know what I am trying to achieve here.

Thanx for any help!