hi,
i use a cycle to create 4 dynlayers and i need to assign them eventListeners
as i create them. is there a problem with this or am i just getting the
syntax wrong ? thanks for your help.

the code:
                for (i=1, j=28; i<=4; i++, j+=20)
                        {
                        eval("cb" +i+ "L=new DynLayer(null," +j+ ",395,20,20,'')");
                        var o = new Object;
                        var o = eval ("cb" +i+ "L");
                        eval("o.setBgImage(cb" +i+ "g.src)");

// this is the part i cant get work straight
                        eval ("cb" +i+ "E = new EventListener(o)")
                                {
                                var Ev = eval ("cb" +i+ "E");
                                        Ev.onmouseover=function(e)
                                        {
                                        alert (i) // RETURNS 5 IN ALL RUNS
                                        eval ("cb" +i+ "L").css.cursor = 'hand';  
//causes "cb5L is undefined"
error message
                                        //o.css.cursor = 'hand';  // only assigns the 
eventlistener to the
layer #4..
                                        }

                                        Ev.onclick=function(e)
                                        {
                                        alert ('cbClick'); //this works fine

                                        }
                                }
                                o.addEventListener(Ev)
                        // cbMouseEvent(i);
                        eval("DynAPI.document.addChild(o)");
                        }


thanks,
:-j irka


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to