PDA

Click to See Complete Forum and Search --> : actionscripts


Big Perm-dizzle
03-26-2004, 04:06 AM
okay I am making a cow scene in flash and I want to have clouds blow thru the scene...HOWEVER I want the clouds to be 'clickable' once clicked I want them cloud to drop from the sky or vanish....

how do I do this? Mr. Case where are you?http://www.twosmalldogs.com/images/cow.gif

"In the past couple of weeks your kids have touched me, and i'm pretty sure i've touched them too" - Jack Black (School of Rock)

Big Perm-dizzle
03-26-2004, 04:46 AM
and if you dont know anything about flash or actionscripts please dont comment

"In the past couple of weeks your kids have touched me, and i'm pretty sure i've touched them too" - Jack Black (School of Rock)

casedsgn
03-28-2004, 11:51 AM
That doesn't sound too complicated.
To start, make the clouds buttons, but place each button in it's own movieClip. You'll want to use a looping actionscript to move the clouds across the stage. Something like:
//if the cloud movieclip is visible, move it 1 pixel to the right
if(cloud01._visible == true) {
cloud01._x += 1;
}

and then put some code on your cloud button like:
//if this cloud is clicked, make it invisible
on(release) {
this._visible = false;
}

This would be a simple way to make your clouds disappear, sort of an on/off thing. But you can get as complicated as you want...with fading/dropping clouds instead of just disappearing. Shoot me an email if you want some more advanced help bro.

Post Edited (casedsgn) : 3/28/2004 6:51:52 AM GMT

Big Perm-dizzle
03-29-2004, 10:03 AM
sniff sniff I love you....i have been on actionscript.org on there forum talking to those nerds too

"In the past couple of weeks your kids have touched me, and i'm pretty sure i've touched them too" - Jack Black (School of Rock)

casedsgn
03-29-2004, 10:49 AM
lol, I love you too.
Did that work for you, or at least get you on the right track?

Big Perm-dizzle
03-29-2004, 06:03 PM
i have not tried it...i will let you know tonight....

"In the past couple of weeks your kids have touched me, and i'm pretty sure i've touched them too" - Jack Black (School of Rock)

Big Perm-dizzle
04-07-2004, 04:48 AM
okay that makes it disapear than how do i get random clouds to fly across the screen

"In the past couple of weeks your kids have touched me, and i'm pretty sure i've touched them too" - Jack Black (School of Rock)

Mel
04-07-2004, 11:13 AM
Hey perm,
Hope I'm not steppin on case's toes here. There are several ways to get random clouds to fly across the screen. I would try using the attachMovie/creatyEmptyMovieClip functions.
Here is some rough code i've come up with.

_parent.createEmptyMovieClip('holder', 1);
//this creates a movieclip aligned to 0x,0y on the stage of the _parent clip
for (i=1; i<10; i++) {
//this is a for in loop, well documented in the help menu of flash.
_parent.holder.attachMovie('cloud_mc', ('cloud'+i), i);
//this is pulling a movieclip i named (under export settings) cloud_mc in the library
_parent['cloud'+i]._y += (10*i);
//this is using the counter variable 'i' to determine the number of clips and their depths, which could be cool for the clouds.
}

Basically, you're going to want to generate your clouds using the Math.random() function, and then set up a counter variable that allows you to control the variety you want in your x and y movements.

Let me know if this helps.
(p.s., it's late here. if the code doesn't work, blame sleep deprivation :) )

Thanks for the help.

Big Perm-dizzle
04-11-2004, 07:38 AM
okay my actionscript junkies Perm has gotten the OReilly's Actionscripts book and he is on page 135 of 994.... day one of reading and slowing learning.... I can feel the actionscript powers running thru my veins....actually my head hurts

'In the past couple of weeks your kids have touched me, and i'm pretty sure i've touched them too' - Jack Black (School of Rock)

casedsgn
04-11-2004, 11:05 PM
Great book!!!
It's a little tough at first, but once you understand the basics of how to create and use arrays, functions, and objects..everything else seems to fall into place. Have fun!

Mel
04-12-2004, 09:29 AM
I have yet to purchase the latest one...haven't internalized the first one yet...but yeah...GREAT resource!!!!

Thanks for the help.