-
1. Re: VERY IMPORTANT FEATURE TO ADD!: playTo(); or playRange(); for scrollTo() style animation
T. Ganoe Jan 16, 2015 7:54 AM (in response to NEW EXPORT ACCOUNT)I wrote a timeout/ interval function where you can pass the symbol, the start time and end time and it will keep calling itself and advancing the timeline until it reaches the end time. It's only 12 lines.
function timerFunction(startms, targetms, addinc, asymbol) {
//startms is the timeline starting point, usually where it is at the beginningof all this
//targetms is the desired timeline position
//addinc is the milliseconds you want the settimeout to wait, I use 500
// asymbol is the function with the timeline you want to control. Note: it is being passed around here be reference, not copies which is good.
//so call it like this: timerFunction(freqsym.getPosition(), 1800, 100, freqsym)
var ms;
//console.log(" startms: " + startms + ", targetms: " + targetms +", addinc: " + addinc );
if ( addinc < Math.abs(startms - targetms ) ) {
ms = startms + addinc;
asymbol.stop(ms);
//500 = 1/2 second = the delay the time interval will wait:
setTimeout( timerFunction, 500, ms, targetms, addinc, asymbol);
} else {
//finished
ms = targetms;
asymbol.stop(ms);
}
}
-
2. Re: VERY IMPORTANT FEATURE TO ADD!: playTo(); or playRange(); for scrollTo() style animation
NEW EXPORT ACCOUNT Jan 16, 2015 9:21 AM (in response to T. Ganoe)Hi,
Thanks so much for such a wonderful start! The main thing I don't see is how it would play reverse if the targetms is before the getPosition location.
I also admittedly don't understand how addinc and the setTimeout are being used in the function. Is that to make a certain playback speed...or make the play start after a specified wait duration?
Thanks again for the "only 12 lines" (that's a lot of lines for a script in this app) and also thanks in advance for clarifying!
This is a simple feature that should be part of EA already. Making buttons that run the timeline from a label to another label and sometimes skipping labels between the labels is so basic and should be easy.
-
3. Re: VERY IMPORTANT FEATURE TO ADD!: playTo(); or playRange(); for scrollTo() style animation
T. Ganoe Jan 16, 2015 10:13 AM (in response to NEW EXPORT ACCOUNT)The variable addinc is the amount you want to increment the timeline by. I guess I said in the notes that is was the set time out, but that is wrong (sorry!). Example: if you are at the timeline point of 1500 ms and you add 100 then it will move the playhead to 1600 ms. You want to move in small steps so it isn't jumpy.
It will work in reverse, because the formula if ( addinc < Math.abs(startms - targetms)) uses an absolute value, it doesn't care if it is positive or negative, only that it is within that interval, then it will proceed. If the increment will take it outside the interval, it will stop running.
I agree that it would be nice if you could 'playto' a certain point, like on the old Flash timelines. I absolutely HAD to have the ability, so I had to write this little function to do it.
-
4. Re: VERY IMPORTANT FEATURE TO ADD!: playTo(); or playRange(); for scrollTo() style animation
NEW EXPORT ACCOUNT Jan 16, 2015 10:29 AM (in response to T. Ganoe)Ah, I see! Yes, it's certainly a basic feature that should be in the API already! Seems that Adobe should add a new employee
So it automatically parses the Math.abs to make the symbol do a sym.play or sym.playReverse? And to play forward or backward at "normal" speed, should the addinc be 1?
Thanks again!
-
5. Re: VERY IMPORTANT FEATURE TO ADD!: playTo(); or playRange(); for scrollTo() style animation
NEW EXPORT ACCOUNT Feb 3, 2015 12:43 PM (in response to NEW EXPORT ACCOUNT)Hi again,
Tried that playTo function, yet it doesn't seem to work. Basically want to play to a frame or label on the timeline on a click. And that playTo function should also have some logic to play forward or reverse.
Honestly tried multiple ways of using that code. That code simply doesn't seem to function. I'd like to know a way to do this easily.
Added that code to the composition.ready and then added the function to a click event. Still didn't function though. Any good recommendations on how to make it function properly?
-
6. Re: VERY IMPORTANT FEATURE TO ADD!: playTo(); or playRange(); for scrollTo() style animation
resdesign Feb 3, 2015 3:03 PM (in response to NEW EXPORT ACCOUNT)1 person found this helpfulActually I realize I did not answer your question but I had to step away from my desk earlier.PlayTo() a label does not exist and would be a great addition.
Depending on what you are doing there are work arounds. I have some samples to accomplish that but I will have to dig around later to find them.
You might want to add this to a feature request. If you can't, I will post that request myself.
On Tue, Feb 3, 2015 at 3:50 PM, Marie Goodwyn <mariegoodwyn@gmail.com>
-
7. Re: VERY IMPORTANT FEATURE TO ADD!: playTo(); or playRange(); for scrollTo() style animation
resdesign Feb 4, 2015 1:01 PM (in response to NEW EXPORT ACCOUNT)Here is a sample for scrollTo with GreenSock
https://app.box.com/s/y0ih2sydi53hberd7ipw
I wonder if someone on the dev team could see if they could add this feature to EA since it is possible with GreenSock.
The other feature requested about are
playTo('lable')
or
play a range
All these would be awesome especially if we want to avoid using plugins.