Welcome aboard.
For starters, there's several errors in the code you're showing that would keep it from even compiling.
First:
That wont work for two reasons. You cannot start a variable with a number, and you cannot include a period.
Next up is your array declares:
ActionScript Code:
var atkritumi1 = new Array(clip1_1, clip1_2, clip1_3, clip1_4, clip1_5, clip 1_6);
You have a space in the middl eof your last variable in both these arrays (clip 1_6, and clip 2_6) , this will also cause an error.
As far as removing it when clicked, you didn't explain what the issue you are having here is... Do they not remove, do they not click at all, etc?...
You can start out by tracing output in those functions to test them. Something to the effect of:
ActionScript Code:
var atkritumi1 = new Array(clip1_1, clip1_2, clip1_3, clip1_4, clip1_5, clip1_6);
for (v_i=0; v_i<atkritumi1.length; v_i++) {
trace("atkritumi1[v_i]: "+atkritumi1[v_i]);
atkritumi1[v_i].onRelease = function() {
trace(this);
removeMovieClip(this);
};
}
Also, just for future reference, because it is infinately easier this way, duplicate, attach, and createMovie all have an output variable. You use that to dynamically make property changes to objects without needing the long-form string evaluation.
I'd also suggest using getNextHighest to set your depths, unless you specifically need them to be at those levels. (1-6) Otherwise you may end up overwriting your old stuff going forward. lastly on that one, I personally like to set a variable to store the scope of dynamically generated clips, just to be sure I'm pathing them correctly.
random is actually depreciated now as well, but it's not going to break anything.
Quote:
random(value:Number) : Number
Deprecated since Flash Player 5. This function was deprecated in favor of Math.random().
|
ActionScript Code:
var clipScope:MovieClip = this;
function dublicet():Void {
var q:Number = random(2)+1;
var targMc:MovieClip = clipScope["clip"+q];
var dNum:Number = targMc._parent.getNextHighestDepth();
var newMc:MovieClip = duplicateMovieClip(targMc, targMc._name+"_"+dNum, dNum);
newMc._x = random(900)+40;
newMc._y = random(500)+35;
}
Hope something here was helpfull... You just need to give us more info on the problem (or show us the fla) to get more specific solutions.