PDA

View Full Version : Actionscript help!



New Generation
04-14-2008, 09:53 PM
I've made a realistic water effect on a picture using actionscript:

http://antiup.net/view.php?id=20412346866realistic%20water%20effects .swf

But how can I remove the white,blue line movements at the bottom and top of the water, they don't look the same and take away the realism.

Here's the actionscript I've used.


import flash.display.*;
import flash.geom.*;
import flash.filters.*;
myBitmap = new BitmapData(390,293,false,0);
pt = new Point(0,0);
mpoint = new Point(0,0);
myDispl = new DisplacementMapFilter(myBitmap, mpoint,1,2,10,50);
water_mc.myList = new Array();
water_mc.myList.push(myDispl);
water_mc.filters = water_mc.myList;
i = 1;
this.onEnterFrame = function()
{
filterList = water_mc.filters;
offset = new Array();
offset[1] = new Object();
offset[1].x = i;
offset[1].y = i/8;
myBitmap.perlinNoise(45,5,3,50,true,false, 7,true,offset);
filterList.mapBitmap = myBitmap;
water_mc.filters = filterList;
i++;
}


Please explain simply how to fix/remove the strange blue/white lines at the bottom and top of the water.

Kitsune
04-14-2008, 10:08 PM
change it to this


realitic: {water}
/h20
get
make {}}][%%%

I lol'd.

New Generation
04-14-2008, 10:11 PM
change it to this


realitic: {water}
/h20
get
make {}}][%%%

If you don't want to help then LEAVE MY THREAD NOW! .

Kitsune
04-14-2008, 10:29 PM
If you don't want to help then LEAVE MY THREAD NOW! .

You really think you can be more compelling by caps lock? It seems like you yell but you really do look like an idiot.

Is this AS3? If it's AS2 I can maybe help you out. This is all foriegn looking to me, however:


water_mc.myList.push(myDispl);

New Generation
04-14-2008, 10:33 PM
It's AS2. That piece of script, do I insert it somewhere or delete it from my actioscript? Because I can see that line in my actionscript :/

Kitsune
04-14-2008, 10:36 PM
I just said it looked foreign.

This is all a bit beyond me. Sorry.

Devour
04-14-2008, 11:25 PM
If you don't want to help then LEAVE MY THREAD NOW! .
Joke, get.

I don't really know what images and movements you used to make the effect, but you may only have to remove the water effect by taking the blue/white line effects manually, as in removing their movieclip.

Bonk
04-15-2008, 04:07 AM
I get the feeling that you didn't write that script.

If you don't understand it, then it defeats the purpose. If you understood it, you could go through step by step and see whats wrong.

New Generation
04-15-2008, 10:45 AM
So no one knows? Okay....


I'll just leave it like that. Coz I tried fixing it but it still didn't change. I changed the blur and force, but nothing.

Kitsune
04-15-2008, 03:41 PM
I get the feeling that you didn't write that script.

If you don't understand it, then it defeats the purpose. If you understood it, you could go through step by step and see whats wrong.
Win logic win reply

So no one knows? Okay....


I'll just leave it like that. Coz I tried fixing it but it still didn't change. I changed the blur and force, but nothing.
Failure method fail reply.

Sunder Forge
04-15-2008, 03:59 PM
Win logic win reply

Failure method fail reply.

Failure + Failure = x2 Failure

I'm gonna see what that code does now.

Kitsune
04-15-2008, 04:00 PM
Failure + Failure = x2 Failure

I'm gonna see what that code does now.

I think bitmap transmorphing is a bit beyond most of us. (Probably not The Pirate.) He may have copied that.

Sunder Forge
04-15-2008, 04:05 PM
My plan was to make a new movie, press F9 or something, and pop it in with a red BG.
:l

Sunder Forge
04-15-2008, 04:05 PM
My plan was to make a new movie, press F9 or something, and pop it in with a red BG.
:l

New Generation
04-15-2008, 04:16 PM
Nice double post! LOL

T_T

Yes I copied it so what, T_T

I need to fix it. Where's The Pirate when you need him?

Kitsune
04-15-2008, 04:21 PM
Nice double post! LOL

T_T

Yes I copied it so what, T_T

I need to fix it. Where's The Pirate when you need him?

If you copied it, yet it's imperfect, then it's not from a tut?

If it's not from a tut, and you copied it, it is likely stolen information from an unwilling source. That's what's wrong with it.

New Generation
04-15-2008, 04:36 PM
It's from a tut, and not stolen. The tut director came up with the script.

Kitsune
04-15-2008, 04:40 PM
It's from a tut, and not stolen. The tut director came up with the script.

Then why is it imperfecft!!???!??!KUjuw3edwl;iad/w;

New Generation
04-15-2008, 04:42 PM
I don't know. ASK THE TUTORIAL DIRECTOR!!!

I need it to be fixed so I can use it in my flash animations :/

Kitsune
04-15-2008, 04:52 PM
I don't know. ASK THE TUTORIAL DIRECTOR!!!

I need it to be fixed so I can use it in my flash animations :/

THEN USE A DIFFERENT TOTORIAL!!!

I can use caps. >:(

Paco
04-15-2008, 05:01 PM
agreed.
and your a fag for copying it at all without knowing what it is.

New Generation
04-15-2008, 05:13 PM
I know. It makes a picture of water, animated, making the water realistic. This is called morphing.

I'll explain what the actionscript does:


Line 1 - 4: Imports required Actionscript Classes.
Line 7: Creates an Object with an array of Bitmap pixels the size of our imported image.

Line 11: Uses the DisplacementMapFilter class to allow us to displace the image pixels. ( warp the picture )
Parameters of Interest:
The first parameter is our Bitmap Object from line 7.
The last 2 parameters are multiplers for the x and y displacement. Leave them for now, but play with them later.

Line 13 - 15: Adding our DisplacementMapFiler to our water_mc's available filters.
Line 17: Defining a function to run once per frame. (30 per second)
Line 19 - 23: Prepare to apply perlinNoise with a different offset point each frame.
Line 24 - 26: This is where all the magic happens. Applying perlinNoise to our Bitmap data.
Parameters of Interest:
parameter 1: affects frequency in the x direction.
parameter 2: affects frequency in the y direction.
parameter 3: number of octaves. Larger number = greater detail and requires more processing power.
Last parameter (offset): Defined earlier - This alters the x and y offset points for the octaves. (dramatic changes...)


EDIT: Actually I've fixed it myself!

http://antiup.net/view.php?id=22118474345realistic%20water%20effects .swf

:D

Krob
04-15-2008, 07:40 PM
What rhymes with James Moer?





.....













.......













Gay Porn ! : O

New Generation
04-16-2008, 11:11 AM
What rhymes with James Moer?





.....













.......













Gay Porn ! : O


Your a fag and you know that.

I don't know you but I already hate you to the full. Good work...

Raffi
04-16-2008, 12:03 PM
You fixed it, well done.

I think that just drawing the water yourself and making it simple is better for animations cuz they're stick movies, it's not like it's gonna be a really serious series, cuz it'd look silly, cz it's with sticks. ololololololovxfg

Kitsune
04-16-2008, 12:25 PM
Well, that's an impressive effect.

You got that explanation from the tut.

:<

Nice job fixing.

darkcampainger
04-16-2008, 03:43 PM
Wow, that is pretty neat. I've never looked into working with bitmaps and images in AS, but it definintely looks like it could be worthwhile.

Also, to anyone else interested in how it works:
Realistic Flash Water Effect (http://www.pixelhivedesign.com/tutorials/Realistic+Flash+Water+Effect/)
They've got some pretty cool stuff on that site.

New Generation
04-17-2008, 08:15 AM
I used another site. It got loads of special effect,animating,drawing,action script tutorials. You click on one section. FOr example an Animation section. And there;s about 20 pages of tutorials. Each page has about 1 tutorials. :D

FrAnKeH
04-18-2008, 08:01 PM
That is some awesome actionscript.
Love the effect.

Raffi
04-19-2008, 02:35 AM
Holy ****, FRANKEH?!