Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-24-2007, 12:04 PM   #1
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,578
Default is this water effect possible in AS3?

Hi all

please see this effect

http://missionh2o.com.au/game/ani1.mov

Is there a way to create that ripple transition just using actionscript?

Thanks in advance
__________________
Billy
Online Galleries
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 10-24-2007, 03:36 PM   #2
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,784
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

sure: http://livedocs.adobe.com/flex/2/lan...MapFilter.html
__________________
(6)
senocular is offline   Reply With Quote
Old 10-24-2007, 03:39 PM   #3
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,578
Default

hi senocular

thanks for the reply. Yes I am playing with that filter at the moment. You don't have any examples of this effect do you?

Thanks again
__________________
Billy
Online Galleries
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 10-25-2007, 08:49 AM   #4
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,578
Default

all good got it sorted

Thanks
__________________
Billy
Online Galleries
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 10-25-2007, 09:18 AM   #5
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,058
Default

think you can post your example?
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman
Flash Gordon is offline   Reply With Quote
Old 04-07-2008, 04:37 PM   #6
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,578
Default

sure

ActionScript Code:
package {     import flash.display.MovieClip;     import flash.display.BitmapData;     import flash.display.Loader;     import flash.events.*;     import flash.net.URLRequest;     import flash.filters.DisplacementMapFilter;     import flash.utils.Timer;     import flash.geom.Point;     import flash.ui.ContextMenu;     import flash.ui.ContextMenuItem;     import flash.net.URLRequest;     import flash.net.navigateToURL;     public class RippleTransition extends MovieClip {         private var filtri_array:Array;         private var bit_data:BitmapData;         private var spostamento:DisplacementMapFilter;         private var z:Number=1;         private var frizione:Number=.95;         private var filterScaleX:Number;         private var filterScaleY:Number;         private var point:Point;         private var size:Number;         private var _dir:String;         private var targetClip_mc:MovieClip;         public function RippleTransition(targ:MovieClip,dir:String) {             _dir=dir;             init(targ,_dir);         }         private function init(targ:MovieClip,dir:String):void {             targetClip_mc=targ;             bit_data=new BitmapData(targetClip_mc.width,targetClip_mc.height,true,0xFFFFFFFF);             point=new Point(0,0);             spostamento=new DisplacementMapFilter(bit_data,point,1,2,filterScaleX,filterScaleY);             filtri_array=new Array();             filtri_array.push(spostamento);             /*targetClip_mc.filters=filtri_array;*/             if (_dir=='in') {                 targetClip_mc.alpha=0;                 targetClip_mc.visible=false;             } else {                 targetClip_mc.alpha=1;                 targetClip_mc.visible=true;             }         }         public function startTransition():void {             targetClip_mc.filters=filtri_array;             if (_dir=='in') {                 size=150;                 filterScaleX=10;                 filterScaleY=30;                 targetClip_mc.visible=true;             } else {                 size=0;                 filterScaleX=1;                 filterScaleY=1;             }             targetClip_mc.addEventListener(Event.ENTER_FRAME,goEffect);         }         public function stopTransition():void {             targetClip_mc.removeEventListener(Event.ENTER_FRAME,goEffect);         }         private function goEffect(e:Event):void {             var removeEffect:Boolean=false;             if (_dir=='in') {                 if (targetClip_mc.alpha<1) {                     targetClip_mc.alpha+=.05;                 }                 size+=3                 ;                 if (filterScaleX>1) {                     filterScaleX-=1;                 }                 if (filterScaleY>1) {                     filterScaleY-=1;                 } else {                     removeEffect=true;                     targetClip_mc.filters=new Array;                     //trace('effect removed');                     targetClip_mc.removeEventListener(Event.ENTER_FRAME,goEffect);                 }                 z+=1;             } else {                 if (targetClip_mc.alpha>0) {                     targetClip_mc.alpha-=.05;                 } else {                     targetClip_mc.visible=false;                     targetClip_mc.removeEventListener(Event.ENTER_FRAME,goEffect);                 }                 size-=3                 ;                 if (filterScaleX<10) {                     filterScaleX+=1;                 }                 if (filterScaleY<30) {                     filterScaleY+=1;                 }                 z-=1;             }             if (removeEffect) {                 targetClip_mc.filters.mapBitmap=null;                 targetClip_mc.filters=new Array;                 //trace('off');             } else {                 spostamento=new DisplacementMapFilter(bit_data,point,1,2,filterScaleX,filterScaleY);                 filtri_array=new Array();                 filtri_array.push(spostamento);                 targetClip_mc.filters=filtri_array;                 //trace(size)                 var point:Point=new Point(z,z/2);                 bit_data.perlinNoise(125,size*8,2,523,true,false,7,true,[point,point]);                 targetClip_mc.filters.mapBitmap=bit_data;                 targetClip_mc.filters=targetClip_mc.filters;                 //trace('still running');             }         }     } }



USAGE

ActionScript Code:
tip1_btn.buttonMode=true; tip1_btn.addEventListener(MouseEvent.CLICK,tip1Manager); var o1:RippleTransition=new RippleTransition(tip1_mc,'out'); var i1:RippleTransition=new RippleTransition(tip1_mc,'in'); function tip1Manager(e:MouseEvent):void {     if (tip1_mc.alpha>0) {         o1.startTransition();         i1.stopTransition();     } else {         i1.startTransition();         o1.stopTransition();     } } tip1_mc.close_mc.addEventListener(MouseEvent.CLICK,tip1Manager);



Click Play Now here

http://www.savewater.com.au/game


to see the effect

cheers
__________________
Billy
Online Galleries
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
water effect revisited... unicorn Animation and Effects 5 03-12-2008 12:50 PM
Water sparkle effect LocoDave ActionScript 1.0 (and below) 0 04-27-2007 09:19 AM
water effect question again.... spike101 Flash 8 General Questions 2 11-29-2006 05:57 PM
Water effect on an image boisecuban Animation and Effects 3 11-28-2005 03:12 PM
water waves effect raphaelc4 Animation and Effects 0 06-10-2005 03:11 PM


All times are GMT. The time now is 06:57 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.