How to decide if a selected Flash object is the object of the right

Hello

I do a point-and-click Flash game and the objective of the game is to click on the right objects in a room. Say that if the main character says 'find my chair', and the player clicks on the Chair, it's the right object and an audio file is read. If the player clicks on a spoon, it's the bad object and an audio file is read. My question is: How can I do this in Flash (in ActionScript, right)? I did a different layer for each object.

First you need something that identifies the object that you click and store this information for the purpose of comparison.  Then, you need to have something assigned to each element that has the same exact information are entrusted to him.  If you are using AS3 then you can use a listener of events like MouseEvent.CLICK to clicks and then make use of the MouseEvent currentTarget property to isolate the object that was clicked.

Suppose you have a movieclip with an instance name of Chair.  You can check for the name of this object against the current name of the object that should be clicked...

var correctObject:String = "Chair";  You EF it dynamically sort

chair.addEventListener (MouseEvent.CLICK, testObjectClicked);

spoon.addEventListener (MouseEvent.CLICK, testObjectClicked);

function testObjectClicked(evt:MouseEvent):void {}

if(evt.currentTarget.Name == correctObject) {}

correct response process

} else {}

incorrect process

}

}

Tags: Adobe Animate

Similar Questions

  • How to upgrade version of adobe flash player on the tablet of Microsoft Surface?

    How to upgrade version of adobe flash player on the tablet of Microsoft Surface?

    Go to search the web, it appears on the surface Rt comes with adobe flash 11.3 it is the last version that is compatible with the RT 11.5 was released, but he is not yet a compatible system for the surface.  I would say that windows update will tell us when a new version comes out.  If you want to force the installation when the update is made available, I suggest searching for "install optional updates ' which will allow you to install then right rather than opening the item updates control because it only allows you to check (all by the charm of the search)!

  • How to write a simple select query to get the data of the table as an XML.

    How to write a simple select query to get the data of the table as an XML. In the query, I'm just adding items below which i need be there in the XML document
    select '<test_tag>'||EMP_NAME||'</test_tag>','<date>'||sysdate||'</date>' 
    from temp_table where id_num BETWEEN 1 AND 10;
    I have need to add the root tag as well in the beginning and the end of < root > < / root > this xml file. Please advice if this is possible with the select query
    without using XMLGEN, XMLQUERY or any other packages built and function?

    I need to URL escapes with the UTF-8 code points that we have already achieved using the utl_http package. Please help how to do that without using the utl_http package.

    What is wrong with him?

    At present, the only way I can think of to avoid a call to UTL_HTTP. SET_BODY_CHARSET is to write your own little wrapper.
    In this way, you can specify the Boolean parameter or omit it if you choose to use named parameters:

    SQL> create or replace function my_url_escape (url in varchar2)
      2  return varchar2
      3  deterministic
      4  is
      5  begin
      6   return utl_url.escape(url, false, 'AL32UTF8');
      7  end;
      8  /
    
    Function created
    
    SQL> select my_url_escape('http://some.uri.com/param?lang=fr&text=contrôle') from dual;
    
    MY_URL_ESCAPE('HTTP://SOME.URI
    --------------------------------------------------------------------------------
    http://some.uri.com/param?lang=fr&text=contr%C3%B4le
     
    
  • How to rotate my office of 90 degrees to the right so I can read without turning my head to the side?

    Original title: guidance office

    How to rotate my office of 90 degrees to the right so I can read without turning my head to the side?

    Thank you very much

    Very often caused by cats or other pets stray free!

    Hold down the Alt and Ctrl key and try the up/down/left/right arrows to change the rotation of the screen. Sometimes this has no effect, but I hope that you will be lucky, or it can become a little involved because it depends on your display driver software. Somewhere in your driver software display, accessible from the Control Panel/display/settings/advanced, there should be a screen rotation option. Unfortunately, each pilot is likely to be unique in the way that you pick this option and, unless I had the same driver, I couldn't give you anything more than general advice already given.

    Tricky

  • Open Media Player to the right off the screen. to-do bar the media icon flashes open to the right of the screen.

    Open Media Player to the right off the screen. Media player icon taskbar flashes open to the right of the screen.

    For WMP do return to the screen, follow the instructions at why WMP does not open when I run? I only get an icon for it on the task bar. Tim Baets
    http://www.BM-productions.TK

  • How can I publish a Flash ani without the right scroll bar?

    My customer wants to its pages without the right scroll bar. I know it's a little crazy on his part, but it's what he wants. How can I publish ani Flash so that there is no vertical scroll bar on the right side? Here is the example he uses...

    http://www.montageagency.com/

    Thank you!

    This link has a scroll bar vertical ie.  FF displays a scroll bar, unless it is necessary.

    Add

    style = "overflow: auto".

    the body of your html page tag

  • How to get page numbers in toc shift to the right

    Hello

    I'm working on a table of contents and try to get the (3, 4, 5, 7) page numbers against the level 1 and level 2] headers to the right. I don't know how to proceed. I would appreciate your help.

    Lee is the screenshot:

    toc.PNG

    Thank you

    You should have a tab between the number of para and text entry, as well as between the text and the page number, but do not display your text symbols (Type > show hidden characters) so I can't see them. Assuming they are there and the two paras TOC use header level 1 and level 2 header by styles (just uncertain of the page, but if I have a para tag names wrong, just replace the good):

    1. Click on the first line of the table of contents.
    2. Type > tabs.
    3. Set a left tab align the left edge of the text entry and a tab right-align by a point of the leader of the page number. (To add: select the type of tab in the tab at the top on the left, then click on above the rule.) You can drag them left/right to move. A selected tab is highlighted in blue or orange, and you can add the point of leading to a selected tab.)
    4. With the cursor on the first line, right-click on the name of the style and redefine the style so that the other 1-level headers are updated.
    5. On the second line, drag the left triangle below to indent the line (the upper triangle comes along for the ride). Adds a tab on the left for text entry and a right tab by a point behind the leader for the number of page, under step 3 above.
    6. Level 3 header and Style to redefine a right click.
    7. Fact!

    For more information, see create a table of contents in Adobe InDesign and set tabs and indents in Adobe InDesign .

  • How can I add a video iPhone portrait on the right with text on the left?

    Hello

    I'm new to the premier pro and I have had a look online but can't find the instructions on adding a video portrait on the right with text on the left. I found information on add a title on top and using blending modes, but how can I move the iPhone video portrait to the right of the screen to maintain the proportion of the landscape?

    Thank you

    Jess

    Basically, you use the motion in the effect controls panel effect, specifically the balance and Position. The next page has links to video tutorials both on photo in photo workflows:

    Adobe Premiere Pro help. Create common results

  • How to add "Add to selection windows media" to the context menu of the Explorer in Windows Vista 32/WMP 11?

    Hello. I am currently looking for a way to queue files flv and mp4 in WMP 11 in Windows Vista. I used to be able to do with Shark007 Windows Vista installed Codec, but I recently replaced it with a combination of ffdshow, Haali Media Splitter and open source Flash Video Splitter; This combination has been recommended as being superior to my old codec pack.

    I found a similar topic and solution, for Windows 7 / WMP 12:
    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-sound/how-to-add-add-to-Windows-Media-playlist-to/eb5ff6a0-5260-47de-903F-00bca38edc14

    Someone knows how to adapt the solution here for use with Vista?

    Copy-paste all below into Notepad and save it as FLVMP4Enqueue.reg. Then double-click on this file to add it to the registry. After that, you may have to reassociate the FLV/MP4 files with WMP, via Control Panel - default programs .

    -----------------------

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\.flv]
    @= "flvfile.

    [HKEY_CLASSES_ROOT\flvfile\shellex\ContextMenuHandlers]

    [HKEY_CLASSES_ROOT\flvfile\shellex\ContextMenuHandlers\WMPAddToPlaylist]
    @= "{F1B9284F-E9DC-4e68-9D7E-42362A59F0FD}".

    [HKEY_CLASSES_ROOT\flvfile\shellex\ContextMenuHandlers\WMPPlayAsPlaylist]
    @= "{CE3FB1D1-02AE-4a5f-A6E9-D9F1B4073E6C}".

    [HKEY_CLASSES_ROOT\.mp4]
    @= "mp4file".

    [HKEY_CLASSES_ROOT\mp4file\shellex\ContextMenuHandlers]

    [HKEY_CLASSES_ROOT\mp4file\shellex\ContextMenuHandlers\WMPAddToPlaylist]
    @= "{F1B9284F-E9DC-4e68-9D7E-42362A59F0FD}".

    [HKEY_CLASSES_ROOT\mp4file\shellex\ContextMenuHandlers\WMPPlayAsPlaylist]
    @= "{CE3FB1D1-02AE-4a5f-A6E9-D9F1B4073E6C}".

  • How to decide if Win or Mac OSX see the CD?

    I was wondering how to control if the host (Mac OS X 10.6.3) or the prompt (Win 7) sees a CD that I put in my MacBook Pro?  For example, I put a CD of music all the time and Windows Media Player came automatically, but I would rather play in iTunes on the Mac side.  How can I control which side of the system sees media I put in, be it a CD, DVD, flash drive, or something else?

    With the default settings, it is one that is in front when you insert the CD. You can change who has the CD by going to the Virtual Machine > CD/DVD > CD/DVD connect (or disconnect CD/DVD).

  • How export a classical music files to a flash drive in the right order?

    How can we keep the music files in the correct order when exported from a playlist on an external drive? Once the external hard disk, they are all mixed up!

    The order of storing files on a drive doesn't really matter.  When you view the player using the Finder, they are sorted and displayed based on the current state of the Finder window (for example, alphabetically by filename or sorted by file size).  You don't see the files in any real order.

    What is the real question you ask?  Why is it necessary to have music files stored in a certain order?

  • Windows 2003 R2 how can I define a group do not have the right to remove the higher level folders on a shared drive or folder still have full rights on all subfolders and files?

    I have a client who had a user to remove a folder on a shared drive that has removed several files.  He does not want users to be able to delete the main folder, but he wants that they have all rights to their files/folders under the main folder.  How is that possible?

    Hi CNG13,

    Because the question you posted is related to Windows Server 2008 R2, it would be better suited in the Windows Technet Forum. Please visit the link below and the message your question in the TechNet Windows Server forum:

    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer

    Concerning

    Jeremy K
    Microsoft Answers Support Engineer

  • How can copy text from a PDF file in the right order?

    I get texts translation of customers in PDF files. I need to copy some of the text of these files in Word, but the selection of Adobe jumps tool documents around, seemingly at random, sort of paragraphs and lines from different locations on a page are automatically selected together. The tables are particularly bad. If I try to copy an entire file, receives yet more random order. For example, all the titles of the document can be gathered in one place. I tried various PDF conversion software. They put all the PDF content in the areas of text, which is not suitable for my purposes. I want to just copy the PDF files in the exact order in which they appear on the page in text form that I can handle in Word. I'm now up to version 9.3.0 and there has been no improvement. Is there a solution to this problem?

    Hey, Marcoola.

    I agree that by copying and sticky from PDF to Word maunally are really difficult and tedious work. I have encounterd this problem before. Fortunately the problem can be solved perfectly now. I recommend AnyBizSoft PDF to Word Converter, which is totally free for months before. This conversion mode supports three app - batch, partial, right-click conversion and it even supports encrypted PDF conversion, previously you must have legal rights. And the conversion quality is superb, all the original text, page, images and hyperlinks will be preserved in an editable word document. It is more useful than those software online for free. It will be useful.

  • How do I remove a single white line on the right side of the printed page

    Appears on all printed pages, regardless of the source.  Kaleidoscope, cleaning, installation of new print heads and the linefeed calibration solves the problem.  The printer is an Officejet Pro 8500 a Premium.  Thank you.  I'd hate to throw a 18 month old printer in the trash.

    When you say that the issue is on the right side you mean the right side (and along the way on paper) when printing in portriat mode?  If so the problem may be due to a spot on the MICR band.  It is a fragile and delicate, tape printed with hundreds of lines per inch that the printer uses to know where the print head on the entire page.  Cleaning the MICR band, as described in this post can help solve the problem.  Be sure to heed the warnings.

  • How can I use EventInjector.TrackwheelEvent to scroll to the right and left?

    I need to simulate a right wheel and a wheel left action.

    I used to scroll up and down the following successfully:

    EventInjector.TrackwheelEvent.THUMB_ROLL_UP

    EventInjector.TrackwheelEvent.THUMB_ROLL_DOWN

    Any ideas?

    On devices on the wheel, by using Alt + scroll is used by many applications for the movement of left and right.

    If you target trackball devices, you can navigate in all directions by injecting an EventInjector.NavigationEvent event.

Maybe you are looking for

  • Time machine on a usb hub

    Last summer, my iMac (running El Capitan) 2010 started hooking serious problems where the only solution would be to perform a reboot of the material.  After much experimentation and running on an external drive, I discovered that Time Machine was the

  • Ink Exchange

    I recently broke the paper tray to my HP Officejet J4580 printer and after extensive research found was no longer available for replacement. I buy a new printer, HP Deskjet 1512, but I closed the ink cartridges I would trade to adapt to the new print

  • Superdisk 120 MB for Windows XP driver

    Recently I had to reformat my hard drive.  I use Windows XP and the pilot lost my Imation Superdisk 120 MB drive.  Any suggestions how to get it? Thank you Paul

  • PC Backup doesn't work no-internal error: Server execution failed - error Code 0 x 80080005

    Hello I use Vista Business SP2. I'm having a problem with Windows complete PC Backup. When I click on the "create backup now" trying to create a full backup of the computer, spends about 15 seconds and then this message: The backup application could

  • Cancellation of purchase

    HelloCan anyone help me on how to cancel my subscription to another. I accidentally buy twice on the same ID.Hope you can help us. Thank you