Friday, July 28, 2006

Lesson 2: Arrays and Variables

Previously, we covered how to use some basic expressions using opacity. Opacity has a single value, as it is defined as a one number from 0 to 100. But not all parameters are that simple.

For instance, consider position. This could have 2 or even 3 values... X Y & Z.

So, when I mentioned how we could simply put an expression that said "5" for opacity to make the opacity a value of 5, that was easy enough. But, the parameters that have multiple values make things trickier.

First off, let's learn the lingo. A parameter that has more than one value is called an "array".

First off, check out this AWESOME picture I drew. Yeah, it's pretty much the best drawing I ever made.

Think of an array like one big train. Instead of hauling freight and hobos, it is hauling numbers. Each compartment is separate, but in a distinct order. In the case of 3D position, we have XYZ as the values you might want to call 1 , 2 , & 3. We'll learn later on that AE logically refers to values 1 2 & 3 as 0, 1 & 2.

So, the easy example that we had with opacity gets trickier here. There's a fairly specific way we need to define arrays in expressions, and that goes a little something like this:

[ x , y , z ]

So, to define simple numbers for these values, the following expression shows you how to place an obect at 100, 200, 300 in 3D space:

[ 100, 200, 300]

The brackets are absolutely necessary and AE will return an error if you don't put them there. Spaces are mostly ignored, however. I use a lot of here to make things easier to read.

Now, for a few new concepts:

First, the "variable". A variable is simply an 'unknown value' that we want to calculate or assign a value to. Look at the following example.

x = 100 y = 200 z = 300 [ x , y , z ]

This has exactly the same result as the first expression: [ 100, 200, 300]. We are just presenting it in a different way. Variable are often handy just like we use pronouns. I could say Rufus Xavier Sarsasparilla.. or I could say "he" once I establish who "he" is.

In exactly the same way, I can declare a variable to be a number, or calculation or any number of things and refer to "x" rather than using the calculation every time. This makes the code shorter, less cluttered looking, and faster for AE to go through.

Variable names can be any set of characters that AE does not use as a specific function. For instance, we cannot use the word 'time' as a variable. But we could use myTime, or hammerTime, or millerTime. When using multiple variables in a project, it is useful to use variable that make sense, like "posX" or "startTime". You'll come up with your own style, but just know that variables can be "x" or "x1" or "xFactor" or "myReallyLongVariableName". It's up to you.. they do not have to be "x" or "y" or "z".

One more term to learn today: index.

index is equal to the actual number of the current layer. So, depending on what layer your expression is on, the value of index will vary. If you are in layer 1, index will be equal to "1", in layer 2 index will be equal to the number 2.

So, how do we use this? Here's a great example.

Create a solid that is 50x50 and make it a 3d layer.

On the position of the solid we just created, place this expression:

z = index * 20; [320 , 240 , z ]

We are setting the variable "z" to be equal to the index of the layer times 20. Notice the semicolon at the end. ANY time we are using a calculation with a variable, we MUST put a semicolon at the end, otherwise you will get an error.

The next line:

[ 320 , 240 , z ]

...positions the solid at 320 in the X and 240 in the Y. But, it's Z position is now dependent on the layer number. Try selecting the solid, and hitting "duplicate" several times (command/control-D). You'll see that each copy positions itself in a different spot in z space.

That wraps it up for now. Next time we'll explore how to leave the X , Y and Z values adjustable in this example, while still having the layers spaced in Z.


Blogger pablo said...

I've got a little late here, as I can see by the post date. But is so useful!! I am reading everything since the first lesson. Eager to see it until the end.

thanks a lot! great initiative.

5:51 AM  
Blogger Daniel said...

This comment has been removed by a blog administrator.

9:46 PM  
Blogger Kyle said...

Poor Daniel. I guess he can't read. How sad for him.

2:56 PM  
Blogger MaxofMO said...

Rufus Xavier Sassparilla!! You gotta love a guy who uses a School House Rock reference.

5:15 AM  
Blogger miss zelka said...

hey your awesome train drawing is missing ;)

can you please relink??

5:33 PM  
Blogger John said...

image not disponible (error)

8:26 AM  
Blogger Ruthie said...

Hey, I know this is an old blog, and I know the stuff you're posting is baby stuff for people who are trying to program in After Effects, but I just wanted to say thanks. I go to an art school for animation and for some reason they don't believe in teaching us useful things like learning how to use programs. Oh well! Thanks for this, it's written very clearly and has helped me a lot.

8:14 PM  
Blogger Alom said...

