Now if I set my opacity at 95 initially (by myself) it will do the first 'if' statement PERFECTLY and then completely overlook the second. I notice that with this code, it doesn't look at the changes it made to the Opacity at all. Is there a way to DIRECTLY modify it and access it even after the changes?
For example, if I right click and choose 'edit value' under opacity. It still says 95% even though the code already changed it to 25%
In short, I want a way to directly modify the opacity using code and accessing it.
Re: Something weird with Expression code? by Walter Soyka on Jun 5, 2012 at 3:00:30 pm
You cannot programmatically assign a value to a property in an expression as you are trying to do with the line "opacity = 25;". Expressions are evaluated every frame, and they return a value to the property in which the expression is built.
In other words, the property gets the final result of the expression.
Your code above only works because the assignation "opacity = 25" evaluates to 25; this value is then returned to the property with the expression applied. You could drop the "opacity =" and just make that line the constant "25" and you'd get the same results.
To achieve your goal here, you would have to store the "25" value assignment in the first conditional in a variable, then check both your new variable and the original opacity value in the second conditional. Finally, you'd have to return the variable.
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events