Copy link to clipboard
Copied
kann ich irgendwie herausfinden was meine vorherige Value war und sie im Script anschließend benutzen?
Ich möchte dann die vorherige Value mit meiner jetzigen vergleichen.
Z.b.
if (Slider6.value <= Slider6.previousValue)
mc50013262.x += 1;
Copy link to clipboard
Copied
Hi.
Store your current value in a variable and then use it for comparison. Like this:
var previousValue:Number;
if (!isNaN(previousValue) && Slider6.value <= previousValue) // you need to check first if the previousValue variable has some value in it
mc50013262.x += 1;
previousValue = Slider6.value; // assign the current value to the previousValue variable
I hope this helps.
Regards,
JC
Copy link to clipboard
Copied
if previousValue=0, if(previousValue) will be false. use !isNaN(previousValue)
var previousValue:Number;
if (!isNaN(previousValue) && Slider6.value <= previousValue) {
// you need to check first if the previousValue variable has some value in it
mc50013262.x += 1;
}
previousValue = Slider6.value; // assign the current value to the previousValue variable
Copy link to clipboard
Copied
Thanks for the correction, kglad!
I do appreciate.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now