var ctr:Number=0;

	for (var i:Number = 1; i<=48; i++) {
	this["puzzle"+i]._alpha = 30;
	this["puzzle"+i+"c"]._x = Math.random()*100;
	this["puzzle"+i+"c"]._y = Math.random()*300;
	
	this["puzzle"+i+"c"].onPress = function(){
	this.startDrag(false);
	
//for (var i:Number = 1; i<=48; i++) {
	
	name = this._name;
	j = name.substring(6);
	asd.text = parseInt(j);
	
this["puzzle"+j+"c"].onRelease = function() {
        this.stopDrag();
	this["puzzle"+j+"c"].stopDrag();
	if (eval(this["puzzle"+j+"c"]._droptarget)== this["puzzle"+j]) {
		this["puzzle"+j+"c"]._visible = false;
		this["puzzle"+j]._alpha = 100;
	
	}//if
	else if (eval(this["puzzle"+j+"c"]._droptarget) != this["puzzle"+j]) {
		this["puzzle"+j+"c"]._alpha = 100; 
		this._x = Math.random()*100;
		this._y = Math.random()*300;
}//elseif
}
//}

instance names :
puzzle1 to puzzle48
puzzle1c to puzzle 48c
hey guys i kinda new here, please help me.

the problem is that the object can't be release and the condition in the if else statement are not even met. why is that?
the array won't work. :(

its quite the same like but its not in a array form
but if i do this my code will be to long!

puzzle1c.onRelease = function() {
	this.stopDrag();
	if (eval(this._droptarget)== puzzle1) {
		puzzle1c._visible = false;
		puzzle1._alpha = 100;
		ctr+=1;
		qwert.text = String(ctr);
	}
	else if (eval(this._droptarget) != puzzle1) {
		puzzle1c._alpha = 100; 
		this._x = Math.random()*800;
			this._y = Math.random()*200;
}
}

hope someone replies :)
thanks guys :)

TheRealOrder commented: Intentionally writing bad and complicated code that does nothing and then asking for help on it to waste time. +0

Recommended Answers

All 2 Replies

And now on ther serious side....

It would be really helpful if you could tell us what your program is supposed to do, what does this specific part of the code needs to do, and what does any of these functions you put in there do, we can't really tell what the problem is if we don't know the purpose of it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.