Hello all.
In a flash file, I have a box which you can drag across the top and when you click it it duplicates itself. However, the code which is supposed to make this box fall until it hits the "floor" (a movie clip spanning across the bottom of the platform), does not operate, leaving the box suspended in mid-air. Syntax check says no errors, so I was wondering if anyone here could help me out? Here's the code:
Code:
function drop(b){
b.onEnterFrame=function(){
_root[b]._y-=20;
if(_root[b].hitTest(_root["floor"])){
_root[b].play();
removeMovieClip(_root[b]);
}
}
}
startDrag(box,true,20,30,530,20);
_global.i=-1;
_root["box"].onPress=function(){
_global.i++;
duplicateMovieClip(box,("dbox"+i),i);
drop(("dbox"+i));
}