Bubbles like an Old Wurlitzer Jukebox?

Greetings,

I am attempting to create a bubble effect like those old jukeboxes that have that clear or reddish tint tubes with the bubbles rising up through them like so - http://www.istockphoto.com/file_closeup/when/settings/past/901788_pink_jukebox.php?id=901788

So, I created a Mask above my Actions layer; but it does not mask at all - the bubbles work, just no masking.

I may be going about this totally the wrong way, but I am just learning.

For the bubbles, I created them using only AS from a tutorial as follows (probably simple to you Gurus!):
for(i=0;i<60;i++) {
var t = this.attachMovie(“bubble”,“bubble”+i,i);
t._x = Math.random()*450;
t._y = Math.random()*400;
t.dx = Math.round(Math.random()*450);
t.dy = Math.round(Math.random()*400);
t._xscale = Math.random()*300+40;
t._yscale = t._xscale;
t.onEnterFrame = mover;
}
function mover() {
this._x += (this.dx-this._x)/3;
this._y += (this.dy-this._y)/3;
if(Math.round(this._x) == this.dx) {
this.dx = Math.round(Math.random()*450);
this.dy = Math.round(Math.random()*400+10);
}
}

Any help or pointing me in the right direction would be appreciated!!

Rustyd

I think this may be what you are wanting.
I am definitely no guru and there are probably better ways of doing this but here is my stab at it.

I attached .fla and .as file

class CIRCLE{
	var radius:Number;
	var num:Number;
	var thiscircle:Object;
	
	public function CIRCLE(r,n){
		radius = r;
		num = n;
		drawCircle();
	}
	
	private function drawCircle(){
		thiscircle = _root.createEmptyMovieClip("bubble"+num,_root.getNextHighestDepth());
		thiscircle.lineStyle(2,0x000000,70);
		var theta = 45*(Math.PI/180);
		var cr = radius/Math.cos(theta/2);
		var angle = 0;
		var cangle = -theta/2;
	
		thiscircle.moveTo(radius, 0);
	
		for(var i=0;i<8;i++){
			angle += theta;
			cangle += theta;
			
			var endX = radius*Math.cos (angle);
			var endY = radius*Math.sin (angle);
			var cX = cr*Math.cos (cangle);
			var cY = cr*Math.sin (cangle);
	
			thiscircle.curveTo(cX,cY,endX,endY);
		}
	}
}
import CIRCLE;
var bubbles = [];
var makeBubbleInt = setInterval(makeBubble,100);
var floatBubbleBubbleInt = setInterval(floatBubble,10);
var bubbleNum = 0;

function makeBubble(){
	var bubble:CIRCLE = new CIRCLE(10,bubbleNum);
	bubbleNum++;
	bubbles.push(bubble.thiscircle);
	bubble.thiscircle._y = base._y;
	bubble.thiscircle._x = base._x + Math.random() * base._width;
}

function floatBubble(){ //move all the bubbles up
	trace(bubbles.length);
	clearInterval(floatBubbleBubbleInt);
	for(var i=0;i<bubbles.length;i++){
		if(bubbles*._y > 100){
			bubbles*._y--;
			//Maybe change the X value here using Sign so the bubbles oscillate
		}else{
			bubbles*.removeMovieClip();
			bubbles.splice(i,1);
		}
	}
	floatBubbleBubbleInt = setInterval(floatBubble,10);
}

Sorry, I should have read your post closer. Here is a version using a mask.

Thanks ieatcotton!:party:
That’s EXACTLY what I was trying to do. I don’t understand how you did it, but I am going to look very closely.

FYI, “neighbor”, I live about 30 minutes to the east of you-Denison: hell of a storm last couple of days!

Thanks again,

Rustyd

Hi,

I am (unsuccessfully) attempting to create a jukebox which has bubbles floating up through the glass sides.

Using ‘ieatcotton’s’ example, I have been able to create the effect I want: but only within his example, not mine which is attached.

WHAT am I doing wrong?

Thanks,
Rustyd