setting time to load mc
i creating game load mangoes numbers on it....i'm using numbers -9 9
i set time of each mango load...for example: #2 mango loads every 48th , 15th second of time, #-5 mango loads every 38th, 15th, 3rd second of time left....how code that???
i have code loads mangoes in random x position...but when character caught mango, doesn't load again...
here's jpg of i'm trying do...
this code i'm using: code attached in (-2) mango
onclipevent (load) {
//if (_root.time == 50) { ----------------> tried put if statementto determine loading time doesn't work
function reset() {
this._x=random(550);
this._y=-250;
_root.speedb=-5;
}
reset();
//}
}
onclipevent (enterframe) {
//if (_root.time == 50) { ------------------------>i tried put here doesn't work too...
this._y-=_root.speedb;
if (_y > 380) {
reset();
}
if (_root.mango_mc.inmango_mc.hittest(_root.caloy_lr.caloy_right.inbaske t_mc) || _root.mango_mc.inmango_mc.hittest(_root.caloy_lr.caloy_left.inbasket_ mc) || _root.mango_mc.inmango_mc.hittest(_root.caloy_lr.caloy_stop.inbasket_ mc)) {
_parent.mango_mc.gotoandplay(2);
_root.score -=2;
}
//}
}
hope guys help...thanks!!!!
remove code mango movieclip , attach analagous code mango's timeline:
this._x=random(550);
this._y=-250;
speedb=-5;
this.onenterframe=function(){
this._y-=speedb;if (_y > 380) {
this.removemovieclip();
}
if (this.hittest(_root.caloy_lr.caloy_right.inbaske t_mc) || this.hittest(_root.caloy_lr.caloy_left.inbasket_ mc) || this.hittest(_root.caloy_lr.caloy_stop.inbasket_ mc)) {
this.gotoandplay(2);
_root.score -=2;
}
//}
}
}
then right click on mango movieclip in library, click linkage, tick export actionscript , assign linkage id (eg, mangoid). once you've done you're setup rest.
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment