Title: (setHTML vs setBgImage) and (keyevents not being captured)
Hi,
My idea:
SetBgImage is ok only for static images, with animation it causes all kinds of problems.
Definitely avoid using 324 layers.
Maybe use one large layer, add all images like this
myLayer.setHTML('</img name="image1" src="../php/images/round2.gif">'
            +'</img name="image2" src="../php/images/round2.gif">'
            +'</img name="image3" src="../php/images/round2.gif"><br>') etc
 
Change the image properties like this:
    myLayer.doc.images['image1'].src="../php/images/transparent.gif"
 
If they need mouse events, add them to the dynlayer, and check if the mouse is over the image by getting the mouse coordinates.
 
I have examples of these ideas here:
 
Richard_Examples
        Image_Rollover.html
        Imgtest_Rollover_Button.html
        Get_Properties_Of_Image.html       
 
Cheers,
Richard Bennett
 
[EMAIL PROTECTED]
www.richardinfo.com
(Everything running on, and ported to the 19/12/2000 snapshot of DynAPI2)
Find the DynAPI faq here:
http://sourceforge.net/docman/display_doc.php?docid=656&group_id=5757
Browse the mailinglist here:
http://www.mail-archive.com/index.php3?hunt=dynapi


----- Original Message -----
Sent: Tuesday, February 27, 2001 7:41 PM
Subject: [Dynapi-Help] (setHTML vs setBgImage) and (keyevents not being captured)

Hello, I was working with some layers and images last night and came to the discovery that setHTML is very slow compared to setBgImage, and I was wondering, if in light of this, anyone know a method faster then setBgImage of assigning an image to a layer. At this point setBgImage seems my best bet but I will be dealing with a 9x9x4 grid of layers (324 layers), so anything faster would be great.

Also I have the following code:
}
DynAPI. {
        myListener = new EventListener(DynAPI.document)
                myListener. {
                onKeyPress()
                }
        DynAPI.document.addEventListener(myListener)
}
function onKeyPress () {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 38){myLayerPlayer.moveTo(myLayerPlayer.x, myLayerPlayer.y - 32)}
if (keycode == 40){myLayerPlayer.moveTo(myLayerPlayer.x, myLayerPlayer.y + 32)}
if (keycode == 39){myLayerPlayer.moveTo(myLayerPlayer.x + 32, myLayerPlayer.y)}
if (keycode == 37){myLayerPlayer.moveTo(myLayerPlayer.x - 32, myLayerPlayer.y)}
return true
}

and this works great unless the person clicks on a layer or image on the page, when this happens it no longer captures key events. I was hoping someone could slap me around a bit and show me what it is that I am doing wrong...

Thank you for your time,
        Terry



***********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. This footnote also confirms that this email
message has been swept for the presence of computer viruses.
***********************************************************************

Reply via email to