|
From: PaulD. on 13 Jul 2007 10:32 I am making a drag and drop quiz. Let me describe what I am trying to acheive first, it will make it easier to understand. I have a picture of the back of a computer and a picture of a long cable (that can be moved around the screen). The aim is to place the end of the cable in the correct port. But the problem I having at the moment is being caused by the picture of the cable. Because I have made it so it can be moved around the screen I have made the picture extra long so when it is dragged across the screen a length of cable still appears. So when I drop the cable connector onto the port nothing happens until I drop the middle of the picture - nowhere near the connector, on the correct spot. Can anyone help with this? I have tried using a KO. Also about the picture... Can something be done so that it cannot be moved off screen, but, in a way that the cable can be dragged from one side to the other and the rest of the cable still apears from the side of the screen. In the Properties of the image setting Movable to On Screen doesn't work. Straight away it moves the middle of the cable to the cursor point. Hopefully you can understand my issue.
From: PaulD. on 16 Jul 2007 05:15 Anyone?
From: Mike Baker **Adobe Community Expert** on 16 Jul 2007 10:43 The 'target area' response will only work with the center point of the image being drawn, no way to change that. Try one of these: 1. Move the target area response square to the spot where the center of the image needs to be when the connector is correct. 2. Set the target area much larger so that it will trigger the process no matter where it's dropped and then evaluate the position to see if the correct part of the image is in the right spot. Use DisplayLeft, DisplayTop, DisplayWidth, and DisplayHeight to find where the correct corner of the object is. 3. Make a smaller image, just the end of the cable, draggable. Make a separate smaller image for the end of the cable that disappears off the screen. Put in a conditional response with the condition Dragging@"cableend" and set to match 'when true'. Inside that response set up the Line function to draw the cable part from the draggable end part to the stationary part. (not very good since the line is always straight) The conditional prevents the target area from working but you can give them a button to click when they're done and evaluate the placement using the same display variables. 4. Add in another display, a small one that won't be seen. Set up a motion icon to place the item using 'direct to grid' with a grid the size of the window and destination based on where the cable end is being dragged. Set the motion to perpetual and timing set at .001 so it'll just follow the end of the cable. (hint: first set up the image and the motion so you can work with it and then change the features of the display so it won't be seen) When the cable is dropped you check to see if the little 'follower' image is overlapping a target image. HTH, Mike ==================== Mike Baker Adobe Community Expert mike-baker(a)cox.net "PaulD." <webforumsuser(a)macromedia.com> wrote in message news:f782dv$7ar$1(a)forums.macromedia.com... > I am making a drag and drop quiz. Let me describe what I am trying to acheive > first, it will make it easier to understand. > I have a picture of the back of a computer and a picture of a long cable (that > can be moved around the screen). The aim is to place the end of the cable in > the correct port. > But the problem I having at the moment is being caused by the picture of the > cable. Because I have made it so it can be moved around the screen I have made > the picture extra long so when it is dragged across the screen a length of > cable still appears. So when I drop the cable connector onto the port nothing > happens until I drop the middle of the picture - nowhere near the connector, on > the correct spot. > Can anyone help with this? I have tried using a KO. > > Also about the picture... Can something be done so that it cannot be moved > off screen, but, in a way that the cable can be dragged from one side to the > other and the rest of the cable still apears from the side of the screen. In > the Properties of the image setting Movable to On Screen doesn't work. > Straight away it moves the middle of the cable to the cursor point. > Hopefully you can understand my issue. >
From: vreimer on 16 Jul 2007 11:03 In a calculation icon or the calculation property of the object set the Movable property to false For example on that icon itself Movable:=False Or in another icon Movable@"BobsYourUncle" := False Drag and drops can center the image, but it varies on where you start dragging, if you drag on the center of the image it will be close to what you desire, if you start dragging on an edge or corner it won't center the way you want. Vern
|
Pages: 1 Prev: Randomly selecting a branch to take Next: Progressive Download |