Or my example was muddy.
check x+100 and y+200
layer1events=new EventListener()
layer1events.ondragmove=function() {
layer2.moveTo(layer1.x+100, layer1.y+200)
}
layer1.addEventListener(layer1events)
Working example:
http://home1.gte.net/glendeas/jesse/dragginganotherlayer.html
glen
----- Original Message -----
From: "Jesse Vitrone" <[EMAIL PROTECTED]>
To: "Glen Deas" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 12, 2003 9:12 PM
Subject: Re: [Dynapi-Help] how far did the layer move?
> Glen & Lars:
> I'm not sure I was quite clear on what I really want to do.
>
> Let's say I have layer1 at x / y = 100 / 200 and layer2 at x / y = 200 /
> 400.
> When layer1 gets moved to 110 / 220, I need to move layer2 to 210 / 420.
>
> Is there an easy way to do this? I don't want to use moveTo, since the
> x / y coords of the two layers aren't the same. I need to find out how
> much layer1 moved in the x / y directions, then pass them to moveBy.
>
> I could always keep track of the "previousX/Y" manually, then see where
> it is after it gets moved, but it seems like this would be a common
> thing that people would need and that I wouldn't have to do it manually.
>
> Thanks for the suggestions though.
>
> Jesse
>
>
> Glen Deas wrote:
>
> >I don't know if this is what you are looking for, but here it comes.
> >
> > COLHevents=new EventListener(COLH)
> > COLHevents.ondragmove=function(e) {
> > COLB.moveTo(COLH.x, COLH.y-1)
> > COL.moveTo(COLH.x, COLH.y)
> > }
> > COLH.addEventListener(COLHevents)
> >
> >An old example using dynapi 2.53 is here: (Warning, adult cartoons)
> >http://home1.gte.net/glendeas/dynapi253/tsusaka/set0.html
> >
> >The code is here:
> >http://home1.gte.net/glendeas/dynapi253/tsusaka/set0.js
> >
> >
> >----- Original Message -----
> >From: "Jesse Vitrone" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Wednesday, February 12, 2003 12:51 PM
> >Subject: [Dynapi-Help] how far did the layer move?
> >
> >
> >
> >
> >>I have a 2 layers, and when one moves, I want the other one to move, so
> >>they move as a group.
> >>Shouldn't be hard to do, but I don't know how to tell how far the first
> >>layer has moved, that way
> >>my move callback can move the other one by the same distance.
> >>
> >>
> >>Is there something that I can look at when I'm in the ondragmove
> >>listener to see how far it's moved?
> >>
> >>Thanks in advance,
> >> Jesse
> >>
> >>
> >>
> >>-------------------------------------------------------
> >>This SF.NET email is sponsored by:
> >>SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> >>http://www.vasoftware.com
> >>_______________________________________________
> >>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
-------------------------------------------------------
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