Hi all..

No one had any Ideas on this one ?

This may shed some light .. an example is a billion gazillion words
Take a look at ..
http://users.bigpond.net.au/buckland/dev/example/dragndrop.html

As this is what I am trying to do .. I need to drag the Yellow layer from
the thin Grey one to the large grey one and then have the dragboundary set
as the
large grey one (via it being the parent)

ideas ??

- ramon

----- Original Message -----
From: R & S Buckland
To: [EMAIL PROTECTED]
Sent: Monday, December 03, 2001 11:42 PM
Subject: [Dynapi-Help] Changing a layers parent.


Hi peoples...

I have a task where I need to change the parent of a layer

I have four layers

Layer BASE
Layer A
Layer B
Layer X

Layer BASE is child of DynAPI.document
Layer A and B are children of BASE

Layer A has a child, layer X
Layer X is draggable

Layer B has no children

On dragstart, I want to make Layer X a child of BASE (so it can 'move'
freely in BAE and seemlessly to LayerB across the way.

and the if the Layer X is dropped onto Layer B..
make it s a child of Layer B.


As soon as I removeChild(layerX) from layerA ..
the child disappears .. the next line is always to
layerBASE.addChild(layerX)
in this example addChild implicityly removes' the child
from it's parents (tried many things .. this is just one of them)

but it never comes back ...
Here is some sample code...


 myListener=new EventListener(this)

 myListener.ondragstart=function(e) {
  layerX=e.getTarget()
  layerBASE.addChild(layerX);
 }

 myListener.ondragend=function(e) {
  layerX=e.getTarget()
  layerB.addChild(layerX);  // addChild implicitly calls
                            // removeChild on the
                            // obj anyway (see dynapi.js)
  }

 }

 layerX.addEventListener(myListener)

Has anybody done this before ? got a working example ? My ultimate goal is
to
change the parent of a given layer.and not have the layer disappear.

- ramon


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

Reply via email to