Drag and drop them into simple errors of target, expecting identifier?

IM creating a drag and drop. pass a guitarest name to a dragging for example, target a movieclip called slash to a dynamic text box called box_slash this is my code and I get 2 silly mistakes, but have been up all night and he can not know!

flash cs5 actionscript 3, this is the code for actionscript3 I found the basis for him here: http://edutechwiki.unige.ch/en/Flash_drag_and_drop_tutorial any help would be amazing for a transfer and im new to Flash

var = 0 hits;

Registry of the mouse event functions

slash.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

slash.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

clapton.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

clapton.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

hendrix.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

hendix.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

Set a mouse down Manager (the user is dragging)

function mouseDownHandler(evt:MouseEvent):void {}

var object = evt.target;

We have to limit them by dragging to the area inside the canvas

object.startDrag ();

}

function mouseUpHandler(evt:MouseEvent):void {}

var obj = evt.target;

obj.dropTarget will give us the reference to the form of

the object on which we have abandoned the circle.

var target = obj.dropTarget;

If the target object is the we ask the test_match function

compare moved obj, and target where he was abandoned.

If (target! = null)

{

test_match (target, obj);

}

obj.stopDrag ();

}

function test_match (target, obj) {}

test if one of the four pairs match

If ((cible == box_slash & & obj == slash) |)

(target == box_clapton & & obj == clapton) |

(cible == box_hendrix & & obj == hendrix) |)

{

We got a great success

Hits = hits + 1;

textField.text = "" OK! :) ";"

make the object transparent

obj.Alpha = 0.5;

kill its event listeners - object cannot be moved more

obj.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

obj.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

Test if we are done

If (hits is 3)

{

textField.text = "well done";

}

}

on the other

{

textField.text = ' bad!:(";).

}

}

errors are: I've highlighted lines

Scene 1, Layer 'Actions', frame 1, line 391084: syntax error: expecting rightparen before leftbrace.
Scene 1, Layer 'Actions', frame 1, line 381084: syntax error: expecting identifier before rightparen.

sprites and movieclips can be dragged/dropped, not simple buttons.

use a movieclip button (so you can use startDrag with it) or use an enterframe loop that causes your easy button to use the mouse (which resembles a startDrag).

Tags: Adobe Animate

