Snow Fall :)
Copy and paste in the first frame of the movie (you need a dark background) Code: // Pom 3/01/2003 // Credits: // Bit 24/12/2002 // Kirupa snow tutorial points = []; maxPoints = 100; y = 200; for (i=0; i < maxPoints; i++) { points[i] = {x:20+500/(maxPoints-1)*i, y:y}; } createEmptyMovieClip("bombe",5000); bombe.lineStyle(5,0xffffff,100); bombe.lineTo(0.15,0.45); bombe._visible=false;
createEmptyMovieClip("land", 1000000); dep = 1; onEnterFrame = function () { if (getTimer()-start > 100) { start = getTimer(); bomb = bombe.duplicateMovieClip("b"+dep, dep++); bomb.frequency=Math.random()*Math.PI; bomb.ySpeed = 1+Math.random()*2; bomb._xscale = bomb._yscale=50+Math.random()*50; bomb._alpha = 75+Math.random()*100; bomb.onEnterFrame = fall; bomb._x = Math.random()*250+Math.random()*250+20; bomb._y = 0; } }; drawLand(); function destroy(x) { points[x].y -= 4; if (x) { points[x-1].y -= 1; } if (x < maxPoints-1) { points[x+1].y -= 1; } drawLand(); } function drawLand() { with (land) { clear(); beginFill(0xffffff, 100); lineStyle(1, 0xffffff, 100); moveTo(points[0].x, points[0].y); for (i=0; i < maxPoints; i++) { lineto(points[i].x, points[i].y); } lineTo(520, 380); lineTo(20, 380); endFill(); } } function fall() { this.rad += this.frequency*(Math.PI/180); this._x += Math.cos(this.rad); this._y += this.ySpeed; if (land.hitTest(this._x, this._y, true)) { x = Math.round((this._x-20)/500*maxPoints); removeMovieClip(this); destroy(x); } } pom <
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 01-04-2003, 12:30 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Snow Fall
Does anyone now of a open source file of snow falling or how you would go about creating a snow fall.
ta stu
[AS3] Snow Fall
I was bored and did this.It is a loop animation made by codes.All of the codes are in main frame...
Don't forget the click the logo in animation
[CS3] Need Some Help With Snow Fall Script
Hi,
I used a tutorial found here: http://www.kirupa.com/developer/flash8/snow.htm and I had great results with it.
However could you help me how to reverse the snow fall that it goes from bottom to up?
And how can I add a random parameter for "snowflake" to rotate it's axis?
Here is the code for my flash movie so far:
init = function () {
width = 850;
// pixels
height = 180;
// pixels
max_snowsize = 8;
// pixels
snowflakes = 80;
// quantity
for (i=0; i<snowflakes; i++) {
t = attachMovie("snow", "snow"+i, i);
t._alpha = 20+Math.random()*15;
t._x = -(width/2)+Math.random()*(1.5*width);
t._y = -(height/2)+Math.random()*(1.5*height);
t._xscale = t._yscale=50+Math.random()*(max_snowsize*10);
t.k = 1+Math.random()*0.001;
t.wind = -1.5+Math.random()*(1.4*1);
t.onEnterFrame = mover;
}
};
mover = function() {
this._y += this.k;
this._x += this.wind;
if (this._y>height+10) {
this._y = -30;
}
if (this._x>width+20) {
this._x = -(width/2)+Math.random()*(1.5*width);
this._y = -30;
} else if (this._x<20) {
this._x = -(width/2)+Math.random()*(1.5*width);
this._y = -30;
}
}
init();
What Makes The Snow Fall?
Hi folks,
I'm still learning Actionscript and so far it's been enlightning. I can pretty much look at someones code and understand what it's doing, however, I'm baffled about one script I found here on the site.
This code came from the Snow 3.0 tutorial for Flash:
init = function () {
width = 300; // pixels
height = 200; // pixels
max_snowsize = 10; // pixels
snowflakes = 50; // quantity
for (i=0; i<snowflakes; i++) {
t = attachMovie("snow", "snow"+i, i);
t._alpha = 20+Math.random()*60;
t._x = -(width/2)+Math.random()*(1.5*width);
t._y = -(height/2)+Math.random()*(1.5*height);
t._xscale = t._yscale=50+Math.random()*(max_snowsize*10);
t.k = 1+Math.random()*2;
t.wind = -1.5+Math.random()*(1.4*3);
t.onEnterFrame = mover;
}
};
mover = function() {
this._y += this.k;
this._x += this.wind;
if (this._y>height+10) {
this._y = -20;
}
if (this._x>width+20) {
this._x = -(width/2)+Math.random()*(1.5*width);
this._y = -20;
} else if (this._x<-20) {
this._x = -(width/2)+Math.random()*(1.5*width);
this._y = -20;
}
}
init();
What part of this code makes the snow actually fall downwards? I've been trying to rework this code to make "sparks" come out from a central place and go in all directions, but no matter what I've changed so far, they just all fall instead of "explode" out.
Any ideas?
Thank you so much!!
Fall Snow 2.0 - Flash MX 2004
I am trying to recreate the falling snow script and having a hard time doing so. I keep getting a message saying Flash Player 8 is having a hard time with the script. Does anyone have any insight on this? Is this an issue with Player 8 or am I screwing up the script?
I am pretty wet behind the ear when it comes to action script. Majority of my knowledge has come from Kirupa.com. Any input would be greatly appreciated.
Thanks everyone
trxfx - tfox@rue21.com
Snow Effect Without The Mouse Effects Required [asdvanced Snow From Free Source]
Hi all.
Managed to find this really cool snow effect but trying to remove the mouse interaction, but in doing so the snow seems to stop or fade after five or ten seconds due to removing the mouse elements, however if they are in place without any hit with the mouse the snow still continues to fall regardless so in effect I need the snow to keep running without any effect from the mouse, here is the actionscript as below. Any help would be great.
cheers
ActionScript Code:
//var total = 0;//function setQuality(thisSpeed) { if (thisSpeed == 1) { total = 100; } else if (thisSpeed == 2) { total = 300; } else { total = 400; }}setQuality(_global.speed);/////////////////////////////////////function createParticles() { for (var i = 0; i<total; i++) { this.ele.attachMovie("bit", "bit"+i, i++); var clip = this.ele["bit"+i]; clip.force = 0; clip.mn = 1+Math.random()*1.5; clip.x = Math.random()*2-0.75; clip.y = Math.random()*2; clip._x = (Math.random()*this.frame_mc._width)+left; clip._y = Math.random()*200-220; clip._xscale = 70+Math.random()*290; clip._yscale = 70+Math.random()*290; clip.ct = Math.floor(Math.random()*60); clip.c = 0; clip.onEnterFrame = function() { this.c++; if (this._x<_x/*mouse*/) { this.x -= this.force; } else { this.x += this.force; } if (this.force>0) { this.c = 0; this.force *= 0.6; if (this.force<0.05) { this.force = 0; } } if (this.c>this.ct) { this.x = Math.random()*5-1.5; this.c = 0; this.ct = Math.floor(Math.random()*60); } this._y += (this.y+this.mn)-(this.force*9); this._x += this.x; if (this._x<left-5) { this.x = Math.random()*5-1.5; this.force = 0; this._x = right+2; } if (this._x>right+5) { this.x = Math.random()*5-1.5; this.force = 0; this._x = left-2; } if (this._y>_y/*mouse*/-25 && this._y<_y/*mouse*/+25 && this._x>_x/*mouse*/-35 && this._x<_x/*mouse*/+35) { this.force += Math.random()*5; } else if (this._y>=bottom+5) { this.force = 0; this.x = Math.random()*5-1.5; } }; }}///*function clearAll() { for (var i = 1; i<=total; i++) { removeMovieClip(this.ele["bit"+i]); }}*///createParticles();//stop();
Falling Snow - Showing/Hiding The Snow
Hey everyone,
A question someone asked me earlier was how to make the snow disappear or reappear at a certain point. For example, you may want the snow to fall in Frames 1-30, but beyond that, you would not want any snow to fall. The code I had provided in v2.0 of the tutorial did not address that, so until I write a modified tutorial, I have provided the FLAs (for MX) that help you to control when you want or don't want the snow to fall
I have provided two variations of the Falling Snow file. One method stops or starts the falling snow by having you press a button (the white/pink circle on the bottom left of the animation). The second method displays the falling snow for about 30 frames, and then it stops displaying the falling snow.
The primary thing you will need to consider in this new version of the falling snow is your placement of:
ActionScript Code:
_root.run = 1 // displays snow
- and -
ActionScript Code:
_root.run = 0 // hides snow
Also, I made some minor modifications to the actual Falling Snow code found on the snow movie clip, and that can be found here:
ActionScript Code:
onClipEvent (load) {//variableswidth = 300;height = 200;//random x,y, and alpha this._xscale = this._yscale=50+Math.random()*100;this._alpha = 20+Math.random()*50;//random x and y for flakesthis._x = -width+Math.random()*(3*width);this._y = -10+Math.random()*height;//speed and trigonometric valuei = 1+Math.random()*2;k = -Math.PI+Math.random()*Math.PI;rad = 0;this._visible = false;}onClipEvent (enterFrame) {//////////////////////////////////////if (_root.run == 1) {//////////////////////////////////////this._visible = true;// horizontal movementrad += (k/180)*Math.PI;xmovement = _root._xmouse;this._x -= Math.cos(rad)+(xmovement-(width/2))/50;// vertical movementthis._y += i;// remove clips when they misbehave (overstep boundaries)if (this._x>(width+50)) {this._x = -45;this._y = Math.random()*height*2;}if (this._x<-50) {this._x = width+45;this._y = Math.random()*height*2;}if (this._y>=height) {this._y = -50;this._x = -width+Math.random()*(3*width);}//////////////////////////////////////} else {this._visible = false;}//////////////////////////////////////}
The source files should contain everything I have explained here.
Cheers!
Kirupa
Snow Behind MC (using Snow 3.0)- Depth Issues
Hey folks! I am hoping someone can help me out with this one. Thanks to Sammo I was able to put an end to my snowfall headache using snow 3.0 http://www.kirupa.com/developer/flash8/snow.htm -- But now another problem has risen.
I need it to "snow" behind a movieclip and I can seem to figure out the right way of doing this . Anyone? Not sure if this involves using movieclip.getNextHighestDepth(); for the object? Just one of my unsuccessful attempts.
Help.....
Image Fall Apart
Hello is it possible to make a image fall apart like the twintowers did ? I would like to know how to do that effect. allmost like the image splitting up in pixels and the pixels fall down the screen !
anybody know some sites with that effect also ?
or dissolve like this would be cool too
http://www.cookienest.com/content/ap...solveimage.php
but then without an other image behind it
Function Fall Through
I've got a pretty simple action script below which resides in the first frame of the timeline. The problem is that when the movie is executed it immediately executes all the functions despite the fact that I haven't taken any actions to trigger the functions on the movie clip the functions are attached to. It just inexplicably falls through all the functions and executes every line. What is up? I appreciate any help on this one.
Thanks,
Randal
Code:
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
StatusBar_mc._x = _xmouse - 30;
StatusBar_mc._y = _ymouse - 60;
updateAfterEvent();
};
Mouse.addListener(mouseListener);
//
DU_mc.onRollOver = CountyOver('Test','Region');
DU_mc.onRollOut = CountyOut();
DU_mc.onRelease = CountyRelease();
function CountyOver(CountyName:String,CountyRegion:String) {
trace("CountyOver is called");
_root.StatusBar_mc._visible=true;
_root.StatusBar_mc.countyNamePrint.text=CountyName;
_root.StatusBar_mc.countyPopulationPrint.text=CountyRegion;
this.gotoAndStop(2);
};
function CountyOut() {
_root.StatusBar_mc._visible=false;
this.gotoAndStop(1);
};
function CountyRelease() {
_root.DetailBox_mc.gotoAndPlay(2);
};
Check Fall
i have a 3 mc's when you click one it falls. What i need is for it to check if the 2 others are still there if not then put them there..
Water Fall Effect
hi flash masters
i have been looking for water fall effect like spring from mountain. and i'd tried many times using duplicate movie action but couldn't reached upto nice one. So please help me to get a nice movie.
help me.....................
may_hs
Peel/fall Effect
I was wondering if anybody had a good example of a effect of a shape peeling off and falling. Like maybe even a picture that falls, etc.
It would help alot.
Thanks
Button That Will Fall And Bounce
Hi all,
I need help with actionscript and some ideas to help achieve this.
I want to have a button that falls in to place with a little bounce when the frame is loaded. After the button has fallen into place I'd like to have a mouseover that raises the button up, when let go it will bouce back in to place.
If you know of a script that will achieve this or resources or ideas that will help me, please let me know. thanks.
[CS3] Button That Will Fall And Bounce
Hi all,
I need help with actionscript and some ideas to help achieve this.
I want to have a button that falls in to place with a little bounce when the frame is loaded. After the button has fallen into place I'd like to have a mouseover that raises the button up, when let go it will bouce back in to place.
If you know of a script that will achieve this or resources or ideas that will help me, please let me know. thanks.
Make Him Fall Asleep..
Hi,
I want to close the eyes of a portrait picture i have.
I've got one original photo with his eyes open.
one photoshopped with his eyes "half closed"
one photoshopped with his eyes closed
My question is how can i make a smooth animation out of this like he actually closes his eyes. I've tried to put all 3 pictures behind each other on the timeline but that creates a very unreal animation.
If anyone can help me out I would greatly appreciate it.
Does Any One No How To Make A Guy Jump And Fall
hi
its me,13 year old. i really will appreciate it alot if you guys could post me a tute on making a guy jump and fall. the mario thing, landing on a piece of brick or something
and i will be very glad if you can post me codes for horizontal scrolling just like mario
Thanks
Random Fall Troubles
I am working on a game where mousetraps , cheese and things like that fall randomly. I have the falling part figured out but i can't seem to get them to duplicate correctly...I attached just a simple version of the cheese fall
George Bush Fall
Can someone tell me how they can make such a great thing. Any tutorials?
Plese help.
Lots of advance thanks to all of you.
Free Fall Guided Motion
I'm trying to implement a free fall guided motion to influence a ball to roll neatly across a half pipe.
@
@@ O <---- ball
@@@@
@@@@@@
@@@@@@@@@@ <-- curved halfpipe
@@@@@@@@@@@@@@@
Something like this, the ball must roll down along the curve. Anyone has any idea how to implement this?
I've been to http://www.philterdesign.com, and seen their example on free fall. I need to extend this to free fall + guided motion. Not guided motion tweening.
The Rise And Fall Of Graphic Rollovers
I am looking to do something seemingly simple:
I have a series of symbols (lets say they are a pear, apple, grape, etc). When you roll over them, I want the symbols to rise. When the mouse leaves, the symbols float back down.
Of course, the floating back down part is the clencher. It can't simply be an MC of something rising and falling because the symbol must immediately start floating back down no matter how high it has risen.
Does anyone know of a simple code remedy for this?
Make Object Fall When Released?
I want an object (ElementFe_mc) to fall to a table top (_y=412.4) when released...
I thought this would be simple but it doesn't work...
Here's the code I've tried...
Code:
ElementFe_mc.onRelease = function(): Void {
this.stopDrag();
if (ElementFe_mc._y < 412.4) {
this._y++
}
}
[F8] Making Two Movieclips Fall When They Touch
Alright, what I am trying to do is have four movieclips bounce off the sides of the screen and when a certain two of them touch they will stay together and fall to the bottom of the screen. I have been able to make the movieclips bounce off the sides of the screen but I do not know how to get the movieclips to fall when they touch.
This is the actionscript I'm using to make the movie clips bounce:
onClipEvent (load) {
speedX = 4;
speedY = 6;
}
onClipEvent (enterFrame) {
this._X += speedX;
this._y += speedY;
if (this._X>=525) {
speedX = -speedX;
} else if (this._X<=4) {
speedX = -speedX;
}
if (this._Y>=380) {
speedY = -speedY;
} else if (this._Y<=6) {
speedY = -speedY;
}
}
Any help would be greatly appreciated.
Make Object Fall When Released?
I want an object (ElementFe_mc) to fall to a table top (_y=412.4) when released...
I thought this would be simple but have been unable to make it work...
Here's the code I've tried....
Code:
ElementFe_mc.onRelease = function(): Void {
this.stopDrag();
if (ElementFe_mc._y < 412.4) {
this._y++
}
}
Drag Drop & Fall (Perspective)
Go to this site and enter it:
www.aeliusmedia.co.uk/
Ok he gives a quick demo on how you drag the icons to the "abyss" Although I am fairly new to flash - I am guessing that the drag and drop is fairly easily done... seems like I've seen tutorials on that... BUT how is he creating the "Falling" technique that gets triggered depending on WHERE you drop the icon????
You drop the icon to the left and it falls naturally into the abyss from that point and the same if you dropped it to the right or middle.
Very interesting site!
Thanks!
Drag Drop And Object Fall...
http://www.weazolink.com/flipflap.swf
the beach ball is drag and dropable.. how do i mak it to when you drop it in the air it falls back down... maybe with the effect of a bounce too..
Random Fall Items Within A Certain Area...
I am trying to make a game where there are random fall items ( cheese, mouse traps and things like that) but i want them to just fall inside a certain area. I created a movie clip the size of the area I want them to fall inside, but i have no idea where to start on the AS to get the to fall inside it...pls help
Thanx in advance
Make The Flower Petals Fall Apart?
Hi, I am new at this forum. I am stuck with a flash project I am supposed to work on, which is to make the flower petals fall apart. I am not sure how I am going to do that on Flash MX 2004. (I have Flash 8 too - this flash project was originally worked with Flash MX 2004, so if you think Flash 8 would work better for this project, let me know then. thanks.)
Do you have any helpful tips that would make the flower petals fall apart? Thanks!!
P.S. -- I am a beginner-intermediate Flashster...I am not expert with ActionScript yet.
Drag Drop And Object Fall...
http://www.weazolink.com/flipflap.swf
the beach ball is drag and dropable.. how do i mak it to when you drop it in the air it falls back down... maybe with the effect of a bounce too..
Drag & Drop ? How Do You Make Something Fall To A Certain Point When You Let Go Of MC
I have a Drag & Drop Question. PLEASE HELP!!!!
How Do you make a certain MC fall down to a certain point when you let go of MC? LIKE GRAVITY!
http://www.AltGraphicDesign.com/Mr_Myers/Mr_Myers.html
If you look on the bottom of the flash site I'm creating, there is a Shell and a Starfish that you can drag.
I'm looking to be able to drag and drop those objects, but instead of just staying there in the place where you left it, the dragable MC or button falls down to the ground and perhaps bounces? I would just be happy with falling!
Help!!!
Thanks!
How Do You Do This? - Make An Image Fall Backwards Realistically
Hello,
I am attempting to make an image fall backwards similar to the way a cardboard cut out would fall if pushed backwards on to the floor.
The effect is used at http://www.stickmanonfire.com/ in the their match stick navigation (bottom right)
If it cannot be done in flash what tools do you suggest,
Thank you
RR
Scale, Duplicate, And Fall Type Thingy
here is this thing i made. i wanted to use it in a project for a client but it turned out to be too CPU intensive for what i was using it for. you can download the source here: download source link
edit:
okay, i updated the file a bit. its a little more interesting now...
How Do You Do This? - Make An Image Fall Backwards Realistically
Hello,
I am attempting to make an image fall backwards similar to the way a cardboard cut out would fall if pushed backwards on to the floor.
The effect is used at http://www.stickmanonfire.com/ in the their match stick navigation (bottom right)
If it cannot be done in flash what tools do you suggest,
Thank you
RR
Getting Dynamically Created Clips To Move If They Fall On Existing Clip
I wanted to write a script that would check the position of a load of clips created via the “duplicateMovieClip” method (I have also colored them as part of the exercise, but this is not relevant to the problem.)
The idea is if a clip over laps another clip I set it’s _x & _y to 20 greater than the clip it has landed on.
This is where I have got to with it, which is not having the desired effect.
code: var balloonColor;
clam_array = new Array();
for (vari=0; i<20; i++) {
balloon.duplicateMovieClip("balloon"+i, i);
clam_array.push(this["balloon"+i]);
this["balloon"+i]._x = Math.floor(Math.random()*550);
this["balloon"+i]._y = Math.floor(Math.random()*400);
balloonColor = new Color(this["balloon"+i]);
balloonColor.setRGB(Math.floor(Math.random()*0xFFF FFF));
}
delete balloonColor;
for (i in clam_array) {
if (this["balloon"+i].hitTest(clam_array[i])) {
this["balloon"+i]._x = clam_array[i]._x+20;
this["balloon"+i]._y = clam_array[i]._y+20;
trace(this["balloon"+i]._name);
}
}
Constrain Objects To Fall Within The Width Of Canvas, Change Opacity As Object Falls.
First time using Flash and I'm trying to modify a tutorial I found on this site. Bear with me if this stuff is too much of a noob question =T.
I'm using this tutorial: http://www.flashkit.com/tutorials/Ac...-980/index.php and changing it so that there are leaves instead of snow falling. So far I have this: http://dcdomain.org/images/taro/left.swf There are a few things I would like to modify though.
1) Some of the leaves are falling outside of the right margin, is there a way for me to put in a constraint that would force the leaves to stay within the canvas parameters, either not allow leaves to fall that far to the right, or have them bounce back to the left when it hits the right margin.
2) I would like to get the leaves to fade out as it falls, so when it reaches the bottom, they should have an opacity of around 0 to 10. What are the steps I should do, or the actionscript I should add to get this effect?
Existing Code:
Frame1:
PHP Code:
shape = Random(4) + 1;
flakey.gotoAndStop(shape);
fallwidth = 300;
flakey._x = Math.random() * fallwidth;
flakey._y = 0;
fallheight = 550;
magnify = Math.random();
flakey._xscale = (magnify * 75) + 25;
flakey._yscale = (magnify * 75) + 25;
step = (magnify * magnify * 2) + 3;
drift = (Math.random() * 4) - 2;
spin = (Math.random() * 6) - 3;
flakey._y = Math.random() * fallheight;
gotoAndPlay(3);
Frame2:
PHP Code:
shape = Random(4) + 1;
flakey.gotoAndStop(shape);
fallwidth = 300;
flakey._x = Math.random() * fallwidth;
flakey._y = 0;
fallheight = 550;
magnify = Math.random();
flakey._xscale = (magnify * 75) + 25;
flakey._yscale = (magnify * 75) + 25;
step = (magnify * magnify * 2) + 3;
drift = (Math.random() * 4) - 2;
spin = (Math.random() * 6) - 3;
Frame4:
PHP Code:
flakeyfall = flakey._y;
if ((flakeyfall <= fallheight) && (flakeydrift>= -35) && (flakeydrift <= fallwidth+35)) {
flakey._y = flakey._y + step;
flakey._x = flakey._x + drift;
flakey._rotation = flakey._rotation + spin;
gotoAndPlay(3);
} else {
gotoAndPlay(2);
}
One of my friends tried helping by providing me with this:
PHP Code:
//on frame 1
this.onEnterFrame = function(){
if(leafClip._x<rightboundary && leafClip._x>leftboundary){
//this is the function to make leaves fall
leafFalling()
}
}
//leaffalling function
leafFalling = function(){
//initialize alpha for leaves
leafClip._alpha = 100
//then your random falling actions go here
}
-to make the leaves fade with actionscript:
//first make them start fading at a certain y-position
this.onEnterFrame = function(){
if(leafClip._y<400){
leafClip._alpha += (0-leafClip._alpha)*.5
}
}
I tried messing around with the code he provided, inserting it into spots within the code I thought would work... obviously I had no luck.
I was able to get the leaves to change opacity, but only once and I guess the alpha stays at 0 afterwards, I tried adding the line where they return to 100% opacity afterwards, but that didn't work.
Any help would be appreciated. Thank you!
Snow, Blummin Snow
Hey Guys,
What a nightmare! I love the Snow tutorial our god of Flash, Kirupa, did but I can't seem to take the code etc and bung it into something I'm working on.
It's bloody strange, everything is exactly the same. The names, the vars, the timelines, the sizes, the Flash version, even the bloody colours, but it still just grinds my system to a hault and prompts me to stop the script. This all happens when I export/preview obviously.
Anyway, it's here www.tigeralex.co.uk/MYTEST_SOL.fla
Would love some help?
A dearly grateful, Alex.
Snow Glorious Snow
Hello all,
Hate to cross post this, but I'm not getting any takers over in the Flash 8 forum.
I am using the snow method wonderfully created here on Kirupa and have a quick question.
Currently, the movie just starts with a screen full of snow. I'd like to get it to start off screen and fall in. Basically setting an initial state for the ._y of 0. I also can't seem to get a delay working for the function. Ideas?
Thanks!
ActionScript Code:
var movieWidth = 470;var movieHeight = 230;createEmptyMovieClip("snowholder",this.getNextHighestDepth());function makesnow() { for (var i = 0; i<500; i++) { var clip = snowholder.attachMovie("snow", "s"+i, i); clip.i = 1+Math.random()*2; clip.k = -Math.PI+Math.random()*Math.PI; clip._xscale = clip._yscale=20+Math.random()*100; clip._alpha = 75+Math.random()*100; clip._x = -10+Math.random()*movieWidth; clip._y = -10+Math.random()*movieHeight; clip.finished = false clip.onEnterFrame = move; }}function move() { this.rad += (this.k/180)*Math.PI; this._x -= Math.cos(this.rad); this._y += this.i; if (this._y>=movieHeight) { if(!this.finished){ this._y = -5; }else{ this.removeMovieClip() } } if ((this._x>=movieWidth) || (this._x<=0)) { this._x = -10+Math.random()*movieWidth; this._y = -5; }}function removesnow() { for (var obj in snowholder) { if (typeof snowholder[obj] == "movieclip") { snowholder[obj].finished = true } }}makesnow();setInterval(removesnow,5000);
Snow 3.0 Help - End Snow Function
Hey !!
Im using the Snow 3.0 effect but i need a bit of AS that will end the snow effect once the playhead has left the frame
or a bit of AS that will end the function once a button is clicked or something like that
cos the snow still falls after i leave the frame !!
[FMX] Making Site "fall Asleep"
Hi all,
I was wondering if its possible to make a website fall asleep when the focus is shifted away from the entire window.... so something like onBlur. I've seen this on a few websites and I got thinking how they did it. I'm guessing they have some kind of JavaScript code in their HTML page that can detect an onBlur or killFocus or whatever you call it - then the flash movie picks up on this and takes the appropriate action - like pauses a movie or displays a message "please come back" or things to that effect.
EXAMPLE:
Go to howblue.com and go to the WANDER AWAY section and click his links. Provided you have enough "money" (you can earn "money" by navigating around) you'll be taken to pixel ranger etc. Now click on the howblue.com window and you'll see its been greyed out and is "asleep". You have to click the movie to awaken the site. Trust me.
Does anyone have any ideas how to proceed?
[FMX] Making Site "fall Asleep"
Hi all,
I was wondering if its possible to make a website fall asleep when the focus is shifted away from the entire window.... so something like onBlur. I've seen this on a few websites and I got thinking how they did it. I'm guessing they have some kind of JavaScript code in their HTML page that can detect an onBlur or killFocus or whatever you call it - then the flash movie picks up on this and takes the appropriate action - like pauses a movie or displays a message "please come back" or things to that effect.
EXAMPLE:
Go to howblue.com and go to the WANDER AWAY section and click his links. Provided you have enough "money" (you can earn "money" by navigating around) you'll be taken to pixel ranger etc. Now click on the howblue.com window and you'll see its been greyed out and is "asleep". You have to click the movie to awaken the site. Trust me.
Does anyone have any ideas how to proceed?
Getting "bricks" To Fall In Order
I have 14 bricks, and want each one to fall down the screen in a particular order.
I'm guessing I'll need to use an array, but I am really new to actionscript and need basic intsructions on what to do...
thanks
(this is my fla so far, the user has to match the puzzle on the right as the bricks fall in an assigned order)
Using Flash MX
Snow On Tv
Hello all,
Everybody has seen it on tv. The channels where there is nothing but snow. I would like to do the same in Flash but I have no idea how I would do this. Could somebody give me some help.
Thanks
Snow In MX?
Hi all!
Is it possible to have falling snow that settles and builds up in certain areas on the stage?
Thanks in advance
Andy
Snow
I am making a Christmas card with flash mx and I am using actionscript to make it snow. Could somebody check my code and tell me what is wrong with the part I mared red.
// general
Blow = function () { if (!(random(75))) {windTarget = (random(21)-10)/3;}wind += (windTarget-wind)/20;};
// snowfall
MovieClip.prototype.addFlake = function() {
this.attachMovie("snow", "s"+++this.depth, this.depth);
var me = this.flakes[this.flakes.length]=this["s"+this.depth];
me.x = random(500)-100;
me._xscale = me._yscale=random(75)+26;
me.scale = me._xscale/100;
};
MovieClip.prototype.killFlake = function(i) {
this.flakes[i].removeMovieClip();
this.flakes.splice(i, 1);
};
MovieClip.prototype.LandFlake = function(i) {
var clip = _root.landscape.snow;
clip.attachMovie("snow", "s"+++this.depth, this.depth);
var me = clip["s"+clip.depth];
me._x = this.flakes[i]._x;
me._y = this.flakes[i]._y;
me._xscale = me._yscale=this.flakes[i]._xscale;
this.killFlake(i);
};
// flakes
MovieClip.prototype.fall = function() {
this._x = Math.cos(this.t += .1)*10+(this.x += _root.wind*this.scale);
this._y += 3*this.scale;
};
MovieClip.prototype.isInBounds = function() {
return (this._x>-100 && this._x<400 && this._y<300);
};
MovieClip.prototype.isTouchingLand = function() {
return _root.landscape.hitTest(this._x, this._y, true);
};
Thanks
Snow Tv
hi i saw somewhere on this site a tv with snow on it does any1 has a link to that b/c i can't ifn it anymore ore got something thats simulair
Snow
Do anyone know how to make the snow. (many white object fall down endlessly)
I have thought of a method by inserting layer and creating motion guide.
But it is complicate and cant make it endlessly.
Can someone know how to make it by actionscript or have any ideas of making snow?
Thanks
|