
Originally Posted by
smith1302
that is a reallly cool script. Can i use that script whoever made it? I wanna use it during a loading menu.
Feel free to use the following script...
Code:
// Make sure you've got a mc with the linkage id "bubbleID".
// What you set for your fps will also effect the speed of the bubble movement.
function createBubble() {
var holder:MovieClip = this.attachMovie("bubbleID","newBubble" + this.getNextHighestDepth(),this.getNextHighestDepth());
holder._y = Stage.height + holder._height;
holder._xscale = holder._yscale = Math.random() * 75 + 25;
holder.orgX = Math.random() * Stage.width;
holder.sinX = 2 * Math.random() * Math.PI;
holder.changeX = Math.random() * 0.1 + 0.05;
holder.changeY = Math.random() * 2 + 2;
holder.scaleUp = Math.random() * 40 + 10;
holder.onEnterFrame = function() {
this._x = this.orgX + Math.sin(this.sinX+=this.changeX) * this.scaleUp;
this._y -= this.changeY;
}
}
setInterval(this, "createBubble", 250);
how do i make it so that the bubbles float up from a static object located on the stage?
Try this...
Code:
// Make sure you've got a mc with the linkage id "bubbleID".
// Set the registration point to the top left corner.
// What you set for your fps will also effect the speed of the bubble movement.
// The box where bubbles will emerge from.
this.createEmptyMovieClip("rec",this.getNextHighestDepth());
rec._x = 300;
rec._y = 350;
rec.beginFill(0xff0000,100);
rec.moveTo(0,0);
rec.lineTo(100,0);
rec.lineTo(100,100);
rec.lineTo(0,100);
rec.endFill();
function createBubble() {
var holder:MovieClip = this.attachMovie("bubbleID","newBubble" + this.getNextHighestDepth(),this.getNextHighestDepth());
holder._x = holder.orgX = rec._x + Math.random() * rec._width;
holder._y = rec._y + holder._width;
holder._xscale = holder._yscale = Math.random() * 75 + 25;
holder.sinX = 2 * Math.random() * Math.PI;
holder.changeX = Math.random() * 0.1 + 0.05;
holder.changeY = Math.random() * 2 + 2;
holder.scaleUp = Math.random() * 40 + 10;
holder.onEnterFrame = function() {
this._x = this.orgX + Math.sin(this.sinX+=this.changeX) * this.scaleUp;
this._y -= this.changeY;
}
}
setInterval(this, "createBubble", 250);