Quick question: do effects in the layer effects panel have index values? If so, how can i get this value and then use it?

11:15 AM  
Blogger Anthony Fedor said...

From your post I could understand that you have well idea. You have to try to add more creativeness in your post. It will soon attract any reader. There are some different types of writing technique such as style, design, format.If you include all these styles you can make your blog more attractively.
Visit : Best thesis writing service .

2:37 AM  
Blogger William Gomez said...

download this app on an Android phone: Official vidmateapp

2:22 AM  
Blogger Maryum Ayub said...

Download best streaming application ShowBox

5:20 AM  
Blogger Sono Adney said...

Install free online Cinema Box Android and see your favourite videos.

6:32 AM  
Blogger Harish Raju said...

This blog explains the details about changing the ways of doing that business. That is understand well and doing some different process. Provides he best output of others. Thanks for this blog.
Web Designing Training in Chennai

12:46 AM  
Blogger Sono Adney said...

enjoy free videos online with Cinema Box Free App

12:10 PM  
Blogger Syed said...

Stickman Football

7:44 AM  
Blogger dipdazzle said...

Vidmate App Latest Version Download:: Vidmate App Download

11:52 PM  
Blogger rahul chauhan said...

Happy Diwali Wishes Finally the much awaited festival Deepavali 2016 has come in this month which known as Diwali festival celebrated by everyone across the INDIA as well other countries Like : Nepal,USA,Cananda etc.

8:41 AM  
Blogger rahul chauhan said...

Thanksgiving day the beautiful and colorful parade of big balloons, charming cheerleaders, jokers, clowns, marching parade, the performance by celebrities is the best event that one could look up to in November 2016.thanksgiving quotes 2016

2:42 AM  
Blogger rahul chauhan said...

Thanksgiving day the beautiful and colorful parade of big balloons, charming cheerleaders, jokers, clowns, marching parade, the performance by celebrities is the best event that one could look up to in November 2016.thanksgiving 2016

9:20 AM  
Blogger Neil Jakson said...

Your blog is so interesting and thought provoking that I could not refrain myself from sharing it with others. Keep it up!
Dissertation writing services

10:57 PM  
Blogger anil kumar said...

Indian Biggest upcoming bahubali part 2 movie

Upcoming blockbuster Fast and Furious 8 Movie updates

Deepika Padukone Oops Moment

9:38 AM  
Blogger uday singh said...

This article was unique and interesting as it was very well described.Thanks for the information.

11:04 PM  
Blogger cm punk said...

Great post containing some tricky information about Opacity.thanks for sharing with us.

10:49 PM  
Blogger uday singh said...

awesome has explained us about different ways to do successful business.thanks for sharing.its really helpful.

7:06 PM  
Blogger Vijay Sinha said...

Amazing!!! I liked this blog so much it's really awesome I liked your creativity your way. I have also gone through your other posts too and they are also very much appreciate able and I have got some sweet comments for them also now I'm just waiting for your next update to come as I like all your other posts... well I have also made a video of my art hope you go through it on my channel your feedback is important subscribe if you like. holi , happy holi , Bollywood 2017 , . hot deepika padukone

2:35 AM  
Blogger Albert Smith said...

The information on the micro milling tool techniques have been an important source of reference while I was writing my machining workshop report and I am very grateful to have landed on this website. I am looking forward to reading more interesting and educational articles from this blog. Check out our professional writing services by clicking on Qualified Analysts.

6:53 AM  
Blogger Congtinh9x.tnjfjd Nguyen said...

The VidMate app for samsung allows you to stream and download videos from a variety of sources, such as YouTube, Dailymotion, Vimeo, and Yodesi.

9:56 PM  
Blogger anil kumar said...

Salman Khan Upcoming Biggest Blockbuster Movie Tiger Zinda Hai On this EID Tiger Zinda Hai

10:27 AM  
Blogger Aurora said...

This post gives intense detailing of array and variables. You have presented this idea in a good manner. Thank you so much...Admission essay writing service

11:12 PM  
Blogger bill mogan said...

tubemate for android 4.2 2 - is a free downloader for youtube videos

7:55 PM  
Blogger Roxy Chan said...

Vidmate App is very easy to use. Start Downloading now.

8:32 AM  
Blogger Handsome Boy said...

As with every other written piece, there are ways to secure that your blog post is of premium quality. Since writing compelling, high quality content is the only way to have a go at a blog salary, you must be very particular about such detail. You should keep it in mind whenever you are starting to make a post.
buy a research paper for college

