Adobe Animate CC 2021 function call on Program start
I work with Adobe Animate CC html5 canvas to create an interactive board with different panels of switches, analogue and digital instruments and so on. On some parts of a helicopter model I display the rotational speed. When starting my project all speeds has to be zero. When I use some button the speed (rounds per minute = rpm) should increase. As rotation of e.g. the rotor must be synchronous to the value of the pointer of the analogue instrument I added a function call to each frame of the pointer animation of that instrument to increase the value of the rotor rpm by one. As this rotation speed is dependant on other rotation, after increasing the value I call another function to check the rotation speeds. It looks like this:
On each frame I call the increase function:
this.parent.increaseValue();
The function increaseValue() looks like this:
this.increaseValue = function() {
rpm_rotor++;
this.mc_rotor.text = rpm_rotor.toString(); // displays the rotation at the helicopter model
check_rpm();
}
My check-routine will check the dependant values:
function check_rpm()
{
.....
if ( rpm_OfOtherPart == 0 )
{
rpm_rotor = 6144;
this.mc_rotor.text = rpm_rotor.toString();
}
}
And here is my problem:
As soon as I start my program it displays on my helicopter model the value 6144 although I didn't interact with my program to start the animation (value of rpm_OfOtherPart is right now 0). When I comment out the function call to check_rpm() it shows the correct rpm of zero. How can it be that the function check_rpm() will be executed without function call?
