Masks and Layer Controlls

Moderators: Disciple, zlovatt

Post Reply
explorer
Posts: 17
Joined: March 1st, 2007, 11:12 pm
Location: Poland, Warsaw

hi everyone

1)
i was wondering if its possible to control mask pins with expressions.
as far as i know (or as far i was able to figure out) it is not possible. or is it?

2)
we all use expressions and expression controls, like sliders, checkboxes and so on. my question is: does anyone know how to set an error trap when in Layer Control you select None as a layer?

it seems that i cannot even check if a selected layer is set to None, because when I try to do it i get en error message, that "layer is set to None - cannot continue".

any ideas how to check if the layer in Layer Control is selected or not?

thanks in advance
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

Javascript does support try and catch. I have only used that in jsx, however, not experssions. But it may be worth a try.

Code: Select all

try
{
//Access your layer code goes here
}
catch (error)
{
//If an error is thrown.
alert (error.description)
}
http://www.w3schools.com/js/js_try_catch.asp
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

explorer wrote: 1)
i was wondering if its possible to control mask pins with expressions.
as far as i know (or as far i was able to figure out) it is not possible. or is it?
Not possible. Requires plugins, but both toolsets are no longer available.
explorer wrote: 2)
we all use expressions and expression controls, like sliders, checkboxes and so on. my question is: does anyone know how to set an error trap when in Layer Control you select None as a layer?
You can try Atomic's approach, but it's a bit ineffective. It would be simpler to have a dummy layer that is used as an automated reference when nothing else is selected. Also since expressions throw errors anyways, you r custom code might not show up if it#s overruled by a higher-priority problem.

Mylenium
[Pour Mylène, ange sur terre]
explorer
Posts: 17
Joined: March 1st, 2007, 11:12 pm
Location: Poland, Warsaw

thanks.
i did not expect try/catch to work, but it did the job nicely.
thanks again.
User avatar
valoos
Posts: 5
Joined: February 24th, 2006, 12:05 pm
Location: Poznan POLAND

try and catch works correctly ... 8)
thx Atomic
Post Reply