3:10 AM  
Blogger William Smith said...


Nice to read this out.

12:28 AM  
Blogger Shreya Reddy said...

vidmate for pc
vidmate for blacberry
Download Vidmate
vidmate for ios
vidmate for iphone
showbox for pc
showbox for pc free download
showbox pc
showbox for laptop

12:05 AM  
Blogger laisa syahira said...

Whatsapp 2016 Version Download
Whatsapp 2016 Free Download
Whatsapp 2016 Latest Version
Whatsapp 2016 iPhone
whatsapp 2018 apk
whatsapp 2018 apk download

9:18 AM  
Blogger jonartha petra said...

VidMate 2018 APK Android Latest Version
Vidmate App Download Audio And Video Of The Best Platforms
Download Vidmate 2018 for Windows 10, 8.1 and Windows Phone
VidMate APK Download Old Versions

5:21 AM  
Blogger movies film said...

Hi, nice article. I have been pondering concerning this matter, so thanks for sharing.

4:47 AM  
Blogger Mahaveer said...

cinema box review

10:07 PM  
Blogger Mahaveer said...

mini militia

10:20 PM  
Blogger Mahaveer said...

aptoide for iphone

10:34 PM  
Blogger Mahaveer said...

playview apk

10:42 PM  
Blogger Mahaveer said...

game guardian apk download no root

10:47 PM  
Blogger Mahaveer said...

GameGuardian 8.51.0 for Android

10:54 PM  
Blogger laisa syahira said...

Samsung is specifically created for the Android customer as well as can be utilized on Samsung as well as various other gadgets that sustain a particular os. Download VitMate for Samsung is really glossy to utilize. Given that its creation, Vidmate job best on Android with display resolution and all various other features fit perfectly to the individual tool.

6:38 AM  
Blogger wilson kety said...

VidMate is the best apps download

3:22 AM  
Blogger AbhiS Sharma said...

nice post....UkTVNow Kodi 2018

5:12 AM  
Blogger AbhiS Sharma said...

nice post...fildo

5:23 AM  
Blogger AbhiS Sharma said...

NICE POST....teatv for windows

9:21 AM  
Blogger CIIT Noida said...

Thanks for posting the useful information to my vision. This is excellent information.

Best BCA College in Noida

12:25 AM  
Blogger Attiqa Shad said...

Smart Phones and Tablets can be used to process sales. The card reader can plug in to the headset jack of the device or use Bluetooth. Your device must have an Internet connection to function. Mobile Payments

3:50 AM  
Blogger denger bhai said...

lucky patcher apk

5:14 AM  
Blogger denger bhai said...

lucky patcher apk

5:15 AM  
Blogger denger bhai said...

lucky patcher apk

5:25 AM  
Blogger lichisu kumar said...

lucky patcher apk

8:53 AM  
Blogger Chhathu Sha said...

Lucky Patcher
whatsapp plus

king root

8:59 AM  
Blogger Sathis Kumar said...

Mx Player for pc
Download Mx Player for pc
Mx Player for blackberry
Mx Player for ios
Mx Player apk Download
Mx Player for wp
Mx Player for pc download
Mx Player pro apk download
mx player codec
mx player codec armv7 neon
MX Player for Chromecast

3:54 AM  
Blogger HD Records said...

Nice blog, freeflix hq


9:51 AM  
Blogger wilson kety said...

whatsapp 2018 is intending to incorporate WhatsApp Settlements include in the upcoming variations. Download the most recent version of WhatsApp APK from the web link supplied listed below. We frequently watch on the secure in addition to the beta variation of WhatsApp and also upgrade this post to the most up to date version.

9:24 AM  
Blogger King User said...

TeaTv Apk
videoder apk

3:36 AM  
Blogger shalinipriya said...

I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
Data Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar

12:18 AM  
Blogger nivatha said...

Great Article… I love to read your articles because your writing style is too good, it is very very helpful for all of us and I never get bored while reading your article because they are becomes a more and more interesting from the starting lines until the end.
Devops training in Chennai
Devops training in Bangalore
Devops Online training
Devops training in Pune

2:33 AM  
Blogger support said...

hp printer tech support
hp printer technical support phone number
hp technical support
hp printer tech support number
hp printer technical support number
hp printers tech support
hp customer service
hp printer customer service
hp printer technical support phone number south dakota

hp printer technical support number

1:40 AM  
Blogger simbu said...

I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you article.
java training in chennai | java training in bangalore

java online training | java training in pune

selenium training in chennai

