Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------------------------------------------------------
- // Frame 1
- //------------------------------------------------------------
- n_balls=0;
- for (i=0;i<5;i++) {
- _root.attachMovie("flower8","flower"+i,i);
- _root["flower"+i]._x=200+random(200);
- _root["flower"+i]._y=200+random(200);
- }
- //---------------------------------------
- _root.attachMovie("ballcage", "bc_dyn",8);
- _root["bc_dyn"]._x=200;
- _root["bc_dyn"]._y=100;
- _root.attachMovie("ballcage", "bc_dyn3",20);
- _root["bc_dyn3"]._x=350;
- _root["bc_dyn3"]._y=100;
- //---------------------------------------
- _root.createEmptyMovieClip("zbox",1);
- _root.createEmptyMovieClip("zbox3",1);
- /*_root.zbox.attachMovie("ball88","ball_mc",8);
- _root.zbox.ball_mc._x=200;
- _root.zbox.ball_mc._y=300;*/
- //---------------------------------------
- ball7.prototype= new MovieClip();
- function ball7 () {
- this._x=random(Stage.width);
- this._y=random(Stage.height);
- this.velX=random(15);
- this.velY=random(15);
- }
- ball7.prototype.onEnterFrame=function() {
- this._x+=this.velX;
- this._y+=this.velY;
- //trace(this._name);
- if ((this._x<this._width/2) ||
- (this._x>Stage.width-this._width/2)) {
- this.velX*=-1;
- this._x+=this.velX;
- }
- if ((this._y<this._height/2) ||
- (this._y>Stage.height-this._height/2)) {
- this.velY*=-1;
- this._y+=this.velY;
- }
- }
- Object.registerClass("ball88",ball7);
- //_root.attachMovie("ball88","ball_mc77",40);
- //------------------------------------------------------------
- // Ball88 Clip
- //------------------------------------------------------------
- onClipEvent(load) {
- this.velX=random(15);
- this.velY=random(15);
- }
- onClipEvent(enterFrame) {
- this._x+=this.velX;
- this._y+=this.velY;
- //trace(this._name);
- if ((this._x<this._width/2) ||
- (this._x>Stage.width-this._width/2)) {
- this.velX*=-1;
- this._x+=this.velX;
- }
- if ((this._y<this._height/2) ||
- (this._y>Stage.height-this._height/2)) {
- this.velY*=-1;
- this._y+=this.velY;
- }
- }
- //------------------------------------------------------------
- // Red Button click
- //------------------------------------------------------------
- on (release) {
- n_balls++;
- _root.zbox3.attachMovie("ball88","ball_mc"+n_balls,
- 50+n_balls);
- }
- //------------------------------------------------------------
- // Flower8 Clip
- //------------------------------------------------------------
- onClipEvent(load) {
- this.velX=random(15);
- this.velY=random(15);
- }
- onClipEvent(enterFrame) {
- this._x+=this.velX;
- this._y+=this.velY;
- //trace(this.name);
- if ((this._x<0) || (this._x>Stage.width)) {
- this.velX*=-1;
- this._x+=this.velX;
- }
- if ((this._y<0) || (this._y>Stage.height)) {
- this.velY*=-1;
- this._y+=this.velY;
- }
- }
- //------------------------------------------------------------
- // BallCage Frame 1
- //------------------------------------------------------------
- inball_mc.velX=random(5);
- inball_mc.velY=random(5);
- inball_mc.parH=125;//this._height;
- inball_mc.parW=125;//this._width;
- inball_mc.par=this;
- ball_xt=0;
- //------------------------------------------
- inball_mc.onEnterFrame= function () {
- this._x+=this.velX;
- this._y+=this.velY;
- //trace(this.parz._width);
- ball_xt=this._x;
- ball_yt=this._y;
- if ((this._x<this._width/2-10) ||
- (this._x>this.parW-this._width/2)) {
- this.velX*=-1;
- this._x+=this.velX;
- }
- if ((this._y<this._height/2-10) ||
- (this._y>this.parH-this._height/2)) {
- this.velY*=-1;
- this._y+=this.velY;
- }
- }
- //------------------------------------------
- inball_mc.onMouseDown=function() {
- //trace(this.par);
- //this.par.removeMovieClip();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement