Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: ForumAE BasicsAE ExpressionsTutorialsArticlesPodcastsMotion GraphicsTrainingCinema 4D

Re: Checkbox Control failing-update

Cow Forums : Adobe After Effects Expressions
VIEW POSTS   •   ADD A NEW POST   •   SEARCH   •   CHANGE FORUM
Respond to this post   •   Return to posts index   •   Read entire thread


Re: Checkbox Control failing-update
by Filip Vandueren on Feb 2, 2008 at 5:14:54 pm

I've tested and can confirm:

say you add this to the sourceText of a textlayer:

comp("Comp 2").layer("Null 1").effect("Checkbox Control")("Checkbox")

you get 1 or 0 depending on the checked state because javascript is correctly 'casting' the checkbox-object into a string containing it's value. (the sourcetext expects a string)

BUT !


if (comp("Comp 2").layer("Null 1").effect("Checkbox Control")("Checkbox")) {
1
} else {
0
}

always returns 1.
The checkbox-object is cast to a logical value ("if" expects a true or false).
In this case: true: the checkbox object exists.



These WILL all work as expected however:

if (comp("Comp 2").layer("Null 1").effect("Checkbox Control")("Checkbox").value)

if (comp("Comp 2").layer("Null 1").effect("Checkbox Control")("Checkbox")==1)

if (comp("Comp 2").layer("Null 1").effect("Checkbox Control")("Checkbox")==true)

the last one is puzzling though: we don't explicitly ask for the "value" of the object, so javascript again casts it to a logical value true/false, and it does work in this case...

So I do consider this a bug.



Respond to this post   •   Return to posts index   •   Read entire thread


Current Message Thread:




Note: If you are a registered user please click here to login before posting.

Your post will not be accepted if your name and email address are not registered in our database. Click here if you do not have an account.

Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message   Entire Thread   None  

Message:

Add Bold Tag To Message (JavaScript required)

To put any item inside this tag:

1. Highlight the desired text
2.Click this buttonAdd Italic Tag To Message (JavaScript required)

To put any item inside this tag:

1. Highlight the desired text
2.Click this buttonAdd Underline Tag To Message (JavaScript required)

To put any item inside this tag:

1. Highlight the desired text
2.Click this buttonAdd Image Link Tag To Message (JavaScript required)

To put any item inside this tag:

1. Highlight the desired text
2.Click this buttonAdd URL Link Tag To Message (JavaScript required)

To put any item inside this tag:

1. Highlight the desired text
2.Click this button

Note: The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key. Read more...



Please post Expressions Code in the box below:


Add your message signature


 


Note: By clicking "Post Direct" button above, you are agreeing to the Creative Cow's Code of Conduct.



FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]