selenium training in bangalore

11:57 PM  
Blogger genga g said...

This comment has been removed by the author.

11:46 PM  
Blogger Top Images Wishes Quotes said...

Thanks for sharing this post, it was great reading this article! would like to know more! keep in touch and stay connected! Also Check here

gb whatsapp

gbwhatsapp download

Mini Militia

Best Apk Mods

Best Smm Panel

Indian Smm Panel

2:19 PM  
Blogger sweety ganga said...

All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.

angularjs-Training in velachery

angularjs-Training in annanagar

angularjs Training in chennai

angularjs Training in chennai

10:43 PM  
Blogger Unknown said...

myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance

10:33 PM  
Blogger mabris said...

Thanks for sharing this post, excellent


11:03 AM  
Blogger Unknown said...

Latest Gangstar vegas mod Apk

5:21 AM  
Blogger Unknown said...

we are offering DevOps Training in Bangalore,Chennai, Pune using Class Room. myTectra offers Live Online DevOps Training Globally

2:25 AM  
Blogger Unknown said...

myTectra a global learning solutions company helps transform people and organization to gain real, lasting benefits.Join Today.Ready to Unlock your Learning Potential !Read More...

5:15 AM  
Blogger amala jst said...

A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.

rpa training in electronic-city | rpa training in btm | rpa training in marathahalli | rpa training in pune

4:55 AM  
Blogger Harsha Vardan said...

Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging.
DevOps course in Marathahalli Bangalore | Python course in Marathahalli Bangalore | Power Bi course in Marathahalli Bangalore

4:36 AM  
Blogger Revathy A said...

It is better to engaged ourselves in activities we like. I liked the post. Thanks for sharing.

angularjs online Training

angularjs Training in marathahalli

angularjs interview questions and answers

angularjs Training in bangalore

angularjs Training in bangalore

angularjs Training in chennai

automation anywhere online Training

5:01 AM  
Blogger Rayanaly said...

here you can get the free premium apps in free thorugh download Lucky Patcher latest version worldfree4u.

11:27 AM  
Blogger Sanjay Burman said...

great article. its very knowledgeable.
digital marketing training in bhopal
digital marketing training in bhopal
SEO training in bhopal
PHP training in bhopal
PHP training in bhopal

1:38 AM  
Blogger Liyakhat ali Leku said...

UC mini apk
Tubemate apk
MX player apk
Videoder apk
My jio Apk

11:35 PM  
Blogger Amar G said...

Selenium is one of the most popular automated testing tool used to automate various types of applications. Selenium is a package of several testing tools designed in a way for to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms and for the same reason, it is referred to as a Suite.

Selenium Interview Questions and Answers
Javascript Interview Questions
Human Resource (HR) Interview Questions

3:49 AM  
Blogger Unknown said...

WOW, this guide truly helped me out! Thanks a lot. Download clone hero game from: clone hero download

4:52 AM  
Blogger sachin.ogeninfo said...

lg fridge repair in gurgaon

4:13 AM  
Blogger Jenny merged said...

Best Cheapest 3D Printers 2018 – Priced Under $200/300/500/1000. Flashforge Finder. Wanhao Duplicator D7. Best Cheap 3D Printer Priced Under $1000. Prusa i3 MK3. Dagoma Neva Magis. longevity

5:15 AM  
Blogger HAMZA said...

Thanks for sharing this post, it was great reading this article! would like to know more! keep in touch and stay connected! Also Check here


Download Cinemabox App for Free

Download Cinemabox APK

cinema box apk on android

Cinemabox apk Latest Version Download

Cinemabox apk latest version

Cinemabox APK Download free

3:40 AM  
Blogger Ranvijay Singh said...

nice post. Digital Marketing Training in Bhopal

9:57 AM  
Blogger Anjali Siva said...

Excellent and useful blog admin, I would like to read more about this topic.
Blue Prism Training in Chennai
Blue Prism Training near me
Blue Prism Training Chennai
Blue Prism Training in Velachery
RPA Training in Chennai
Angularjs Training in Chennai
DevOps Certification Chennai

1:58 AM  
Blogger HAMZA said...

Really i found this article more informative, thanks for sharing this article! Also Check here


Cinemabox on iOS download

Download Cinemabox HD For PCGreeting

8:19 AM  
Blogger Anbarasan14 said...

Thanks for your contribution in sharing such a useful information. Waiting for your further updates.

