Drag & Drop Game - I'm stuck!

Hello.
I'll try and explain this as simply as I can!
I have a drag and drop game where you have to drag one of 4
items into a bag. If you chose the right item and drag that into
the bag, you'll jump to a specific marker which says CORRECT. If
you drag any of the other 3 items, you'll jump to a marker that
says FALSE. In other words, for each item I need it to jump to a
different marker when you've dragged it in.
At the moment I've managed to get it working so it jumps to
the marker, but it jumps to the same marker which ever item you
drag. I need them to be different.
>> I HAVE THIS SCRIPT ON MY DRAGGABLE ITEM:
end beginSprite
on endSprite(me)
(the actorList).deleteOne(me)
end endSprite
on mouseDown me
pOffset = pSprite.loc - the mouseLoc
(the actorList).append(me)
end
on stepFrame(me)
if the mouseDown then
pSprite.loc = pOffset + the mouseLoc
else
sendAllSprites(#DropSprite, the mouseLoc)
pSprite.loc = pStartLoc
(the actorList).deleteOne(me)
end if
end stepFrame
>> I HAVE THIS SCRIPT ON MY TARGET AREA (BAG):
property marker
on DropSprite(me, aLoc)
vSprite = sprite(me.spriteNum)
vRect = vSprite.rect
if aLoc.inside(vRect) then
go marker
end if
end DropSprite
on getPropertyDescriptionList(me)
vPropertyList = [:]
vPropertyList[ \
#marker] = [ \
#comment: "Marker to jump to when DropSprite is called", \
#format: #marker, \
#default: marker(1)]
return vPropertyList
end getPropertyDescriptionList
Any help would be greatly appreciated! Thank you.

You've left out the beginSprite portion of one of the
handlers so I created
what I thought you might be using there.
Instead of declaring a marker for a correct sprite in the bag
sprite, I've
changed it to the draggable sprites so each has a designation
of correct or
incorrect. This way you have the choice of making more than
one "correct"
if you're using many sprites. Now, the bag checks first to
see if a dropped
sprite is within itself then checks the type of sprite to
determine what the
target marker is. You could add a property for correct and
incorrect to
determine the target marker rather than hard coding it like I
did. But
that's left as an exersize for the student ;)
-->> I HAVE THIS SCRIPT ON MY TARGET AREA (BAG):
on DropSprite(me, aLoc, spriteType)
vSprite = sprite(me.spriteNum)
vRect = vSprite.rect
if aLoc.inside(vRect) then
if spriteType = #correct then
go marker ("correct")
else
go marker ("incorrect")
end if
end if
end DropSprite
-->> I HAVE THIS SCRIPT ON MY DRAGGABLE ITEM:
property pSprite, pOffset, pStartLoc, pSpriteType
on BeginSprite me
pSprite = sprite (me.spriteNum)
pOffset = 0
pStartLoc = 0
(the actorList).add (me)
end
on endSprite(me)
(the actorList).deleteOne(me)
end endSprite
on mouseDown me
pOffset = pSprite.loc - the mouseLoc
pStartLoc = pSprite.loc
(the actorList).append(me)
end
on stepFrame(me)
if the mouseDown then
pSprite.loc = pOffset + the mouseLoc
else
sendAllSprites(#DropSprite, the mouseLoc, pSpriteType)
pSprite.loc = pStartLoc
(the actorList).deleteOne(me)
end if
end stepFrame
on getPropertyDescriptionList(me)
vPropertyList = [:]
vPropertyList [\
#pSpriteType] = [\
#comment: "Correct or incorrect",\
#format: #symbol,\
#range: [#correct, #incorrect],\
#default: #incorrect]
return vPropertyList
end getPropertyDescriptionList
Craig Wollman
Lingo Specialist
Word of Mouth Productions
212-928-9581
www.wordofmouthpros.com
"Dava" <[email protected]> wrote in message
news:[email protected]...
> Hello.
>
> I'll try and explain this as simply as I can!
>
> I have a drag and drop game where you have to drag one
of 4 items into a
> bag.
> If you chose the right item and drag that into the bag,
you'll jump to a
> specific marker which says CORRECT. If you drag any of
the other 3 items,
> you'll jump to a marker that says FALSE. In other words,
for each item I
> need
> it to jump to a different marker when you've dragged it
in.
>
> At the moment I've managed to get it working so it jumps
to the marker,
> but it
> jumps to the same marker which ever item you drag. I
need them to be
> different.
>
> >> I HAVE THIS SCRIPT ON MY DRAGGABLE ITEM:
>
> end beginSprite
>
> on endSprite(me)
> (the actorList).deleteOne(me)
> end endSprite
>
> on mouseDown me
> pOffset = pSprite.loc - the mouseLoc
> (the actorList).append(me)
> end
>
> on stepFrame(me)
> if the mouseDown then
> pSprite.loc = pOffset + the mouseLoc
>
> else
> sendAllSprites(#DropSprite, the mouseLoc)
> pSprite.loc = pStartLoc
> (the actorList).deleteOne(me)
> end if
> end stepFrame
>
>
> >> I HAVE THIS SCRIPT ON MY TARGET AREA (BAG):
>
> property marker
>
> on DropSprite(me, aLoc)
> vSprite = sprite(me.spriteNum)
> vRect = vSprite.rect
>
> if aLoc.inside(vRect) then
> go marker
> end if
> end DropSprite
>
> on getPropertyDescriptionList(me)
> vPropertyList = [:]
>
> vPropertyList[ \
> #marker] = [ \
> #comment: "Marker to jump to when DropSprite is called",
> #format: #marker, \
> #default: marker(1)]
>
> return vPropertyList
> end getPropertyDescriptionList
>
>
>
>
>
> Any help would be greatly appreciated! Thank you.
>

Similar Messages

  • Reseting a drag & drop game

    Hello All:
    I'm having trouble reseting a drag & drop game. It is a movie clip with two pages: start_pg and game_pg. On start_pg is a start button (start_btn) that goes to game_pg. On game_pg is button (end_btn) that goes back to start_pg. Both buttons share the same layer, so I made each invisible when not of its page. The game works fine, but when the end_btn is clicked, all movie clips that have been dropped, stay there.
    How can I go back to start_pg and reset all movie clips to their original starting point?
    // start game page
    stop();
    end_btn.visible=false;
    start_btn.visible=true;
    start_btn.addEventListener(MouseEvent.CLICK, goGame);
    function goGame (Event:MouseEvent): void
    gotoAndStop("game_pg");
    // game page
    var startX:Number;
    var startY:Number;
    var counter:Number = 0;
    pic_1.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_1.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_3.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_3.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_2.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_2.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_4.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_4.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
    event.target.startDrag(true);
    event.target.scaleX = 1.2;
    event.target.scaleY= 1.2;
    m_txt.text = "";
    event.target.parent.addChild(event.target);
    startX = event.target.x;
    startY = event.target.y;
    function dropIt(event:MouseEvent):void {
    event.target.stopDrag();
    var myTargetName:String = "target" + event.target.name;
    var myTarget:DisplayObject = getChildByName(myTargetName);
    if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
      event.target.width = 230;
      event.target.height= 190;
      m_txt.text = "Good Job!";
      event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
      event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
      event.target.buttonMode = false;
      event.target.x = myTarget.x;
      event.target.y = myTarget.y;
      counter++;
    } else {
      m_txt.text = "Try Again!";
      event.target.x = startX;
      event.target.y = startY;
      event.target.width = 50;
    event.target.height= 40;
    if(counter == 4){
            m_txt.text = "Congratulations, you matched all rivers correctly!";
    pic_1.buttonMode = true;
    pic_2.buttonMode = true;
    pic_3.buttonMode = true;
    pic_4.buttonMode = true;
    // end game button
    start_btn.visible=false;
    end_btn.visible=true;
    // end game button
    end_btn.addEventListener(MouseEvent.CLICK, goStart);
    function goStart(Event:MouseEvent):void
    gotoAndStop("start_pg");
    Thanks in advance for any assistance.
    German

    Kglad:
    All my movie clips are on stage. Does it make any difference?
    I tried three options: 1) I didn't change the two functions and added the restore XY action to end_btn. It didn't work.
    end_btn.addEventListener(MouseEvent.CLICK, goStart);
    function goStart(Event:MouseEvent):void
    restoreXY(MovieClip(root));
    gotoAndStop("start_pg");
    The second option. In each function I changed
    the last part restoreXY(mc[obj]); to restoreXY(MovieClip(root));  (this didn't work)
    The third option was adding the storeXY to my function pickUp (which is when all movie clips exist in their original position) and keeping the restore action in end_btn. Didn't work.
    function pickUp(event:MouseEvent):void {
    event.target.startDrag(true);
    event.target.scaleX = 1.2;
    event.target.scaleY= 1.2;
    m_txt.text = "";
    event.target.parent.addChild(event.target);
    startX = event.target.x;
    startY = event.target.y;
    storeXY(MovieClip(root));
    In all cases, I got errors in many lines such as
    1120: Access of undefined property obj the scritp is   if(mc[obj] is "MovieClip" && mc[obj].parent==mc){
    Can you please tell where in my code I should put the storeXY and restoreXY(MovieClip(root));?
    Thanks again for helping me.
    German

  • Need help with drag and drop game, Urgent!

    Hi I have created a drag and drop game, the drag and drop is
    working alright however once the right word has been placed in the
    box, and moves on to the next question the previous correct answer
    stays where it was placed, how can i get it to snap back to its
    original location? Also when the right word is draged in to the the
    white box i want it to snap into place in that box so it fits in
    there.
    Also if you have any other thoughts and advice on how i can
    improve on this please email me thanx
    Can someone please help, my .fla file can be found here:
    http://www.freshlemon.co.uk/timeline.fla
    http://www.freshlemon.co.uk/timeline.fla.zip
    thanx

    tellTarget is ancient
    I forget what it even used to do??? hahaha
    seriously, just put in the instance name and what you want it
    to do:
    tellTarget("movieclip"){
    play();
    is now just
    movieclip.play();

  • A drag and drop game with dynamic text response

    Hi,
    I am a teacher and my school has recently upgraded to Adobe Design Premium.  Our previous version was about 5 versions out of date.
    I teach A Level which requires students to create an Interactice Multimedia product.
    In the previous 6 years, I have taught students how to create simple drag and drop game with dynamic text responses.
    Since the upgrade to Actionscript 3.0 the dynamic text response has ceased working.
    When creating the game from scratch, I need to move to Actionscript 2.0 as 3.0 does not allow me to add actionscript to objects - I know and am sure that this is a better way of doing things, but I would prefer to keep working the way I am used to.
    I use a switch case statement which I have copied below to make the drag and drop work.  The objects I apply the code to work in that they can be dragged, however, my dynamic text box with a variable name of "answer" is no longer displaying the response when an answer is left on a dropzone (rectangle converted to a symbol and given an instance name).
    on(press) {
    startdrag(this);
    on(release) {
    stopdrag();
    switch(this._droptarget) {
      case "/dropzoneB":
       _root.answer="Well done";
       break;
      case "/dropzoneA":
      case "/dropzoneC":
       _root.answer="Hopeless";
       break;
      default:
       _root.answer="";
       break;
    Any help would be much apeciated.
    Thanks
    Adrian

    To drag in as3
    blie_btn is the instance of the object drawin on the stage. In AS3 you have to assign a even listener, in this case MOUSE_DOWN, and MOUSE_UP, as we want the drag to stop if the mouse is not clicked. Then we fire the functions, and tell the object to start drag.
    // Register mouse event functions
    blue_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    blue_btn.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    red_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    red_btn.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    // Define a mouse down handler (user is dragging)
    function mouseDownHandler(evt:MouseEvent):void {
         var object = evt.target;
         // we should limit dragging to the area inside the canvas
         object.startDrag();
    function mouseUpHandler(evt:MouseEvent):void {
         var obj = evt.target;
              obj.stopDrag();
    if you want to make the text do what you want then something like this might work.
    In the function, you could add a text box onto the stage, give it a instance of something like outputText
    and then:
    outputText = ("Bla Bla Bla");
    (^Not sure if this will work exactly^)
    PS. I am currently a A-level student

  • Balls visible in other "pages" of app after "drag n drop" game. Help plz!

    After modifying code from a tutoial I've got the drag n drop game part of my educational project app working beautifully.
    The unfortunate thing is that If I hit the home button that is common to all the "pages" in my app to move away from the game, the balls that have been dropped into the correct position remain visible on the stage in ALL other pages.
    I'm guessing this is because the AS code removes the event listener so once dragged to the correct postion in the game, they snap there and cannot be moved.
    Am I right?
    How can I solve the problem of the dropped balls being visible on other "pages"
    Thanks in advance and heres the code on that particular page of the app.
    var counter:Number = 0;
    var startX:Number;
    var startY:Number;
    peg1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg3_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg3_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg4_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg4_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg5_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg5_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg6_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg6_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg7_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg7_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg8_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg8_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg9_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg9_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg10_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg10_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg11_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg11_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg12_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg12_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
        reply_txt.text = "";
        event.target.parent.addChild(event.target);
        startX = event.target.x;
        startY = event.target.y;
    function dropIt(event:MouseEvent):void {
        event.target.stopDrag();
        var myTargetName:String = "target" + event.target.name;
        var myTarget:DisplayObject = getChildByName(myTargetName);
        if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
            reply_txt.text = "Good Job!";
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
            event.target.buttonMode = false;
            event.target.x = myTarget.x;
            event.target.y = myTarget.y;
            counter++;
        } else {
            reply_txt.text = "Try Again!";
            event.target.x = startX;
            event.target.y = startY;
        if(counter == 12){
            reply_txt.text = "Congrats, you're finished!";
    peg1_mc.buttonMode = true;
    peg2_mc.buttonMode = true;
    peg3_mc.buttonMode = true;
    peg4_mc.buttonMode = true;
    peg5_mc.buttonMode = true;
    peg6_mc.buttonMode = true;
    peg7_mc.buttonMode = true;
    peg8_mc.buttonMode = true;
    peg9_mc.buttonMode = true;
    peg10_mc.buttonMode = true;
    peg11_mc.buttonMode = true;
    peg12_mc.buttonMode = true;

    Sorry, I'm a bit confused by that.
    You said add code to frame 1? Frame 1 is my home section. Do you mean copy/paste your code there? Frame 1 currently looks like this:
    stop();
    learn_btn.addEventListener(MouseEvent.CLICK, learnClicked);
    function learnClicked(event:MouseEvent):void
    SoundMixer.stopAll();
    gotoAndStop("learn")
    play_btn.addEventListener(MouseEvent.CLICK, playClicked);
    function playClicked(event:MouseEvent):void
    SoundMixer.stopAll();
    gotoAndStop("play")
    test_btn.addEventListener(MouseEvent.CLICK, testClicked);
    function testClicked(event:MouseEvent):void
    SoundMixer.stopAll();
    gotoAndStop("test")
    home_btn.addEventListener(MouseEvent.CLICK, homeClicked);
    function homeClicked(event:MouseEvent):void
    SoundMixer.stopAll();
    for(var i:uint=0;i<reparentedBalls.length;i++){
    if(reparentedBalls[i]!=null){
    reparentedBalls[i].parent.removeChild(reparentedBalls[i]);
    gotoAndStop("home")
    The other bit of relevant code is on frame 42 which currently looks like this:
    var counter:Number = 0;
    var startX:Number;
    var startY:Number;
    var reparentedBalls:Array=[];
    peg1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg3_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg3_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg4_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg4_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg5_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg5_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg6_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg6_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg7_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg7_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg8_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg8_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg9_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg9_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg10_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg10_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg11_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg11_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg12_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg12_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
        reply_txt.text = "";
        event.target.parent.addChild(event.target);
    reparentedBalls.push(event.target);
        startX = event.target.x;
        startY = event.target.y;
    function dropIt(event:MouseEvent):void {
        event.target.stopDrag();
        var myTargetName:String = "target" + event.target.name;
        var myTarget:DisplayObject = getChildByName(myTargetName);
        if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
            reply_txt.text = "Good Job!";
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
            event.target.buttonMode = false;
            event.target.x = myTarget.x;
            event.target.y = myTarget.y;
            counter++;
        } else {
            reply_txt.text = "Try Again!";
            event.target.x = startX;
            event.target.y = startY;
        if(counter == 12){
            reply_txt.text = "Congrats, you're finished!";
    peg1_mc.buttonMode = true;
    peg2_mc.buttonMode = true;
    peg3_mc.buttonMode = true;
    peg4_mc.buttonMode = true;
    peg5_mc.buttonMode = true;
    peg6_mc.buttonMode = true;
    peg7_mc.buttonMode = true;
    peg8_mc.buttonMode = true;
    peg9_mc.buttonMode = true;
    peg10_mc.buttonMode = true;
    peg11_mc.buttonMode = true;
    peg12_mc.buttonMode = true;
    Are you telling me to change the 4th line to reparentedBalls=[]; or var reparentedBalls=[];

  • Need conceptual help for a simple drag n drop game

    As anyone who saw my previous thread knows, I'm trying to make an educational app prototype (I'm new to Flash, this is for a Masters in education) to help students learn IPA symbols (phonetics). I have successfully made a section where the students click on symbols to hear the corresponding audio and listen to explanations.
    For the final part of the prototype, I have to create some kind of instructional game. My idea is to have 12 circles, each one playing an audio file of a vowel sound (this I know how to do). The students will have to click the circles to listen and then drag and drop them to the correct IPA symbol. Flash would then give feedback on correct/incorrect answers and a score. Maybe all of this is against the clock, needing a timer.
    So, I need to learn drag and drop. What else to I need to learn so that one drop position is considered "correct", the others are considered "incorrect" and a score is given at the end? And maybe a timer?)
    Any conceptual help gratefully received!!
    Darren

    Cheers for the reply.
    Yes, I have heard of this Google you speak of The thing is, sometimes as a beginner you can't see the wood for the trees and I find mountains of info when I search, it's hard to know which direction to do in. As for drag & drop I had already found good tutorials on that, it's more the other concepts that need to be employed that I would like information on.
    I'll look into the getTomer() function, sounds just what I need.
    As for the scoring correct/incorrect answers, i found a wonderful example on flashkit.com, which would basically solve all my problems if I learn how to adapt it. The trouble is it was made in Flash 7, I'm on CS4.
    How many changes would I need to make to the code to turn it into AS3?
    Cheers everyone
    Darren
    (EDIT: I pasted the code and now it looks weird. I used SQL syntax highlighting on this page, maybe somebody could tell me how to past code and get it looking correct?)
    myAnswers = [[1, 1], [2, 2], [3, 5], [4, 4]];
    function doDrop(dragSprite, numTargets) {
         for (i=1; i<numTargets+1; i++) {
              if (_root[dragSprite].hitTest("_root.q"+i)) {
                   if (_root["q"+i]._currentframe<>2) {
                        _root[dragSprite]._x = _root["q"+i]._x+5;
                        _root[dragSprite]._y = _root["q"+i]._y+2;
                        _root["q"+i].gotoAndStop(2);
                   } else {
                        _root[dragSprite]._x = _root[dragSprite].stx;
                        _root[dragSprite]._y = _root[dragSprite].sty;
    function clearDrop(dragSprite, numTargets) {
         for (i=1; i<numTargets+1; i++) {
              if (_root[dragSprite].hitTest("_root.q"+i)) {
                   if (_root["q"+i]._currentframe == 2) {
                        _root["q"+i].gotoAndStop(1);
                        break;

  • Drag&Drop from Browser to AIR App

    Hi there,
    i wonder how it is possible to drag an element from a flash
    page in my browser to an air app on my desktop. i've seen the
    showcase
    of the nickelodeon jigsaw game on adobe.com, but the videos
    looks kind of post-processed.
    do you have any tipps on how to enable flash/AIR
    drag&drop trespassing the browser borders?

    Thanks for your answer.
    i already tried something like this, but i still have
    problems with getting the newly created entity dragged. how can I
    position the new entity from my air app directly under the mouse
    cursor? so far i didn't find any screen mouse position functions or
    properties. If I use a fullscreen, always on top window with mostly
    transparent parts, I can't capture the mouse position using
    MOUSE_MOVE all the time. Besides, how can I change the focus from
    my browser to my air app? I already tried calling
    nativeWindow.orderToFront() and nativeWindow.activate(), but the
    focus doesn't change when I click the entity in my flash page.
    Maybe somebody knows an answer to this ...

  • Can't drag & drop from iPhoto into iMovie 10

    Am trying to add some photos from my iPhoto library into an iMovie 10 project.  I access the iPhoto library and the pictures show up, but when I try to drag/drop or add to the timeline, nothing happens.  The little hand shows up over the photo, and even the + sign, but when I try to move or add it, nothing happens.
    And, once I select one photo, it seems stuck until I deselect all. 
    Dragging of clips from the event library doesn't seem to be a problem.
    Any advice or help is appreciated.

    With a picture selected from the iPhot Library as it shows up in iMovie, if you select a photo by clicking on it once, then click the plus sign, what happens?

  • Drag & Drop ALV row to a picture control

    Hello.  I'm trying to implement drag&drop functionality from an ALV grid to a picture/icon(CL_GUI_PICTURE).  Anyone know if this is possible.  I can't get my events to fire when dragging/dropping.  I have been able to do it from ALV to ALV, but am getting stuck on ALV to Picture.  I want some kind of "shopping cart" functionality like in ME22N, where the user can drag a PO from a list into the "shopping cart" picture/icon.
    Anyone can help?
    Regards,
    Rich Heilman

    Good afternoon!
    I'm trying to do the same, to drag a node of a tree and drop it on a picture control. I have called the set_dragdrop_control and set_dragdrop_picture methods and I'm sure of the set handler statement, but no event is fired.
    Can you help me?
    Thank you,
    Fabiano (from Brazil).

  • Yosemite Mail.app attachments drag&drop

    In Mail.app (v. 8.0) I'm unable to drag&drop attachment from incoming emails to new email (however ctrl+c/v still works).
    Steps to reproduce:
    Have an email(s) with attachments
    Create a new email
    Try to drag&drop some attachment from step 1.
    Was this feature deleted, or it is a bug (it was working in previous OSX)?

    I have the same annoying issue. The open email is stuck in the middle of the page and I cant see 2 open emails at the same time. How many times did you need to restart to fix this please? Thanks

  • How i can do a drag drop between container (grid)?

    I am trying to work out a task with Drag and Drop(WPF ,C#)to include in a demo ,i will explain easy showing an example of code in XAML 
    <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
    <RowDefinition Height="*"/>
    <RowDefinition Height="*"/>
    <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid x:Name="container1" Grid.Row="0" >
    <Grid Name="grid1" Background="Aqua" Margin="15"></Grid>
    </Grid>
    <Grid x:Name="container2" Grid.Row="1" >
    <Grid Name="grid2" Background="blue" Margin="15"></Grid>
    </Grid>
    <Grid x:Name="container3" Grid.Row="2" >
    <Grid Name="grid3" Background="green" Margin="15"></Grid>
    </Grid>
    </Grid>
    My purpose is when the user drag the
    grid1 in the
    container2 automatically the grid2 will go to place in the
    container1 (basically I want to swap the grids) then this process will be used every time need to drag a grid in a container. with a code that i wrote down i can do a simple drag&drop  i can drag the "grid1"
    to the "container2" but cannot send back automatically the grid2 to container1.
    Kindly i ask if you have any advise or tips to make successful this task.
    Thank you so much for your attention
    Cheers!!!
    *********EDIT*********                                                                  
                                     Using this code as follow i can do the drag&drop but what really i need is the grid "container "is fix and never move just the
    "grid" should move between the "container "                                 
    <StackPanel Name="sp" AllowDrop="True" Background="SkyBlue" PreviewMouseLeftButtonDown="sp_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="sp_PreviewMouseLeftButtonUp" PreviewMouseMove="sp_PreviewMouseMove"
    DragEnter="sp_DragEnter" Drop="sp_Drop">
    <Grid Name="grid1" Background="Aqua" Height="120" Width="500"></Grid>
    <Grid Name="grid2" Background="Blue" Height="120" Width="500"></Grid>
    <Grid Name="grid3" Background="Red" Height="120" Width="500"></Grid>
    </StackPanel>
    private bool _isDown;
    private bool _isDragging;
    private Point _startPoint;
    private UIElement _realDragSource;
    private UIElement _dummyDragSource = new UIElement();
    public MainWindow()
    InitializeComponent();
    private void sp_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    if (e.Source == this.sp)
    else
    _isDown = true;
    _startPoint = e.GetPosition(this.sp);
    private void sp_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    _isDown = false;
    _isDragging = false;
    _realDragSource.ReleaseMouseCapture();
    private void sp_PreviewMouseMove(object sender, MouseEventArgs e)
    if (_isDown)
    if ((_isDragging == false) && ((Math.Abs(e.GetPosition(this.sp).X - _startPoint.X) > SystemParameters.MinimumHorizontalDragDistance) ||
    (Math.Abs(e.GetPosition(this.sp).Y - _startPoint.Y) > SystemParameters.MinimumVerticalDragDistance)))
    _isDragging = true;
    _realDragSource = e.Source as UIElement;
    _realDragSource.CaptureMouse();
    DragDrop.DoDragDrop(_dummyDragSource, new DataObject("UIElement", e.Source, true), DragDropEffects.Move);
    private void sp_DragEnter(object sender, DragEventArgs e)
    if (e.Data.GetDataPresent("UIElement"))
    e.Effects = DragDropEffects.Move;
    private void sp_Drop(object sender, DragEventArgs e)
    if (e.Data.GetDataPresent("UIElement"))
    UIElement droptarget = e.Source as UIElement;
    int droptargetIndex=-1, i =0;
    foreach (UIElement element in this.sp.Children)
    if (element.Equals(droptarget))
    droptargetIndex = i;
    break;
    i++;
    if (droptargetIndex != -1)
    this.sp.Children.Remove(_realDragSource);
    this.sp.Children.Insert(droptargetIndex, _realDragSource);
    _isDown = false;
    _isDragging = false;
    _realDragSource.ReleaseMouseCapture();
    Thanks :)

    Hello Jonny,
    Currently I do not have a sample and I have reviewed this post and find another way which seems more reasonable. Have you cosidered use a ListView instead of common grid. It seems we can do what you want with two common grid however we need to hardcoded
    all the things.
    If we use ListView, for example, you can see this thread:
    http://stackoverflow.com/questions/20573063/creating-icon-view-mode-for-listview-wpf
    and this thread:
    http://stackoverflow.com/questions/9443695/how-do-i-drag-drop-items-in-the-same-listview
    We can drag and drop items instead of grid, which will make this programming much easier than hard code to switch your control's location.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.
    Dear Barry Wang thank you so much for your kind support ,just open me a way to do it ,you can see in this post https://social.msdn.microsoft.com/Forums/vstudio/en-US/55873851-e86c-4a20-9b00-de3419054ba8/get-stuck-to-dragdrop-in-this-case?forum=wpf .
    Wish you a Happy New Year .
    Sincerley

  • ITunes crashes when try to add songs to library both drag-drop and Add folder/file option

    I got the old iTunes updated, it crashed when open. Then I uninstall and download the newest iTunes. Restart my laptop.
    I even start iTunes in safe mode but it keep crashing.
    I try Add folder first, then Add file, then drag and drop. None of them work and I only have 700MB total of songs, no vids
    There were no pop up for error code or anything, iTune just crash when I try one of those add options.
    If anyone can help I would really appreciate

    after I got offline yesterday, I tried drag-drop again, it worked.

  • I deleted the "desktop" in tiger, can't "alias", "copy" or "drag & drop" anything to it now, I get a message that "desktop can not be changed"

    I was trying to make an alias of "SAFARI" icon to have on the desktop & in the dock as well, I managed to make the safari icon appear on the desktop, but when I wanted to switch from firefox to safari it wouldn't open / start safari, so OK, no big deal, I moved it the trash, ( by rt. click,>move to trash>click ) the horror starts here, everything on the desktop disappeared into the trash !!!!! ......
      So I have tried to "drag & drop", "alias", "copy", "duplicate" to get things back out of the trash, but every attempt is met with a message "the desktop con not be changed",   and whatever I try to bring anything out of the trash window, it gets a "minus - sign" added to it when it crosses over the edge of the trash window, and of course it jumps right back into the trash when the mouse button is released.
    I think (barely) I will need the do a "clean install", or a "restore" from the install DVD to restore / get the desktop back.
    And while the only thing on the desktop now is the HDD icon, clicking it open does not show the desktop in the Lf. column of the window where it should be, or any OS X folders when clicking on anything, but the OS is is running for this post and yahoo, etc., and there is a upward facing arrow next to the "network" name in the left column, that doesn't go away, like after installing some software, this is weird !!
    Any solid ideas welcomed, and Thanks for reading my driveling post,  .....  wayne146  .........
    this is happening on my back-up machine, a G4 400mhz PCI, OS X TIGER 10.4.11 & 9.2.2 in classic ( all the 9.2.2 stuff does still show in the hdd when clicked )
    I am having bigger troubles with my QS 800 dp, so I need this one to stay online, Please help !!!

    to safari it wouldn't open / start safari, so OK, no big deal, I moved it the trash, ( by rt. click,>move to trash>click ) the horror starts here, everything on the desktop disappeared into the trash !!!!!
    I am confused by what you did.
    open / start safari
    What did you do?  This looks like a terminal command.
    Or, did you click on the safari icon then right click on the safari icon then click on open? 
    I do not understand how you that moving to the trash would be helpful.
    I suspect disk corruptions.
    I run disk utility verify the file system on your starup disk.  See below.
    verify & repair your startup drive
    To verify & repair you file system on the startup drive, you will need to run disk utility from you installation DVD.
    This article  will tell you how to get to disk utility.  Once in a disk utility, you can go and attempt to recover the disk.
    http://support.apple.com/kb/TS1417
    To repair your startup drive, you will need to run disk utility from your startup DVD.
    Mac OS X 10.4: About the utilities available on the Mac OS X 10.4 Install DVD
    http://support.apple.com/kb/HT2055
    How to run disk utility from your startup DVD.
    Insert your  startup DVD  into your reader.  Power down your machine.  Hold down to the c key.  Power on your machine.  This will bootup your startup DVD.
    This will bring you to a panel asking you for your language.  Pick your language.
    You you come to the Install Mac OS panel.  Do not install.
    Click on Utilities menu item.  This will give you a pulldown list of utilities.
    Click on the disk utility.
    You are now in disk utility.  Pick your disk.  Click on repair it should be on the lower right of the panel.
    Once the repair completes successfully, you should update your permissions.
    Verify a disk
    As an alternative, you can verify that the filesystem on the disk is correct. You will not be able to repair the file system.
    I suggest that you use disk utility to verify that your startup disk is OK.  Macintosh-HD -> Applications -> Utilities -> Disk Utility  Start up disk utility.  On the left pane view, you will see a list of all your disks.   click on your startup disk.  Click on the First Aid  Tab.  Click on verify.   Hopefully your disk will verify.  If not, you have to boot from your installation DVD and run Disk First Aid from there to attempt to repair your file-system.

  • Can open Topics by drag & drop, but not by double-clicking in the DITA map

    Hi,
    evidently I made an error somewhere in my structure app, the result is that I cannot open DITA topics by double clicking them in the DITA map anymore (Framemaker does simpy nothing). I can, however, open them by dragging the xml files onto the Framemaker window.  If I use the standard DITA 1.2 application everything works fine so I guess the problem is in my mapping.
    Here is what I tried to achieve:
    We need certain variations of the normal 'topic' type topic. The DTD should be identical, however different structures should be auto-inserted when creating a topic and the topic should have certain attribute values predefined.
    The idea is that the author can select one of these topic types when creating a topic, but when opening an existing topic simply edit it with the standard topic temple.
    Here is what I did:
    I duplicated the topic.template.fm, renaming it say "topic_a.template.fm", "topic_b.template.fm" etc. (just an example).
    I made adjustments to the EDD of these templates, changing the auto-insertions and the default values of some attributes.
    In the structapps.fm file I added XML applications for these new topic types, mapping each application to one of the new templates, but to the original topic DTD and r/w rules. E.g. the application "DITA_1.2_topic_a" is mapped to the "topic_a.template.fm" template, and to the original "topic.dtd" and "topic.rules.txt" files.
    In Framemaker I then created corresponding application mappings in the DITA options. E.g. the topic type "A" (which defines the visible text in the "New topic" menu) is maped to the XML application "DITA_1.2_topic_a".
    The result:
    It works as intended in every way when creating topics. The topics are saved with the standard doctype 'topic'. However for when I try to open topics from the DTD by double-clicking then nothing happens. Opening topics by drag & drop works fine though and they are opened with the normal (general) "topic.template.fm" template as desired.
    Any ideas? Was this confusing or am I completely off somewhere?
    Robert

    Hi Robert...
    When you say that you need "variations" from the normal topic type .. are those structural variations or just formatting? FM associates structure apps with XML files based on the doctype (root element). If your files all have the same root element, then they will all open with the same structure application (unless you specify a different one when opening the file or by importing a new EDD). It sounds like you really should be creating a specialization for each alternate topic type. If you don't, you'll end up getting the wrong "model" assigned to the wrong file.
    Multiple EDDs (structure apps) can share the same DTD, and one EDD (structure app) can support multiple models. This is how the "ditabase" app works. There are lots of ways to set this up, but I think what you've done is probably not quite right.
    The default structure app setup in FM11 and FM12 is very complicated to work with. I recommend creating a single app that supports many models. This isn't always possible, but it sounds like in your case it should be. I've set up one app that supports 13 different specialized topic models and it works fine.
    Note that even though you've added structure apps for each model, if you end up opening the files using the default template, you are no longer using those modified models.
    Sorry, but this is a bit more than can be dealt with appropriately in a forum post. If you'd like more help with this, feel free to contact me off list.
    Cheers,
    …scott
    Scott Prentice
    Leximation, Inc.
    www.leximation.com

  • Unable to double-click or drag/drop files to open.

    I'm running Photoshop CC 64 on a Windows 7 64 machine and am only able to open files in Photoshop by going to File->Open. Double-clicking from Explorer doesn't work and i can not drag/drop files into the open application window or taskbar icon. Right clicking on files and selecting "Open with" also doesn't work.
    I checked file associations and made sure to choose CC 64. If I right click on the shortcut and choose "Run As Administrator" which I have to do in order to get files to open between Lightroom and Photoshop (both need to be Run As Administrator), I'm still unable to open from Windows Explorer. However, if I check the box to "Run this program as administrator" in the shortcut's Compatibility tab, I can double-click to open from Explorer but am prompted with a UAC warning every time. Dragging/dropping into the open app still doesn't work.
    Opening between Bridge and PS works as expected so long as both programs are "Run As Administrator"
    Been searching the forums here and seen suggestions of similar but not the same issue, at least not that I've found.
    Anyone else experiencing? Suggested remedies?

    This is an OS permission problem.  Make sure you have ownership of the HD.  Do a web search on how to check.  External HD can be a problem for permission.

Maybe you are looking for