ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Faking a Scrolling Website menu?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jonas Grumby
Faking a Scrolling Website menu?
on Jun 13, 2007 at 2:46:08 pm

I'm doing an animated commercial for a website and have re-created the sites pages in 3D in AE so you can fly all around the site.

I have scrolling menus on one page and I want to use expressions to link the websites "slider" which moves up & down to an expression control in AE. Then I want to link the long vertical list of text to the webpage slider's "Y" position and inversely multiply it's effect so the text scrolls the opposite direction and much faster than the slider... whooo!

To add to your challenge, I suck at math! Any help would be majorly appreciated! I could keyframe all of this but I'm trying to force myself to learn expression language! Thanks, Chris



Return to posts index

moldyboot
Re: Faking a Scrolling Website menu?
on Jun 13, 2007 at 9:51:58 pm

so you have a layer (i'll call slider) that animates vertically, and another layer (i'll call page) that needs to be linked to that movement.

an expression like this should work...

y = layer("slider").position[1] * -2;
[value[0],y]

paste it into the 'page' layer's position expression field. the '-2' is the multiplier for the position of the page relative to the slider, so you will need to make some adjustment to that variable. you may also need to add and offset to fine tune the positioning... that would change it to something liek this...

y = (layer("slider").position[1] * -2) + 100;
[value[0],y]

where '100' acts as an offset variable, again you would need to adjust that variable to suit your needs.

Kevin Camp
Designer - KCPQ, KMYQ & KRCW


Return to posts index

Jonas Grumby
Re: Faking a Scrolling Website menu?
on Jun 14, 2007 at 11:13:14 am

Thanks for the reply. I figured out something close to what you wrote, but I couldn't get my offset to work right. I'll try yours! I may be back for a bit of an explaination on the "[value[0],y]" part.

Thanks again! Chris


Return to posts index


moldyboot
Re: Faking a Scrolling Website menu?
on Jun 14, 2007 at 3:08:45 pm

the 'value[0]' part just tells ae to use the current value of 'x', the horizontal component of an [x,y] coordinate system. 'value[1]' would be the 'y' component (fyi). this separtes the x position of the 'page' layer from the postion of the 'slider', allowing it to be completely independent from slider

the 'y' returns the value of y from the equation that linked the movement to the y movement of the 'slider'.

so what you get is a layer who's vertical position is determined by another layer, but can be positioned freely horizontally.

Kevin Camp
Designer - KCPQ, KMYQ & KRCW


Return to posts index

Jonas Grumby
Re: Faking a Scrolling Website menu?
on Jun 14, 2007 at 5:52:03 pm

Cool! Thanks for the breakdown. If I read it several times slowly, I can follow it! That's a start. One last question.

I'm in 3D space and I know I need to add a third position, the number 2 for the z axis! Do I put it in the same brackets as [0]?

I'm still not sure what each bracket does/protects.

Otherwise, thanks for the education! Chris

Chris Heuer
Freefall FX, LLC


Return to posts index

moldyboot
Re: Faking a Scrolling Website menu?
on Jun 14, 2007 at 6:24:48 pm

yep, 'z' would be position[2], or to use the current value for z, value[2]. so your final part of the expression would look something like this [value[0],y,value[2]]... this would link only the y property to your slider, allowing free positioning of x and z for your page layer.

you would use brackets to define an array, like [x,y,z] or [120,-50,400]. several layer properties are defined by arrays, position, scale and anchor point are common. but there are also many expressions that use multiple variables in an array to derive a value. i've recently started exploring these.

you will also use brackets after a property that would be defined as and array, like position, to specify a particular value of the array. so position[0], would specify the position value of x (first value of the array) of a given layer, scale[1] would specify the vertical (or second) scale value of a given layer.

thus, value[1] would specify the current value for the second array value of that particular property, so value[1] for position would return the y postion of that particular layer.

if you're like me, and have no programming background, expressions have a slow learning curve. look at the help menu or manual for expressions, also the scripting guide on the install disc has more info, but neither give great explanations fro non-programmers. dan ebbert's motionscript.com is a very good resource and where i've learned most of what i know.... he really needs to come out with a book.

Kevin Camp
Designer - KCPQ, KMYQ & KRCW


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]