From: <do...@cr...> - 2005-08-10 17:44:54
|
P.S. You now owe me for half my lunch hour I charge 40$ Canadian per hour, so I'll expect your check or money order for 20$ If you do not comply I will send my crack team of squirrel commandos to ravage your garden and terrorize your cat. :-P Bob Jamison <bob...@gr...> said: > 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 and 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 doing wrong? (This is being used in PHP, so you may see some variables that are coming from that) > > > var photo = dynapi.document.addChild(new DynLayer(null,0,0,600,400)); > > > var bg1 = photo.addChild(new DynLayer(null,0,0,600,400)); > bg1.setHTML('<img src="$url" border="1" width="600" height="400">'); > bg1.setInnerBorder(0,{top:'black',right:'black',bottom:'black',left:'black'}); > bg1.setZIndex(2); > bg1.addEventListener({ > onclick:function(e){ > var x = e.getX(); > debugtext.setHTML('<span class="text_11">' + x + '</span>'); > lyr1.setX(x); > lyr1.setY(e.getY()); > document.editcamera.valueX.value = lyr1.getX(); > document.editcamera.valueY.value = lyr1.getY(); > } > }); > > var lyr1 = 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=e.getSource(); > o.setZIndex(3); > document.editcamera.valueX.value = lyr1.getX(); > document.editcamera.valueY.value = lyr1.getY(); > } > }); > > > I have a relative layer down in the html: dynapi.document.insertChild(photo,'relative'); > > Help, please! > > -- > _______________________________________________ > 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 > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > https://lists.sourceforge.net/lists/listinfo/dynapi-help > -- |