Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 Knowledgebase
Dual Wave Oscillations (Drawing API)  

Download .fla

Actionscript

var angle1 = 0;
var angle2 = 0;
var phase1 = 45;
var phase2 = 0;
var amplitude1 = 80;
var amplitude2 = 100;
var ang_velocity1 = 5;
var ang_velocity2 = 10;

var y = 0;
var x = 0;

moveTo(Stage.width/2 + amplitude2*Math.cos((phase2*Math.PI)/180),
Stage.height/2 + amplitude1*Math.sin((phase1*Math.PI)/180));
lineStyle(2,0xFF0000,100);

onEnterFrame = function (){
y = Stage.height/2 + amplitude1*Math.sin(((angle1+phase1)*
Math.PI)/180);
x = Stage.width/2 + amplitude2*Math.cos(((angle2+phase2)*
Math.PI)/180);

angle1 += ang_velocity1;
angle2 += ang_velocity2;
lineTo(x,y);
}


© 2008 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us