|
From: Bob J. <bob...@gr...> - 2005-08-10 16:21:40
|
I've been banging my head against the wall trying to get this to work, and =
no luck so far. I have a child layer, in which I want to be able to click a=
nd get the x and y values of where I clicked -- so far, it's getting the x =
and y value relative to the page, not the layer. I'm using 3.0. What am I d=
oing wrong? (This is being used in PHP, so you may see some variables that =
are coming from that)
var photo =3D dynapi.document.addChild(new DynLayer(null,0,0,600,400));
var bg1 =3D photo.addChild(new DynLayer(null,0,0,600,400));
bg1.setHTML('<img src=3D"$url" border=3D"1" width=3D"600" height=3D"400">');
bg1.setInnerBorder(0,{top:'black',right:'black',bottom:'black',left:'black'=
});
bg1.setZIndex(2);
bg1.addEventListener({
onclick:function(e){
var x =3D e.getX();
debugtext.setHTML('<span class=3D"text_11">' + x + '</span>');
lyr1.setX(x);
lyr1.setY(e.getY());
document.editcamera.valueX.value =3D lyr1.getX();
document.editcamera.valueY.value =3D lyr1.getY();
}
});
var lyr1 =3D photo.addChild(new DynLayer(null,$x,$y,10,10,'red'));
lyr1.setZIndex(3);
DragEvent.enableDragEvents(lyr1);
DragEvent.setDragBoundary(lyr1, {left:0, right:0, top:0, bottom:0});
lyr1.addEventListener({
ondragend:function(e){
var o=3De.getSource();
o.setZIndex(3);
document.editcamera.valueX.value =3D lyr1.getX();
document.editcamera.valueY.value =3D lyr1.getY();
}
});
I have a relative layer down in the html: dynapi.document.insertChild(photo=
,'relative');
Help, please!
--=20
_______________________________________________
Graffiti.net free e-mail @ www.graffiti.net
Check out our value-added Premium features, such as a 1 GB mailbox for just=
US$9.95 per year!
Powered By Outblaze
|