I am new to DynApi. I want to put a border on a gif file once the gif is 
clicked. For that I am having two images in two different layers and making 
either one of them visible based on the Click. (Is there any other better way)

In the onclick function how can I get the handle of the layer and make that 
layer invisible and make the other layer (with image having border) 
visible. This is the code snippet.

DynAPI.onLoad = function() {

        var comp0 = new DynLayer();
        comp0.setHTML('<img name="img0" src="xxxx.gif" border=0>');
        var comp0border = new DynLayer();
        comp0border.setHTML('<img name="imgborder0" src="xxxx.gif" border=2>');
        comp0border.setVisible(false);


        DynAPI.document.addChild(comp0);
        DynAPI.document.addChild(comp0border);


        mySelectListener=new EventListener(DynAPI.document)
                mySelectListener.onclick=function(e) {
                        target=e.getTarget();
                        target.setVisible(false);  // This fails.
                        //comp0.setVisible(false);
                        //comp0border.setVisible(true);
                        alert("mouse clicked"+target.id);
                }

        comp0.addEventListener(mySelectListener);
        myDeSelectListener=new EventListener(DynAPI.document)
                myDeSelectListener.onclick=function(e) {
                        target=e.getTarget();
                        comp0border.setVisible(false);
                        comp0.setVisible(true);
                        alert("mouse clicked"+target);
                }

        comp0border.addEventListener(myDeSelectListener);



} 


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

Reply via email to