Similar Questions

  • Cannot drag and drop songs into the playlist in windows media player.

    We just got a new laptop with windows 7 and I guess windows media player the windows media player 12. I tried to add songs on my mp3 player. After I rip the songs on the cd, I can't drag and drop them in my playlist. When I drag a song it shows a picture of the cover of the cd, with the words "a track" on this subject and a red circle with a slash but it. He didn't let me down. I've never had a problem with media player before on our other computer. I'm doing something wrong or something is wrong with my drive? I tried different CD 2 and 2 separate mp3 players.

    Thank you
    Amber

    It seems OK, can I have solved the problem. Still not sure what was going on. Thank you

  • How to import or drag and drop photos into Windows Live Movie Maker?

    I'm unable to either import or drag and drop photos into Windows Live Movie Maker.  I just finished a movie and when I try to open a new project, I click on "Add photos and video", taking me to 'my pictures', but when I try to open him "add photos and video", the "file name" has so much history, it doesn't allow me to click on the location of my file.  How can I get rid of this story?  The first film was so easy, but this new project has been up to this impossible after about 7 hours of attempts.  Help, please!

    Hi Anniebp2,

    I think perhaps the best next step after all your efforts of trying to fix the program.  For this, since it is part of the Windows Essentials pack, you can go to the page Windows Essentials and re - download and re-install the package, which will update and fix the movie maker if necessary. I hope that this solves the problem for you. Please let me know how it goes.

  • Cannot drag and drop photos into Photoshop CS6

    I'm having this problem since the last time that I formatted my computer and it's really annoying.

    Basically, when I try to drag an image in photoshop, the sliders turns into a circle with a slash in there (not available).

    I peut open files by right click and choose 'open with-> Adobe Photoshop CS6' and I peut also open with "file > open... '. "(ctrl + O)

    I searched for a soltion to this and nothing worked.

    That's what I've tried so far:

    -Reset the preferences (ctrl + alt + shift)

    -Run with administrative rights

    -During the run without administrative rights

    -Make sure, I have the permissions for files

    -Making sure the files are not set ReadOnly

    -Change the scratch disk option (Preferences-> Performance)

    None of these worked and I'm looking for another solution...

    Here are my PC specs:

    OS: Microsoft Windows 7 Ultimate 32-bit SP1

    CPU: Intel Core 2 Quad Q8300 2.50 GHz

    RAM: 4.00 GB Dual - Channel DDR2 400 MHz

    Motherboard: Gigabyte Technology Co., Ltd. G31M-ES2L

    Graphics card: 1024 MB GeForce GT 240 (nVidia)

    This thread might be considered old... but I found the solution and I wanted to post it in case someone else has the same problem.

    After you turn off the UAC (User Account Control), I was able to drag and drop photos into Photoshop.

  • I can't drag and drop files into the "cloud".

    When I click the icon "Download files", I can do but I need to download one at a time (I can't select multiple files using shift or control).  There are THOUSANDS of files, I want to spend.  I watched the video tutorial and I see the very simple way, he explains to drag and drop a folder on my computer to the 'cloud' which I think is a fancy way of saying that it is hard to Adobe and not mine.

    If I'm trying to drag and drop a PDF file, it only that opens the file in internet explorer, in the same window, on the same tab, then I click on the return button and I must return to my files, but the new file is not there.

    I just purchased the subscription, I was using this within half an hour, and I'm already frustrated of not being able to do the simplest tasks.  Help, please!  SID.  928 718-7777 Y there a number of technical support, or you can call me?

    Internet Explorer does not support "drag and drop" or the download of multiple files. These limitations are functions of security by Microsoft.

    Please try using Firefox or Chrome browsers.

  • How to keep the spaces outside the files when you drag and drop them in a .bat file.

    I have a bat file, where I run a powershell script passing one argument which is a folder name. I added the file beats in my office, so I could just drag and drop a folder in the Explorer on the bat file.

    Works very well. With the exception of a killer detail. When I drag and drop a folder that has spaces, the process does not receive the full path. Space is causing the script to fail. Thus, for example, I can't drag & drop c:\program files\ in the bat file.

    Is there some setting in which case I can force drag & drop to use filename not spaced? Why don't the OS automatically in the argument with the quotes around it?

    In a command environment that it is practical common to surround with quotes of files names. If the names contain no spaces, then double quotes can be omitted. That is why your batch file should read

    PowerShell.exe myscript.ps1 "%."

  • Just drag and drop them confirmation prompt? Accidentally move files.

    Since the upgrade to Windows 7, we had a problem with people who inadvertently move files by drag-and - drop when the meaning of double-click.  Is there a way to turn on a quick confirmation ("are you sure you want to... ") when drag / drop files/folders?  It seems that the previous versions of Windows had this prompt, but it has since been removed.  What is happening in our offices at least every week, sometimes every day, and we have to spend a lot of time searching for the moved folder.  If MS can't help, is there software that we can buy for this?

    Windows 7 has made no changes: there has never been a request for confirmation that you describe.

    One solution is to increase the distance you need to move the pointer before it triggers a drag.  Under the following registry key, you will see DragHeight and DragWidth, which define the number of pixels the mouse must move before the start of the operation drag is:
    Computer\HKEY_CURRENT\USER\Control Panel\Desktop
  • How to make the clip video symbols communicated once I drag and drop them in place

    Hello all and kglad, I have a problem with the actionscript code that was given to me which works very well but the only problem is that once I drag and drop the movie clip symbol it will not release the symbol in the case of sum I send you the code and someone please help this project is hot on my plate.

    See code below:

    f (subject2);

    function f(mc:MovieClip):Void {}
    mc.onPress = function() {}
    {if(!this.index)}
    This.index = 1;
    } else {}
    This.index ++;
    }
    var d: Number = this._parent.getNextHighestDepth ();
    this.swapDepths(d+1);
    var mcDup:MovieClip = this.duplicateMovieClip (this._name + this.index, d);
    this.startDrag ();
    f (mcDup);
    }
    mc.onRelease = function() {}
    this.stopDrag ();
    }
    }

    Seal55

    You must add:

    mc.onRelease = mc.onReleaseOutside = function() {}
    this.stopDrag ();
    }

    However, I find it odd that you set the anonymous functions inside another function that is a very bad strategy.

    Something more like this would be better, I think:

    function f(mc:MovieClip):Void {}
    mc.onPress = handlePress;
    mc.onRelease = handleRelease;

    mc.onReleaseOutside = handleRelease;
    }

    function handlePress() {}

    {if(!this.index)}
    This.index = 1;
    } else {}
    This.index ++;
    }
    var d: Number = this._parent.getNextHighestDepth ();
    this.swapDepths(d+1);
    var mcDup:MovieClip = this.duplicateMovieClip (this._name + this.index, d);
    this.startDrag ();
    f (mcDup);
    }

    }

    function handleRelease() {}

    this.stopDrag ();

    }

  • I can't just drag and drop photos into a folder in the order I want them?

    Windows XP and Vista allowed me to put pictures in the order I want. How do I do that in Windows 7?

    Manually with the photos in a folder by drag & drop...
    is not an option in Windows 7.

    The following article may be worth it.

    (FWIW... it's always a good idea to create a system)
    Restore point before editing the registry)

    Proceed at your own risk *.

    How to disable the automatic reorganization in Windows 7 Explorer have free tri
    http://www.SevenForums.com/tutorials/92758-Windows-Explorer-auto-arrange-disable.html

    Good luck...

  • Impossible to drag and drop photos into Lr6

    What happened to the file management in Lightroom? I have tons of experience using Lightroom (since version 1). I just installed version 6 and the library module is no longer will allow me to drag files from one folder to another. In frustration, I quit Lightroom and moved the files of my Finder, but now Lightroom also won't let me show it where the files and folders have been moved. Is this a bug? You will address them soon, I hope?

    Post edited by: Geoff Walker Title changed for clarity.

    First, I recognize that you have a question and you know what you're doing...

    Second, we are not mind readers - you tell us that you installed Lr6, very well. What is your Mac operating system and where you move files to and from.

    Providing detailed information, as this has already been asked will help those of us who are not telepathic to understand exactly what is happening.

    However, my first suggestion is to delete the preference files, strange things sometimes happen with those. https://helpx.Adobe.com/Lightroom/KB/preference-file-locations-Lightroom-41.html

    He just move somewhere with closed lightroom and restart lightroom.

    Post back the result as well as the number of Lightroom Pref files there... There may be a few lying around that can be trashed...

  • I want to transfer my cell phone Sprint 4 G images and drop them into my computer

    Please help I want to make my 4G from Sprint cell to my computer. Please helptransfer images

    Download the instructions from the manufacturer of your phone.

  • I use Zotero, I accidentally deleted several entries in my library. I was not able to recover them by drag-and - drop. What can I do to restore the items that are currently sitting in the trash?

    I accidentally deleted some of the elements in my Zotero library. I tried to restore, but I can not drag and drop them to the back in the library. I scoured the forums to see if I found a solution, but none of the suggestions work.

    This forum thread help?

    Zotero Forums - restoration of trash

  • When we organize our emails/landing pages into folders, is there the capacity drag-and - drop?

    Sometimes it does not work always when I record my work and I want to keep my tidy Eloqua platform! I have

    Hi Nathalie,.

    You can drag and drop in the selector (so for example, under the E-mail section, click on "Open an existing email" and opens the selector). If you are looking for in the selector, you will not be able to drag and drop the results of research, but if you want and instead simply navigate through the selector by clicking, you can drag and drop assets into a folder.

    If you want to drag to 'up' in the hierarchy of folders, you can drag the item to the track "Breadcrumb" above the list of files (so if you are in a folder called work in progress, the "breadcrumb" will look like Test-> file Some-> other folder-> current folder), like this:

  • Cannot drag and drop into the bar of pages in Acrobat Pro XI for Mac?

    MAC OSX 10.7.5

    Acrobat Pro XI

    In adobe Acrobat XI for Mac, how do I drag the pages of thumbnails of Pages box in the finder and make a new PDF?

    In windows I can simply select the pages, drag and drop them in Solution Explorer and creates a new PDF pages that I dragged.  I've tried everything on my Mac and I can't extract this way.

    It is extremely slow and frustrating to have to manually right click Extract, select pages, open in a new window from adobe, and then save the file in the menu.

    On windows, I just select the page, drag to the folder and click Rename.

    The same question and found the solution, the wire https://forums.adobe.com/thread/1348512 try67in response

    To zoom back, so that the entire page is visible, then drag & drop works fine, well, at least, it worked fine with me.

    I admit, it is odd though.

    =

  • Drag and drop the library not workingf

    I placed a number of graphics (.ai .ps, .eps, .pdf etc.) in a CC library. When Im in InDesgn I can see the items in the library, but when I try to drag and drop them on an open page, I get a message saying "the file does not exist or the file may be in use by another application."

    I've restarted the computer and only Indesign open so that the files are not in use.  The library icons next to the items. I can double click and use goods have been placed in InDesign, but the files in photoshop or Illustrator won't drag-and - drop or double click for use in InDesign.

    Is this to say that I cannot use InDesign created elements of library in InDesign and photoshop only elements in Photoshop etc. ?

    Carl

    I have the same problem

    I repeatedly appealed to tech support, but they couldn't help

    I solved the problem in this way:

    1. launch InDesign

    2 - Open a new document

    3 to drag and drop objects from the library CC

    4. I read the error message :-((()

    5. I swear :-)

    6. close InDesign

    7 - Repeat the pp. 1-3

    7A - if this does not work, I have to open Illustrator object and drag-and - drop library in Illustrator. And then I repeat s. 1-3

Maybe you are looking for