Drag and Drop and if / then of statements...

I'm new to flash, so forgive me if it's a simple thing (I hope it is!)

I have a movie that has elements that I am about to put to the drag and drop function. I know how to do that, I'm fine with that. But I want to be able to code where, once they click the button "done" on the screen of the slide / move, all that is not in a given region is set to invisible.

For example, I make a scene where you can drag and drop different objects, clothing, etc. on a man of snow to decorate him. When they click then I want just the snow man and all the parts on him to be seen in the following image.

Any help would be great. Thank you!

all your clothes can be added to a parent of clothing to initialize:

clothesParent.addChild (shirt);

clothesParent.addChild (shoes);

etc.

assign your drag and drop to the shirt, shoes, etc.

in your drop test the dropTarget function and if a proper use:

function dropF(e:Event):void {}

{if(e.currentTarget.DropTarget==Snowman)}

snowman.addChild (e.currentTarget);

Snap to position and remove the listener

}

}

nextbutton.addEventListener (MouseEvent.CLICK, nextF);

function nextF(e:Event): {}

clothesParent.visible = false;

}

Tags: Adobe Animate

Similar Questions

  • How to display an object while ALT-do drag and copy, then release?

    Hello

    I'm working on Indesign version 8.0.1 with my new Macbook, but when I duplicate an object, it will not show the object when I'm dragging all by pressing ALT. I can only see part of the object, but not the object itself, until I actually pick up, which is really a lot of time and practice. It wasn't a problem on my computer where I work. Anyone know if this has something to do with preferences?


    Thank you, any help is appreciated!

    Instead of just dragging. ALT + click and for a second or more.

    And then drag.

    You can also set your preferences to draw immediate live

    but I suggest that, as it can slow performance of InDesign considerably.

    Bob

  • Hi, I use iTunes 12.3.2.35 on a Windows 7 computer. I don't seem to be able to import files from a CD that contains the files on it as mp3 files. If I launch iTune and then put the CD in, it doesn't appear and I can't drag and drop.

    Hi, I use iTunes 12.3.2.35 on a Windows 7 computer. I don't seem to be able to import files from a CD that contains the files on it as mp3 files. If I start iTunes and then put the CD in, it doesn't appear and I can't drag and drop.

    It would not seem like an audio CD, as a drive in this way is a data disc when it contains mp3 files. You would need to access the file menu in iTunes, manage files here. If you manually manage music, you will need to access it as a regular folder on your computer. In iTunes, go to file > add file to library, and select individual files.

  • If I drag and drop a program of (F) and (C) and then remove the program on (F)?

    If I drag and drop a program of (F) and (C) and then remove the program on (F)?

    It is called: C_Drive.V21, there 2 905 088 KB.
    I have no idea what it is or does, but I'm trying free space on disk (F), so can I remove the disk (F) it?

    It is not "a program".  Assuming that the last character is actually a tiny 'eye' (i) instead of a number 1, it's a Symantec Ghost image file (some versions).  Do you use ghosts?  Have you used the ghost?

    If you still have Ghost installed, you can probably use to investigate on what is in the file.

    Check the date of the file.  If it's an image of your C drive for a long time, maybe you don't need more.

  • Captivate 9 Drag and Drop DropIncorrect State does not

    Hello!

    I ve done a Drag and Drop interaction, where I have 4 targets and 4 drag only one correct answer for each of the sources. I've added States for Drop targets:

    DropCorrect State, The target turns Green when pressing submit, and the answer is correct.

    DropIncorrect State, target Drop becomes Red when press submit and answer is incorrect.

    I thought that it would be a good way to show the user which targets Drop are correct and which aims to drop they must change to get the right answer.

    When the answer is correct, Drop targets turns green and I made an action that says "OK, click anywhere to continue."

    BUT when the answer is wrong, nothing happens to the colors of the Drop target. It s just a failed, Try Again message. Nothing more.

    Why isn´t the State DropIncorrect showing when I press the submit button and the answer is incorrect?

    I just checked the file of this article, which was created on an earlier version of 9 and it works well also for the State of DropInCorrect, but I have only 1 attempt! I suspect that your endless attempts are the cause of the DropIncorrect does not. Compare it with actions on a question slide: success action will be performed when the answer is correct, but the other action will be done only at the last attempt is finished and the answer is wrong. Since you have endless attempts, this last attempt event never occurs.

    Sorry for the late reply, wanted to check a second time and has been very busy today.

  • Missing folder then drag and drop on the OBIEE catalog view

    Hi guys.

    I had a folder on shared folders and I moved it to a different folder on shared too, using a simple drag and drop on the catalog on OBIEE view and everything by moving my browser crashed.

    When I logged on again, my folder disappeared. He disappeared, I couldn't find it on the place of origin or target folder.

    Any idea to solve this problem? I lost more than 50 analysis and 10 dashboards.

    Kind regards.

    Luiz Araujo

    Hello Luiz,

    The easiest way is to restore a backup of your catalog, you have one, right?

    In case you have not one there is 2 things you can do:

    (1) set up a backup of your server of BI to the next crash drag & drop

    (2) try to look if you find the folder on the file system: If the problemcs file does not exist or has a problem objects are invisible in OBIEE, so first check if the physical content is still there and if find you there is a way to get it back...

  • Alternate the position of drag and then drop items

    Randomization of the starting position of draggable elements is a fairly common evaluation strategy.  It is clear that it was an option with Captivate at a given time (see using Interactive Drag and Drop Widget |) Infosemantics Pty Ltd ), but I can't find this option in Captivate 9.  Is there an option "randomize positions initials drag" anywhere in this new version of Captivate?  It would be fantastic to swap places so anywhere on the stage.

    The great widget you are pointing to, is not included in Captivate, but developed by external sources (not free). I'm sorry to tell you that the integrated drag drop & does not have this feature.  The old widget is still available but output SWF's. D & D Captivate can also be used for HTML, but does not have some features such as SWF-widget. I agree that it would be a great improvement, you can log a feature request?

  • Drop + Drag and ADF tree ContextMenu

    Hello

    I have a tree that acts as a listener of the drop (and the source of a drag too). This tree needs to have a context menu activated on option to perform various options such as deleting/adding nodes etc.
    All context menu options work as fine, until it is time to drag and drop operation is not performed. Time, any DND operation is performed on the tree menu popup does not appear.

    If I do not add a context menu in the < f: facet = 'contextMenu' name / >, even then the default context menu appears after DnD, but having a code to have the custom in this facet context, makes the context shuts after action by DND.

    I tried to make the option of PPR to refresh the tree as in the post.

    Context menu on right click of the af:tree node

    But also, this did not help. If I open the same URL in a new window once again, he has the available context menu, but once again until no DND is done. All this makes me feel, which probably the drop operation is somehow altering the State of the tree which is the origin of the context menu not to run again. Tried all combinations possible, but nothing has worked so far.

    Would be grateful and help/suggestions.

    I use JDeveloper 11.1.1.6.

    Thank you
    Sachin

    Hello

    the problem is because you change the key of the current row programmatically. To resolve the problem, you do the following

       //memorize current row key
       Object currentRowKey = tree.getRowKey();
    
       .... do your stuff here
       //set current row key back
    
       tree.setRowKey(currentRowKey);
    

    Frank

  • Drag and drop the multipul opportunities

    I had this idea to do an activity for fractions using drag and drop with interaction, and even though I know that it is possible to go, it'll take awhile, especially if I'm going to several questions in the same vein.  I hope there is an easier way to do what I think...

    So here is my idea.  I have a picture of a pizza on the screen (cut into 8 sections) established and little gray so they drop targets.  I also have the targets of all 8 drag slices around the screen so that users can drag the pizza (each slice corresponds to the full pizza and will be recognized by their corresponding section).  anyway... that part is fine.  The problem comes when the question is "drag slices on the pizza to create 5/8.  Now, there are a LOT of possibilities for this... and I can configure each of these possibilities in the window 'Good answers' - but as you can imagine, that would take forever!  Is it possible that I can configure the drop than the 1 article area, and still have the slices of pizza to fall into the correct zones (if we don't get slices placed in odd places) so that I can use the function 'account' to specify how many constitute a correct answer?  OR if anyone has any other ideas, I'm willing to try anything to avoid having to take account of all possible combinations for the correct answers.

    Thank you!

    Wanda

    Oh my god!!! I thought about it!  This is my first time using variables, but I created a variable called pizzacounter and set it to 1.  Then I put the advanced actions that whenever a slice of pizza dropped it would add 1 to the varriable of pizza.  Then I added a "check" button, and put in the statement conditional action advanced to check if it the pizzacounter is equal to 5, and then he would show that he is STRAIGHT!  Wow - this will make my life so much easier!

  • Text comments for support of Drag and Drop Interaction

    I developed a drag and drop interaction that works well, the problem is with the behavior of the reset button send.

    If the objects of slide 'proper' are on the 'right' target - no problem

    The problem is if a combination of drag-and-drop 'wrong' is selected, displays the text 'wrong' feedback and the reset button moves all drag the object to the starting position, but once that the 'good' drag drop combination is submitted, the 'wrong' feedback text appears.

    The fla is available here: skydrive.live.com/?cid=bb539b6eff0afbf5 & sc = documents & uc = 1 & id = BB539B6 EFF0AFBF5% 21114 #

    Thanks in advance for any help/suggestions, you can provide and for taking the time to read this post

    The corresponding code is:

    Section 1:

    ActionScript code:

     

    function dragSetup(clip, targ) { clip.onPress = function() { startDrag(this); this.beingDragged=true; }; clip.onRelease = clip.onReleaseOutside=function () { stopDrag(); this.beingDragged=false; if (eval(this._droptarget) == targ) { this.onTarget = true; _root.targ.gotoAndStop(2); } else { this.onTarget = false; _root.targ.gotoAndStop(1); } }; //the variables below will store the clips starting position clip.myHomeX = clip._x; clip.myHomeY = clip._y; //the variables below will store the clips end position clip.myFinalX = targ._x; clip.myFinalY = targ._y; clip.onEnterFrame = function() { //all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged) // then move the MC back to its original starting point (with a smooth motion)" if (!this.beingDragged && !this.onTarget) { this._x -= (this._x-this.myHomeX)/5; this._y -= (this._y-this.myHomeY)/5; //if the drag object is dropped on any part of the target it slides to the center of the target } else if (!this.beingDragged && this.onTarget) { this._x -= (this._x-this.myFinalX)/5; this._y -= (this._y-this.myFinalY)/5; } }; } dragSetup(drag1,drop1); dragSetup(drag2,drop2); dragSetup(drag3,drop3); dragSetup(drag4,drop4); dragSetup(drag5,drop5); dragSetup(drag6,drop6); dragSetup(drag7,drop7);

     

    on the submitBtn:

    ActionScript code:

     

    on (press) {     if ((_root.drag1._droptarget == "/drop1") &&         (_root.drag2._droptarget == "/drop2") &&         (_root.drag3._droptarget == "/drop3") &&         (_root.drag4._droptarget != "/drop4") &&         (_root.drag5._droptarget != "/drop5") &&         (_root.drag6._droptarget != "/drop6") &&         (_root.drag7._droptarget != "/drop7"))     {         {             resetBtn.enabled = false;         };         {             feedbackTxt = "Yes, hardware installation, asset tagging and imaging are the best services to recommend to help your customer meet her deadline.";         };         {             drag1.enabled = false;             drag2.enabled = false;             drag3.enabled = false;             drag4.enabled = false;             drag5.enabled = false;             drag6.enabled = false;             drag7.enabled = false;         };     }     else     {         feedbackTxt = "Not quite.  At least one of services you chose isn't the best recommendation, or you did not chose all of the correct services.  Consider your customers business needs, click Reset and try again.";         gotoAndPlay("Scene 1", 1);     } }

     

    on the resetBtn:

    ActionScript code:

     

    //this code controls the reset button function and returns all of the drag objects to the start position. on(Press) {  drag1.onTarget=false; drag1._x = drag1.myHomeX; drag1._y = drag1.myHomeY;  drag2.onTarget=false; drag2._x = drag2.myHomeX; drag2._y = drag2.myHomeY;  drag3.onTarget=false; drag3._x = drag3.myHomeX; drag3._y = drag3.myHomeY;  drag4.onTarget=false; drag4._x = drag4.myHomeX; drag4._y = drag4.myHomeY;  drag5.onTarget=false; drag5._x = drag5.myHomeX; drag5._y = drag5.myHomeY;  drag6.onTarget=false; drag6._x = drag6.myHomeX; drag6._y = drag6.myHomeY;  drag7.onTarget=false; drag7._x = drag7.myHomeX; drag7._y = drag7.myHomeY;  feedbackTxt = ""}

     

    include your onTarget in the if statement, not only 3 of them.

  • Drag-and - drop off the stage

    Hello

    I developed a simple drag and drop learning object, which works exactly as I intend also except for a small problem.

    I have a selection of labels and each has its own variables X and Y; now, when I drag a label if I hit the target, then it fell into place and if I miss my target, he called the variable number for X and Y of the MovieClip and it snaps back on its original coordinates - great.

    The problem I have found is when I drag the label now my left hand mouse button to the edge of my scene, as my mouse cursor holding the passes of the label of within the scene for out I lose my hand icon and the label is in limbo until I bring it in the scene but then I have to drop the label inside the scene and the variable X and There no longer holds the original coordinates of MovieClip, but is crushed it seems the new coordinates near the edge of the stage, so the snap going back at the edge of the stage and not there where it belongs.

    I went in the way of the creation of a rectangle, obliged to keep the label within the scene but I've hit the limit he unfortunatley serves pretty much the same way when I drag off stage.

    I understand that AS3 is tuned a MOUSE event and that he can't listen to when the cursor is outside the scene; I came across the function MOUSE LEAVE would that work? Basically I want my code to detect when the MovieClip was dragged out of the scene and automatically deliver it to the coordinates that is held within the variables X and Y and trailing stop leaving the user to try again.

    Any help would be great guys, thanks a lot.

    First of all, I would not attribute this listener until the movement was initiated, it would disappear after you stop dragging.

    Second, your conditions in your if() statement can never be met.  You want to use. instead of &.

  • How drag and drop a picture into a shape of the object?

    On my old Lion system that I used to be able to drag a picture from iphoto in the shape of the object open in Pages.  I can't be able to do more.  The system changed?  I tried to use Inspector (under help), but it won't let me access the file of the photo on the right.

    You can drag and drop a picture in a form in v4.3 Pages ' 09, but this can be done in any version of v5 Pages. Quite different applications, as well as more recent Pages has lost about 100 features that were in its antecedent.

    Check if you have Pages ' 09 v4.3 in your Applications: iWork ' 09 file. If so, use it.

    Pages v5 requires that you select a shape, and then on the Image tab in the right panel, you choose Image, scale to fill fill, and then select your image for the background. You cannot select this image from the inside, but you can add text to the form that will appear on your image.

  • Why is it I can't drag and drop to reorganize bookmarks?

    Drag and drop does not work to rearrange bookmarks in the toolbar bookmarks, window "Show all bookmarks", or in the bookmarks menu. I can 'Cut' and 'Paste' to rearrange things and works in all three, but it's the only way.

    I am running Windows 8.1 x 64 and Firefox 31.0

    Had a similar problem (could not drag the tabs or bookmarks, to reorganize their) with FF 32.0.3. Tried rebooting with the disabled modules, but it still doesn't work. Then tried deactivation and reactivation of hardware acceleration, and it began to work without restart. After the restart with active modules, it continued to work. Weird.

  • Why can I I is no longer drag and drop photos directly from photos of apple in the Pages?

    Until very recently, you can take a photo from iphoto/photos and then quickly drag and drop directly into the Pages. Now, I have to drag and drop the photo on the desktop, then drag and drop again from office to the Pages. Is this just a way more Apple is dumbing things down and make things slower for those who already know how to use their software or some setting I'm not aware of?

    In the Pages v5.6.2, you can click, drag and drop an image from the Photos app in the page document related, just as you can from the media tool in the toolbar of the Pages v5.6.2.

    To get an image from Photos in a Pages ' 09 v4.3 document, you must click on the image you want in Photos and menu editing: copy, right click in the document to Pages ' 09 followed to select Paste from the context menu. There is no drag and drop Photos in Pages ' 09 v4.3. There is no access to the photo library within the Pages ' 09 v4.3 support tool.

    Tested: OS X 10.11.5.

  • Cannot resize firefox so I can drag and drop to create a shortcut

    I can't make my Firefox page smaller so I can drag and drop a web site to create a shortcut. I use windows 7. I have no flu when I point at the bottom right. When I use zoom the page itself re sizes but not the window. I just need to see a bit of my office, so I can create a shortcut.

    Hi limomitch, Firefox will remember the last 'normal' window size by saving in this file you deleted (which Firefox creates new). To switch between the normal and maximized window styles, you usually just double-click the title bar of the window, or you can use the middle (the one between minimize and close) button in the upper right corner.

    If you find that the 'normal' window size has increased too, and if the lower right corner is not visible, you can try Alt + SPACEBAR. It is a convention of Windows on the scale to display the window control menu. If the size is not gray, press arrow down once, then the up arrow key repeatedly until the lower edge of the window is in view. Repeat with the left if necessary and right keys. (If the size is dimmed, choose restore and that might be all you need).

Maybe you are looking for