I continuing on from Richard, if N is the value of the highest layer,
then i=<n is ok.
The problem is due to 'n' having no value in your function. To do this,
you must use the Function constructor and do the following:
listner.onmouseover=Function("e", "XLayer[" + n + "].setVisible(true)");
The first parameter(s) define the variables that the function will
accept. The last one is the code to be run by the function.
denmaco wrote:
> Hi all, how can I do it ?
>
> working example:
>
> Layer[i] - define as dynlayer's Array
> XLayer[i] - other Array
>
> listner = new EventListener(Layer[0]);
> listner.onmouseover=function(e) {XLayer[0].setVisible(true)};
> Layer[0].addEventListener(listner);
> ..
> ..
> ..
> ..
> ..
> listner = new EventListener(Layer[n]);
> listner.onmouseover=function(e) {XLayer[n].setVisible(true)};
> Layer[n].addEventListener(listner);
>
> It's working when it's hand-made for all n-Layers.
>
> I tray to automate this process:
>
> for (var i=0; i<=n; i++) {
> listner = new EventListener(Layer[i]);
> listner.onmouseover=function(e) {XLayer[i].setVisible(true)};
> Layer[i].addEventListener(listner)};
>
> and here is problem: in this situation XLayer is empty or not object.
>
> Why ? And what I need to do ?
>
> Thanks,
> peter lesnik
--
Michael Pemberton
[EMAIL PROTECTED]
ICQ: 12107010
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help