Hi,
I am making a simple dressup game but I guess due to the large amount of movieclips (something like 60 movieclips including the accessories) its gotten buggy. Things don’t stop dragging and ‘stick’ to the mouse sometimes.
Also I would like to make it so that the clothing you click on becomes on top of all other clothing. But unfortunately when I tried to add some code for making it the top depth it seemed even more buggy and didn’t always work.
Here is the code I’m using. I’d be very grateful for any help.
///// Main Frame
for(var i=1; i<=51 ;i++){
// get reference to each piece of clothing
var clothing = this["clothes"+i];
// scale down clothes to thumbnails
var scale = 40;
clothing._xscale = scale;
clothing._yscale= scale;
}
_global.myRoot = this;
stop();
//////// On Each Movieclip
onClipEvent (load)
{
// Make a note of original position
_global.clothes50xPos = this._x;
_global.clothes50yPos = this._y;
}
on(press){
// Start dragging and scale up to full size
this.startDrag();
this._xscale=100;
this._yscale=100;
}
on(release){
// stop dragging
this.stopDrag();
// if the clothing is not over the character area
if(_global.myRoot._xmouse >=280){
// scale back down to thumbnail size
this._xscale=50;
this._yscale=50;
// put back to original position
this._x = _global.clothes50xPos;
this._y = _global.clothes50yPos;
}
}
Thanks for any help.