An homage to Shep….
- by cathcw
Flash Back Week 2…
I had a gchat conversation with a good friend at the Berkman Center today. It reminded me of the fun we had this summer in the Sheep Cave (the name for the office where some of the Herdict team sit).
I’m in the middle of some Flash animation assignments at the moment, specifically to make a object move when the mouse is clicked, I haven’t completely managed to nail the assignment yet – but in the meantime – this one is for the Sheep Cave. Click around on the screen to make the sheep move). I’d like him to glide rather than leap – more soon…

Code here:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class cath_2v2 extends MovieClip {
// sheep is a class variable
// this way the function “comeToMe” knows it
private var sheep:MovieClip;
public function cath_2v2() {
sheep = new Sheep();
addChild(sheep);
stage.addEventListener(MouseEvent.MOUSE_DOWN, comeToMe);
}
private function comeToMe(event:MouseEvent):void {
// make the sheep movieclip goes where the mouse was clicked
sheep.x = event.stageX;
sheep.y = event.stageY;
}
}
}