Dear All I have been recently using AS3 in Adobe Animate to create engineering systems simulations the main thing I use is Tweenmax to animate
a path flow .As AS3 is on the way out I would like to the same type of simulations with Tweenmax JS ,but I cant seem to find the
same script there .
Here is my code in as3
As it is a fairly long code list I will show a small part with the type of actions I would like to achieve.
first i create a path
var hydbpath1:LinePath2D = new LinePath2D([
new Point(683.45,478.45),
new Point(703.45,478.45),
new Point(703.45,120),
new Point(790,120)
]);
then I create an array and populate it
var hydbp1:Array = [];
for (var n:int = 0; n < 12; n++)
{
hydbp1.push(createCircle(trvmc,5,0x2310E9));
};
Then I distribute the array to the path
hydbpath1.distribute(hydbp1, 0, 1, true);
Then I add a tween
var myTweenhydb1:TweenMax = new TweenMax(hydbpath1,10,{progress:2,repeat:-1,ease:Linear.easeNone});
I change the visibility of the path
hyd1path1.visible = false;
Add it inside a empty movie movie clip
Object(this).trvmc.addChild(hyd2path1);
hydbpath1.visible = false;
add a button
start_btn.addEventListener(MouseEvent.MOUSE_DOWN,begin);
function begin(e:MouseEvent){
trvmc.visible=true
myTweenhydb1.play();
};
create my circle
function createCircle(myCircle:MovieClip,d:Number,color:uint=0xFF0000):Shape
{
var circle:Shape = new Shape();// The instance name circle is created
circle.graphics.beginFill(color, 1);
circle.graphics.lineStyle(2, 0x000000);
circle.graphics.drawCircle(0, -0,d);
circle.graphics.endFill();
myCircle.addChild(circle);
return circle;
}
I can change the visibility of the circle path follower buy changing the visibility of the array itself
for each (var obj9:Object in hyd1p1)
{
obj9.visible = true;
}
I have been searching the docs ,can find some things like create the path but other things do not seem to be available or are performed differently.
Very new to JS trying to migrate any help appreciated.
Thank you for your time peter