QUOTE(hollsmeags @ 17 Apr, 2008 - 11:46 AM)

I need to simply get a ball to drop into a basket....and be able to drag and drop basket...
i have
soccer.as // teh ball
soccerdc.as
soccermain.fla
target.as // the basket
tempcode.as
when would i put the functionality to drag the basket to catch the ball?
here is my target file, would it be here?
package {
import flash.display.*;
import flash.events.*;
import flash.utils.getTimer;
public class target extends MovieClip {
myTarget.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
myTarget.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void {
event.target.startDrag(true);
}
function dropIt(event:MouseEvent):void {
event.target.stopDrag();
}
myTarget.buttonMode = true;
}
}
}
//end function
// End class
//end package
shouldn't these:
CODE
myTarget.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
myTarget.addEventListener(MouseEvent.MOUSE_UP, dropIt);
be in soccer.as ?
target.as does not need any listeners. you just need to make sure they can "talk" and an easy way for AS2 is to know what the target's instance name is and relation to _root so in soccer.as
CODE
//in function dropIt(){ ... }
//if the target instance is _root.target_mc
if( this.hitTest(_root.target_mc)){
// do something with _root.target_mc like an animation
}
hope this helps