baya.zidi99ParticipantOctober 3, 2012 at 6:52 am #9550
Hi everyone. I want to create a drag action that affects another layer. So for example, if I drag a cube in the X axis, the tree behind the cube moves in the negative X axis and vice versa. Any ideas on how to do this? I've been looking through the forums on Kwiksher as well as Corona. I believe its possible, but my scripting leaves quite a bit to be desired.Any help much appreciated.Kind Regardsur_heinisAnonymousOctober 3, 2012 at 5:24 pm #13016
you probably need to create an action (using the Move/Scale interaction) – the one that will move the tree. So, when you are dragging the cube, you set the onDragging action to the move/scale one.baya.zidi99ParticipantOctober 4, 2012 at 6:17 am #13017
Hi Alex, thanks for getting back to me. I tried the method you suggested. No joy unfortunately. The move/scale action makes the layer jump to the specified x value set in the move/scale property box. I downloaded the project files for the “drag” tut on the website. The project opens with a slider and a red ball that scales up when button is released. When I set that to onDrag, i get the result I want, but only in the one direction. Moving the slider back doesn't scale it back down. In fact, it keeps scaling the ball up. I'm assuming the logic would be the same for my project where the slider is just replaced by the cube and the red ball by the tree. Also then moving the tree in the x direction instead of scaling. Problem still remains, the -x direction.hope it makes sense.hAnonymousOctober 4, 2012 at 2:29 pm #13018
It will be easier for me to understand if you send me your project (email@example.com). Although I will not be able to write the code you need, at least I can give you some guidance.
You must be logged in to reply to this topic.