Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions flash like rollover animation trigger

  • flash like rollover animation trigger

    Posted by Mark Allen on October 11, 2008 at 11:24 pm

    I saw this thread https://forums.creativecow.net/readpost/227/8979 but it didn’t quite answer my question entirely, so I’m starting a new one…

    I want to create an animation which is mimicking a user interface. When my “mouse” (graphic) passes over a button, I want to trigger a little scale animation that does a little wiggle to it (i.e. it’s not just scaling larger).

    There will be many of these buttons – like 30, and the mouse graphic will glide over them thus triggering the animation each time.

    My question therefore is… How would I write an expression so that my pre-comp’d button would know to trigger it’s animation…. it’s the “on enter” of the graphic that would cue the animation which would then play all the way through.

    I thought about just doing this is flash or maybe even motion is a better platform for it – both I have, but I understand AE much better and would rather stay in AE.

    Thank you.

    Dan Ebberts replied 17 years, 7 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    October 13, 2008 at 3:15 pm

    Basically, I think you’d need to set up a loop where you start at the current frame and go backwards in time until you find the most recent frame where the distance from the mouse transitioned from being not close enough to trigger the animation to being close enough. You would then use the time difference from the current time to that transition time and then: use valueAtTime() to drive a keyframed animation; or use it to drive time remapping; or use it to drive the animation coded within the expression.

    Not trivial, but certainly do-able.

    Dan

  • Mark Allen

    October 13, 2008 at 9:46 pm

    So… I should ask directly then. Is there any possible way for an expression to recognize when another graphic is in it’s zone? Because what I’d want to be able to do is just move the mouse graphic around and then have that trigger the animation to cue ideally. I could hand time them too, of course, but we’ll be doing this a lot.

    thanks.

  • Dan Ebberts

    October 13, 2008 at 9:54 pm

    Well, the answer to your question is yes, but I’m not sure you’re asking the right question. It’s easy to tell if one layer is within a certain distance of another. It’s the triggering part that’s the problem. You really only have two choices, you can have an expression that uses the distance directly in it’s calculation (which doesn’t sound like what you need), or, you can go back in time and figure how long ago the triggering event occured and use that time in your expression.

    Dan

  • Mark Allen

    October 14, 2008 at 12:11 am

    So… boy, I’m sorry I’m not sounding smart here… but if layer “Button” has the expression… and at 1 secon, layer “graphic” moves into the x,y space of layer “button,” I want layer button to start playing.

    Why would I need to “go back in time?”

  • Dan Ebberts

    October 14, 2008 at 12:19 am

    I guess it boils down to the fact that expressions have no memory. An expression has no way of knowing what it did on the previous frame. You can’t create information that persists from one frame to the next. So the expression doesn’t know how long ago it was triggered unless it goes back, frame by frame, and figures it out.

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy