[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (8 B)
stop();
Frame 2 (120 B)
loadVariablesNum (((("search.php?pnts=" + _root.score) + "&username=") + _root.username) + "", 0, "POST");
stop();
Frame 3 (2.18 KiB) ●
var my_sound = new Sound();
my_sound.loadSound("1.mp3", true);
stop();
Mouse.hide();
score = 0;
health = 100;
speed = 30;
passed = 0;
placed = 0;
growth = 0.1;
velocity = 5;
player = _root.attachMovie("ball", "ball", _root.getNextHighestDepth());
player.gotoAndStop(1);
player.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse;
};
_root.onMouseDown = function () {
if (player._currentframe == player._totalframes) {
player.gotoAndStop(1);
} else {
player.gotoAndStop(player._currentframe + 1);
}
};
_root.onEnterFrame = function () {
passed++;
if (passed > speed) {
passed = 0;
collect = _root.attachMovie("ball", "ball_" + placed, _root.getNextHighestDepth(), {_x:Math.random() * 500, _y:Math.random() * 500});
collect.gotoAndStop(Math.floor(Math.random() * collect._totalframes) + 1);
collect.angle = Math.random() * 6.28318531;
collect.xspeed = velocity * Math.cos(collect.angle);
collect.yspeed = velocity * Math.sin(collect.angle);
collect.onEnterFrame = function () {
this._width = this._width + growth;
this._height = this._height + growth;
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
x_dist = this._x - player._x;
y_dist = this._y - player._y;
if (this._x < 0) {
this._x = 0;
this.xspeed = this.xspeed * -1;
}
if (this._x > 500) {
this._x = 500;
this.xspeed = this.xspeed * -1;
}
if (this._y < 0) {
this._y = 0;
this.yspeed = this.yspeed * -1;
}
if (this._y > 500) {
this._y = 500;
this.yspeed = this.yspeed * -1;
}
distance = (x_dist * x_dist) + (y_dist * y_dist);
touch_distance = ((player._width + this._width) / 2) * ((player._width + this._width) / 2);
if (distance < touch_distance) {
if (this._currentframe == player._currentframe) {
my_click_sound = new Sound();
my_click_sound.attachSound("adriantnt_bubble_clap.mp3");
my_click_sound.start();
this.removeMovieClip();
score++;
} else {
health--;
}
if (health < 0) {
trace("game over");
removeMovieClip(ball);
gotoAndStop (2);
}
}
};
}
};
Frame 4 (8 B)
stop();
Symbol 19 Button (34 B)
on (release) {
gotoAndPlay (3);
}