AE ENHANCERS

Expressions/Scripts/Presets
It is currently Fri Apr 18, 2014 6:48 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Problem with expression controls
PostPosted: Fri Jan 04, 2008 6:02 am 
Offline

Joined: Fri Jun 18, 2004 2:07 am
Posts: 2
Hi!

I'm having a problem using a Slider control. What I'm trying to to is to have a textlayer read portions of another textlayer. Here's my expression on the textlayer:

Code:
i=effect("Slider Control")("Slider");
source=thisComp.layer("Textsource").text.sourceText.substring(0,i);



Let's say I set my slider control to a value of 10, nothing happens... But if I alter the expression to look like this

Code:
i=10;
source=thisComp.layer("Tekstkilde").text.sourceText.substring(0,i);


it works...

What am I missing?

Cheers!

Øyvind Veberg

_________________
Øyvind Veberg
Motion Graphics Designer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 6:32 am 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 695
Location: London, UK
Not sure why you need to add it....but this works:
Code:
i=effect("Slider Control")("Slider").value;


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 6:35 am 
Offline

Joined: Fri Jun 18, 2004 2:07 am
Posts: 2
Thanks! You just saved my day ! :D

_________________
Øyvind Veberg
Motion Graphics Designer


Top
 Profile  
 
 Post subject: Re: Problem with expression controls
PostPosted: Mon Jan 07, 2008 11:50 pm 
Offline

Joined: Wed Jul 20, 2005 12:07 am
Posts: 139
Oyvind wrote:
What am I missing?


The return value from the slider is not rounded automatically which renders your substring defunct. As Paul already pointed out, you need to declare it explicitly as a math value to make JavaScript's automatism's kick in. Expression controls as such are just dumb elements that return a value without declaring what type this value actually is or which class it fits in. In general this is good, but sometimes it works against you. ;-)

Mylenium

_________________
[Pour Mylène, ange sur terre]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group