Is it possible to control a layer by dragging another layer.

I’m trying to create the pop-up book effect of having a photoshop layer, or object, control another photoshop layer by dragging; i.e. layer, or object 1, is dragged by the user’s finger and this makes another layer or object move.

It needs to look like layer 1 is controlling layer 2 simultaneously, as it’s moved - like in a pop-up book, which is the effect I’m trying to replicate. Layer 2 would have a predetermined x y directional response, but it needs to feel like the user’s finger is in control. [import]uid: 94653 topic_id: 23787 reply_id: 323787[/import]

I’ve been told it can be done with ‘groups’. I’m a newbie, so any insight into what groups are, how they relate to the issue at hand and how to create/manipulate them would be cool beyond words. [import]uid: 94653 topic_id: 23787 reply_id: 95737[/import]

I’m not sure this is what you’re looking for, but just a simple example of dragging the lower box and having the upper box move in the opposite direction.

[lua]–Set screen width, height, center x, and center y.
_W = display.contentWidth
_H = display.contentHeight
_CX = _W * 0.5
_CY = _H * 0.5

–The box to touch
local box1 = display.newRect(0,0,100,100)
box1.x = _CX
box1.y = 500
box1:setFillColor(0,0,255)

–The box to be moved
local box2 = display.newRect(0,0,100,100)
box2:setFillColor(255,0,0)
box2.x = _CX
box2.y = 300
local function box1Touch(event)
local phase = event.phase
local target = event.target
if ( “began” == phase ) then
display.getCurrentStage():setFocus(target)
target.isFocus = true
elseif ( target.isFocus ) then
if ( “moved” == phase ) then
local adjX = box1.x - event.x
box1.x = event.x
box2.x = box2.x + adjX
else
–Anything else is a release.
display.getCurrentStage():setFocus(nil)
target.isFocus = false
end
end
return true
end

box1:addEventListener(“touch”, box1Touch)[/lua] [import]uid: 22076 topic_id: 23787 reply_id: 95859[/import]

have a look at parallax scrolling in the code exchange [import]uid: 3826 topic_id: 23787 reply_id: 95879[/import]