Best Spoken English Classes in Coimbatore
Spoken English Course in Coimbatore
Spoken English Coaching in Coimbatore
Spoken English Class in Coimbatore
Spoken English Coimbatore
Best Spoken English Class in Coimbatore
Spoken English Training near me

9:59 PM  
Blogger kaushik said...

Thanks for sharing this valuable information.Its more useful to us.its very interesting to know the blog with clear vision.
best php training in bangalore
php training center in bangalore
Best Web Development Training Institute in Bangalore
Web Design And Development Courses in Bangalore

3:25 AM  
Blogger asha said...

I got a lot of information
devops course in bangalore

best devops training in bangalore

Devops certification training in bangalore

devops training in bangalore

devops training institute in bangalore

9:30 PM  
Blogger mounika said...

Nice post..

salesforce training in btm

salesforce admin training in btm

salesforce developer training in btm

2:38 AM  
Blogger Microsoft office said...

Purchase lower-priced prescription drugs from our online pharmacy – and enjoy the convenience of better service and peace of mind when ordering from our secure online shopping system.
Save upto 80% on popular medicines.

online medicine

order online medicine

med at door step

buy online medicine

10:50 PM  
Blogger uma said...

nice blog..keep on sharing..

devops course in bangalore

best devops training in bangalore

Devops certification training in bangalore

devops training in bangalore

devops training institute in bangalore

10:48 PM  
Blogger chandana said...

Awesome blog.
best android training center in Marathahalli

best android development institute in Marathahalli

android training institutes in Marathahalli

ios training in Marathahalli

android training in Marathahalli

mobile app development training in Marathahalli

10:52 PM  
Blogger Ranvijay Singh said...

This comment has been removed by the author.

7:12 AM  
Blogger Vicky Ram said...

Nice blog..! I really loved reading through this article. Thanks for sharing such a amazing post with us and
keep blogging...


9:39 PM  
Blogger dwarakesh said...

Greetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.

Advanced AWS Online Training | Advanced Online AWS Certification Course - Gangboard
Best AWS Training in Chennai | Amazon Web Services Training Institute in Chennai Velachery, Tambaram, OMR
Advanced AWS Training in Bangalore |Best AWS Training Institute in Bangalore BTMLA ,Marathahalli

2:17 AM  
Blogger Anjali Siva said...

Useful blog, This is what I have looked for. Share more like this.
DevOps course in Chennai
Best DevOps Training in Chennai
DevOps Training in Anna Nagar
DevOps Training in T Nagar
Amazon web services Training in Chennai
AWS Certification in Chennai
Data Analytics Courses in Chennai
Big Data Analytics Courses in Chennai

2:34 AM  
Blogger Namra Quadri said...

Download lucky patcher original apk
Download FM WhatsApp
Pubg Names

11:20 PM  
Blogger kevin antony said...

Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
rpa training in bangalore
best rpa training in bangalore
rpa training in pune | rpa course in bangalore
rpa training in chennai

2:16 AM  
Blogger manisha said...

Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision. 
Best Devops Training in pune
Microsoft azure training in Bangalore
Power bi training in Chennai

2:32 AM  
Blogger Durai Raj said...

The data which you have shared is very much useful to us... thanks for it!!!
big data courses in bangalore
hadoop training institutes in bangalore
Hadoop Training in Bangalore
Data Science Courses in Bangalore
CCNA Course in Madurai
Digital Marketing Training in Coimbatore
Digital Marketing Course in Coimbatore

3:06 AM  
Blogger Aliya Manasa said...

Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
python training in chennai
python course in chennai
python training in bangalore

3:30 AM  
Blogger tanya angel said...


2:20 AM  
Blogger Sameer Shahni said...

Want to get ranked your business on the top? Contact Shahni Digital Media, one of the fastest growing Digital Marketing Company in India. We provide web development solution, orm, ppc, smm, sem etc.
Digital Marketing Company Bhopal
Website Designing Company Bhopal
SEO Company in Bhopal
ORM Company India

9:20 PM  
Blogger manisha said...

Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision. 
iWatch service center chennai | apple ipad service center in chennai | apple iphone service center in chennai

5:03 AM  
Blogger manisha said...

A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.
apple service center chennai | iphone repair chennai | apple iphone service center in chennai | iphone service chennai

5:04 AM  
Blogger just videos said...

Amazing blog, thanks for sharing the information and the article is nice to share everyone.
Best Video Production & Promotion House in Kolkata, India

3:24 AM  
Blogger jefrin adams said...

Great post thanks for sharing
power BI training institute in chennai

3:49 AM  

Post a Comment

<< Home