i think the problem here is how you define the onclick action.
when it is executed, nombre is maybe not set, because it was a local variable
i didnt test this, but i would do:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
|
<action name="creafoto_ventana" scope="local" args="nombre,fichero">
addlayer(get(nombre));
copy(layer[get(nombre)].url, fichero);
set(layer[get(nombre)].align, center);
set(layer[get(nombre)].onclick,
debug(nombre);
set(layer[get(nombre)].visible,false);
);
</action>
|
with this you''ll see if nombre is correctly set there...
if not, you must construct a non dependent onclick action:
set(layer[get(nombre)].onclick, calc('set(layer[' + nombre + '].visible,false);');
ofcourse piotr is right, using name lets you avoid that hoop,
because you set the name to nombre with addlayer(), so
in the onclick event they are always the same.