Here you go, its ugly but it is doning something similar to your
description.

var imgClear =
dynapi.functions.getImage("http://www.keyout.com/keyout/lib/js/dynapi3x/src/
fx/zoomMX/images/cover.gif",300,300);
var lyrMaster = new
DynLayer(imgClear.getHTML({name:'clear_image'}),400,400,300,300,'e0e0e0');//
needs a clear image
var lyrShowAndHide = new DynLayer(null,0,0,300,300,'red');
lyrShowAndHide.setVisible(false); //Hide for now.
lyrMaster.addChild(lyrShowAndHide);
var HandlMouseEvnts = {
        onmouseover : function(e){ e.getSource().setCursor('hand');
lyrShowAndHide.setHTML("x = :"+e.x+" y = :"+e.y);},
        onmousemove : function(e){ e.getSource().setCursor('hand');
lyrShowAndHide.setHTML("x = :"+e.x+" y = :"+e.y);},
        onmouseout : function(e){
e.getSource().setCursor('default');lyrShowAndHide.setVisible(false); },
        onclick : function(e) {lyrShowAndHide.setVisible(true);
lyrShowAndHide.setHTML("You Clicked: x = :"+e.x+" y = :"+e.y);},
        onmouseup : function(e) {lyrShowAndHide.setVisible(false);}
};

lyrMaster.addEventListener(HandlMouseEvnts);
dynapi.document.addChild(lyrMaster);

Brian Hayes



 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Yanglong Zhu
Sent: Saturday, September 27, 2003 7:57 PM
To: [EMAIL PROTECTED]
Subject: [Dynapi-Help] How to add eventListener to a DynLayer?

Hi everyone,

I'm new here.
I just started trying DynAPI out. I have had some successes. But I have lots
of questions as well. So far, I can combine my own code with DynLayer to
generate interactive editing features in Mozilla , however IE is very
stubbon to be reigned in. My question is: How do you add
eventListener() to a element generated in DynLayer()?

var lyrmaster  = dynapi.document.addChild(new DynLayer('<img
src="./insertion_embed.png">',50,150,'auto','auto','silver'));
var lyr1 = lyrmaster.addChild(new DynLayer('<div id="target" 
onmouseover="lyr2.set.Visible(true);return false;">I want this div to
respond to clicking, and pop up lyr3</div> ', 50, 50, 200, 100, 'red')); var
lyr2 = ...
var lyr3 = ...

The key part I am trying to get working is how to add an eventListener to
the element id="target", and pops up lyr3.  I use my own code can make it
work in Mozilla. However it does not work in IE. Besides I believe DynAPI
must have a nicer way to do this in IE and Mozilla than what I have come up
with.

Thanks.

Yanglong




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to