Im making a beerbottle movie, where it is a beer bottle, and inside you can see the gas bubbles coming up.
How would i make the bubbles randomly float to the top using action script?
Im making a beerbottle movie, where it is a beer bottle, and inside you can see the gas bubbles coming up.
How would i make the bubbles randomly float to the top using action script?
I know someone did a really good random bubble movie just a while back. If you do a search you will find it.
Ill do a search in a second, hard to coursework and use forums at same time.
lol
Thoriphs posted a bubble FLA in the open source section of kirupa.
Where can that be found?
Search for it on this forum
I think this is it?
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=23970&highlight=Random+Bubbles
I need them light gas bubbles, to float to the top then dissapear.
But instead of looping a movie clip, i would want it to randomly put some bubbles in the bottle and go to the top of the bottle.
the thread that Kel gave you is exactly what you want.
you can try altering the falling snow tutorial, which does a good job of descibing its code so you will be able to understand it and modify it
http://www.kirupa.com/developer/mx/snow.htm
just change the graphic, make it go up, and remove the random motion.
Ahhh thought you meant the square ones.
Anyway, they seem abit jumpy? And they dont move.
Edit- Also, how would i get it to work for the top of the bottle? Add a mask around the edges of the bottle?
Hi,
There are 2 files in that thread, one with square bubbles, and one I posted with round ones.
Edit- Also, how would i get it to work for the top of the bottle? Add a mask around the edges of the bottle?
Is the user looking AT the bottle from the side, or in the bottle from the top ?
SteveD
From the side…
___
| |
( )
( )
( )
-----
Ok, that pic did not work to well.
hi,
my name is Blake. I’m new to kirupa’s forms… but you will be hearing from me cuz i need help just lyke anyone else… so without further adue here is your answer:
intro: I had the same problem as you, i wanted butterflys to go across the screen on my website. so we will be using the code from that project, only we will modify it to fit your needs.
I’m assuming that you have a pic of the bubble you wanna use. so take that pic and put it in a movie clip called “bubble”.
Now (inside that bubble movieclip) use tweens to make the bubble go from on side of the screen to the other (kinda make it a wavy moation lyke dis ~~~~~~ but sense bubbles go up make it go verticle.)
drag that movieclip to scene 1 (or whatever you called it) and give it an instance name of “bubble”.
Now we apply actions (this is where the fun starts). make a new layer with 2 blank keyframes and apply these actions to frame 1 on the timeline:
COPYCOUNT = COPYCOUNT + 1;
if (COPYCOUNT>100) {
COPYCOUNT = 1;
}
duplicateMovieClip (“bubble”, “bubble” & COPYCOUNT, COPYCOUNT);
gotoAndPlay(1);
<let’s take some notes shall we??? frame one duplicates the bubble 100 times then gives your cpu a break by sending it to frame 2, but frame 2 sends the bubble back to frame 1 thus creating a loop… you don’t have to use 100 but a high number looks better>
onClipEvent (load) {
//modified code:
_x=random(?);
_width=random(?);
_height = random (?);
_alpha = random (?);
if(this._x<you movie width here){
_visible = false;
}
if(this._y<you movie height here){
_visible = false;
}
//Blakes Code:
//CLIP1.swapDepths(random(101));
//_y=random(101);
//_x=random(101);
//_width=random(45);
//_height = random (45);
//_alpha = random (51);
//_rotation = random (361);
}
// i never could get the swap depth part to work, if you do let me kno. if you do it right it should look like bubbles are moving infront of and behind eachother//
these actions controll exsactly what happins when a new bubble is created.
now I made some changes to your code.
JUST TO KEEP THINGS CLEAR:
YOUR ALMOST DONE!!
take the pic of your bottle and use it as a mask for the bubbles so they don’t appear to be floating aroud outside of the bottle.
your layers should be something lyke this (it dosn’t realy matter where the actions layer is):
<Mask: bottle> - you can’t see this one -
<actions>
<bubble>
<bottle> - you can see this one -
this is an extra step. you don’t have to do this one.
use a linear garnet with one end transparent and the other the same color as your background. now put that in the mask to give the effect that your bubble is fading away as it reaches the top of the bottle.
DAM THAT WAY EASYER THAN IT SOUNDS!!! ALL THAT FOR ABOUT 5 MIN WORTH THE WORK!!! I GUESS IT’S THE WAY I WORDED IT. SAWWIE :beam:
AS USUAL, HERE IS THE FLA OF THE BUBBLES (SORRY THIS DOSN’T INCLUDE THE BOTTLE, BUT HEY YOU KNOW HOW TO PUT IT IN THERE NOW):
IF YOU NEED MORE HELP JUST HOLLA AND I’LL GET RIGHT BACK TO YOU.
much luv: Blake aka playboy_94804bubble_tut.fla
They disapear when they get to a certain hight…
Another thing… When the clip starts up, the bubbles will float up. Wont it look odd with no bubbles in the middle?
Bump
Come on guys, i really want to make this.
:: Copyright KIRUPA 2024 //--