home *** CD-ROM | disk | FTP | other *** search
- set("/:oldx",eval("/:x"));
- set("/:x",_root._xmouse);
- if(eval("/:x") < xmin)
- {
- set("/:x",xmin);
- }
- if(eval("/:x") > xmax)
- {
- set("/:x",xmax);
- }
- dx = eval("/:x") - it._x;
- if(dx > 0)
- {
- set("/:hd",1);
- }
- else
- {
- set("/:hd",2);
- }
- if(math.abs(dx) > math.abs(xs))
- {
- runtime++;
- moving = 500;
- if(dx > 0)
- {
- nx = it._x + xs;
- }
- else
- {
- nx = it._x - xs;
- }
- it.gotoAndStop("run" + eval("/:hd"));
- it._x = nx;
- }
- else
- {
- if(runtime > 3)
- {
- it._x = eval("/:x");
- moving = 0;
- runtime = 0;
- it.gotoAndStop("stand" + eval("/:hd"));
- }
- else if(math.abs(dx) > 3)
- {
- it._x = eval("/:x");
- moving = 500;
- it.gotoAndStop("run" + eval("/:hd"));
- }
- if(moving > 495)
- {
- moving = 5;
- }
- else if(moving > 5 and moving <= 495)
- {
- moving = 0;
- }
- }
- if(moving > 0)
- {
- moving--;
- }
- if(eval("/:oldx") == eval("/:x"))
- {
- if(!moving or it._x == xmax or it._x == xmin)
- {
- it.gotoAndStop("stand" + eval("/:hd"));
- }
- }
- if(xmax > eval("/:midx"))
- {
- set("/:oldx2",eval("/:x2"));
- set("/:x2",_root.m._x);
- if(eval("/:x2") < xmin)
- {
- set("/:x2",xmin);
- }
- if(eval("/:x2") > xmax)
- {
- set("/:x2",xmax);
- }
- dx2 = eval("/:x2") - it2._x;
- if(dx2 > 0)
- {
- set("/:hd2",1);
- }
- else
- {
- set("/:hd2",2);
- }
- if(math.abs(dx2) > math.abs(xs2))
- {
- runtime2++;
- moving2 = 500;
- if(dx2 > 0)
- {
- nx = it2._x + xs2;
- }
- else
- {
- nx = it2._x - xs2;
- }
- it2.gotoAndStop("run" + eval("/:hd2"));
- it2._x = nx;
- }
- else
- {
- if(runtime2 > 3)
- {
- it2._x = eval("/:x2");
- moving2 = 0;
- runtime2 = 0;
- it2.gotoAndStop(1);
- }
- else if(math.abs(dx2) > 3)
- {
- it2._x = eval("/:x2");
- moving2 = 500;
- it2.gotoAndStop("run" + eval("/:hd2"));
- }
- if(moving2 > 495)
- {
- moving2 = 5;
- }
- else if(moving2 > 5 and moving2 <= 495)
- {
- moving2 = 0;
- }
- }
- if(moving2 > 0)
- {
- moving2--;
- }
- if(eval("/:oldx2") == eval("/:x2"))
- {
- if(!moving2 or it2._x == xmax or it2._x == xmin)
- {
- it2.gotoAndStop("stand" + eval("/:hd2"));
- }
- }
- }
- if(xmax < eval("/:midx"))
- {
- edruntime++;
- if(edruntime > 30 and !shout and !eval("/:mtalk"))
- {
- shout = 1;
- set("/:mtalk",1);
- _root.zmacedyoucandoit.start();
- }
- }
- onmouseDown = function()
- {
- if(!eval("/:jump"))
- {
- gotoAndStop("jump");
- play();
- }
- };
-