How can I check for an object name in a switch statement?

I have a bunch of button names that I will like to spend in a switch statement. I only am not really sure how to [object btnA] = btnA. Thank you.

[code]

var currentOBJ:Object = event.target;

name of the trace of something I clicked on the button

trace (Event.Target);

Switch (currentOBJ) {}

case 1:

currentOBJ = btnA; Name of the object is equal to btnA?

trace ("equal to currentOBJ btnA");

break;

by default:

trace ("no switch instructions have been respected");

}

[/ code]

In your case of switch, each case is the value you're teting...

Switch (currentOBJ) {}

case btnA;

and the name of the object will not be found using event.target, it's just an object.  If event.target is pointing to the button and it has a name property assigned to get the name you would use event.target.name.  It is usually safer to use event.currentTarget however because that will always point to the object that has the event listener are entrusted to him. Event.Target pint at something inside the button can.

Tags: Adobe Animate

Similar Questions

  • How can I check for dates that are the same for today.

    If I have a bunch of dates in a datetime colum. How can I check for dates that are the same for today.
    "For example, this value of days would be ' #dateFormat (now (),"mm dd yyyy") #

    The best I could come up with was:

    Select * from data where data.userID =
    2635 AND
    "Convert (varchar, dateAdded, 101) = ' #dateFormat (now (),"mm dd yyyy") #


    How can I get this to work smart peeople :)

    It is best to make the comparison on the datetime values. One technique is to get the current date at midnight. Then add one day to get tomorrow's date. In your sql query finds all values is greater than or equal to today and less than tomorrow.

    One solution is to do everything in MS SQL

    WHERE the dateAdded > = convert (datetime, convert (varchar, getdate(), 112), 112)
    AND dateAdded = dateAdd (d, 1, convert (datetime, convert (varchar, getdate(), 112), 112))

    Another option could be to use CF to calculate dates:


    WHERE the dateAdded > =.
    AND dateAdded<>

  • How can I check for the existence of a physical keyboard?

    I have a Q10 and a Z10, it has a physical keyboard, the other not.

    How can I check in my WebWorks app if the device has a physical keyboard?

    You can detect this by:

    community.deviceInfo.hasPhysicalKeyboard()
    

    Have a look here for more information: community.deviceInfo Extension Native for applications built using BlackBerry WebWorks 10

  • How to check if the value of text is in a view accessor? How can I check for validation?

    Hi Experts ADF,

    JDeveloper 12.1.1.3.0

    I have a VO with a Segment1 column. And I have an accessor in my VO as SegmentVA which contains all the numbers.

    So in the user interface, I'm having a Segment1 as an inputText. The user should then enter values in inputText.  How can I check to validate that the value you enter must be valid within the ViewAccessor.

    Thank you

    Animesh

    You can use a declarative approach and define the Validation rule on EO attribute.

    Or you can create the method in your ViewObjectImpl class, expose this method as a customer interface, create custom for your input field validator and invoke the VO method from there.

    Dario

  • How can we check for: "faxrda.lpc 115.47.

    Patch No. 4769031
    Summary: 1OFF:3942233:11.5.10:FP. F:FA. O: MISSING / UNBALANCED BECAUSE OF THE TRACK MEMBER

    States of instructions that "you must be on faxrda.lpc 115.47 before you apply this hotfix.

    How can I check if our system is the "faxrda.lpc 115.47" or not?

    Please advise... Thank you!

    The base (on UNIX/AIX) command is:

    strings - an executable. grep 'head '.

    where you replace "executable" by the name of the executable. The word 'Head' is literally the word header between single quotes: 'head '.

    Try this:
    CD $FA_TOP/bin
    strings - a * | grep 'head ' | grep faxrda

    will be grep this file from all the executables in this directory.

  • How can I check for the Officeject 5510 ink levels?

    How can I check the Officejet 5510 ink levels?

    Thanks, but which refers to the HP Director to access the ink levels and I couldn't find that. I ended up replacing this printer with a new then is no longer a problem, but appreciate your response.

  • Dual display (x 2)-l' one is PINK/PURPLE in color, how can I check for errors of video/graphics card?

    I'm trying to implement 2 screens (extended desktop mode) and when I connect them both, however, I got a picture on two screens, one of them is color purple/pink.

    I have swithced monitors around, it's NOT either of the monitors, they bot work very well... and the cablesARE guaranteed in the monitors and computer ports.

    What is the video/graphics card which is the problem?... If so, how can I check these errors?

    Thanks to all who respond!

    Try changing the cables, if they are of the same type.

    I think that the problem is a damaged cable.

  • How can I check that an object is an instance of any type in an array of types of partners?

    In LabVIEW, it is possible to check the type of execution of an object to helping the most specific Class.vi. Use of this would be to perform a security check if a sort of class uses instances of another class, but is only able to manage a subset of types of children of this class.

    For example, suppose that you had Beverage.lvclass, which represents an abstract type of product, several subclasses: Coffee.lvclass, Tea.lvclass and Soda.lvclass.

    We also have a Person.lvclass that can drink. A person also has preferences on drinks or don't like:

    Attached is an implementation of this in LabVIEW.

    In Person.lvclass: Drink.vi, I have the following code. For some reason any wire seems broken in these extracts, but it is in the actual code.

    In Scenario.vi, I have the following code:

    What I find is that no error is generated and instead, I get "Yum, I love the!", "Yum, I love coffee!" and "yum, I love soda!" My guess is that the most specific Class.vi throws wire of entry of the 'target class' static type rather than the type of performance - and because I'm passing in the elements of an array of types, the static type of the cable is upcasted to the more specific type which is a superclass of the types contained in the table - which would be Beverage.lvclass. And if distribution tries to determine if an object of static type Beverage.lvclass is an instance of Beverage.lvclass, which of course will happen all the time.

    Is it possible to make the LabVIEW to check the more specific runtype type of an object? As in, is there something I could do that, in this case for example, would allow me to get the required behavior of Joe throwing an error when he did drink soda? Or is this another limitation of LabVIEW that I have to live with?

    Your assumption seems reasonable. I can't check right now, but there is a primitive called preserve run time type, which should do what you want.

  • How can I check for other versions running of Foxfire

    received pop-up which until now has no one to check other versions running of foxfire, how can I do this?

    If this message said Foxfire, there could be malicious.

  • How can I check (for tax purposes) a gift that I made to Mozilla?

    I made donation of $500 at the end of 2013 and need to check. (I know it is other kinds of support generally available here, but I can't find any E-mail address or phone number from which to ask about it). Thank you!

    Based on what I saw in another thread:

    Please send a message to [email protected] and include the date and the amount of the donation, as well as your email address for response.

    This can take a few days to get a response.

    A little luck?

  • I think that my desktop monitor is broken, how can I check for sure?

    My orange light monitor blinks after a power outage, every once in a while the led green lights but just for a second, disconnected ang plugged all back, computer tower is on but nothing comes on the screen.  I have a laptop but don't know enough about computers to hang the Tower until she.   Any suggestions how I might be able to check in with a laptop?  I need specific instructions I don't know true how all this works.  I use the color code system to connect the monitor to the tower.  The laptop has no large port to connect the monitor?

    This must be where you plug the external monitor with 15 holes. her you would go to the setting on your laptop screen it should automatically detect the new monitor

  • How can I check for bios and driver on my laptop (SafeMode only) updates

    I can't start my computer in normal mode, it sends me into safe mode. on the message screen says I need check the bios updates and or drivers.
    I bought a driver software and I ran several tools for this, but the problem still there.

    If free or paying for driver software update should not be used. (unless the software has been provided by your PC manufacturer)

    Niether if you use a third-party utility of optimizer type.

    Driver updates are available for free from your laptop computer makesr site

  • How can I check if an object inherits a certain class?

    I have 2 classes, entity and PlayerEntity.

    On the main class (Main.as) I use a loop for to check who is a PlayerEntity and that is an entity. (Note that the entity is the superclass for PlayerEntity)

    I'm really bad at explaining, maybe code will clear up things

    //PlayerEntity.as
    package  
    {
      
              /**
               * ...
               * @author @SaUrOnZ
               */
      
              public class PlayerEntity extends Entity
              {
      
                        public var selected:Boolean = false;
                        private var selectGFX:SelectedGraphic;
      
                        public function select():void
                        {
                                  selected = true;
                                  if (!selectGFX)
                                  {
                                  selectGFX = new SelectedGraphic(this.width, this.height);
                                  addChild(selectGFX);
                                  } 
                        }
                        public function unselect():void
                        {
                                  selected = false;
                                  if (selectGFX)
                                  {
                                            selectGFX.removeEntity();
                                            selectGFX = null;
                                  }
                        }
      
              }
    
    
    }
    
    

    //Entity.as
    package  
    {
      
              import flash.display.Sprite;
      
              /**
               * All hail the Entity SUPERCLASS!
               * @author @SaUrOnZ
               */
      
              public class Entity extends StaticEntity
              {
      
                        public var fakeX:Number = 0;
                        public var fakeY:Number = 0;
      
              }
    
    
    }
    
    

    //Main.as
    private function game_update(e:Event):void 
                        {
                                  var i:int;
                                  var entity:Entity;
                                  var playerent:PlayerEntity;
                                  var sEntity:StaticEntity;
      
                                  //Check input sawses
                                  checkKeyboard();
                                  checkMouse();
      
      
                                  //DYNAMIC ENTITY ARRAY
                                  for each(entity in entityArray)
                                  {
      
      
                                            for each (playerent in entityArray) 
                                            {
                                                      if (selection.hitTestObject(playerent))
                                                      {
                                                                playerent.select();
                                                      }
                                            }
      
      
                                            //if the entity has been removed from the stage
                                            //mark the ent as null and remove it from the
                                            //array
                                            if (!entity.stage)
                                            {
                                                      entity = null;
                                                      entityArray.splice(entity, 1);
                                            }
                                  }
                             }
    
    

    When I run this (ther is obiously more code than this) I get an error saying that a certain entity is no not part of the PlayerEntity (which makes sense, because not all the objects I've done are PlayerEntities and are instead of the normal entities)

    My Question is:

    Is there some sort of way to check if a certain object is derivered of a certain class?

    For example, something like this:

    if(Entity == PlayerEntity)

    {

    playerent. Select();

    }

    Any help would be appreciated to greately!

    Best regards, Erik Jansson

    the code that I have proposed would not cause this error.

    Click file/publish settings/flash and check "permit debugging".   the number of problematic line will be in the error message.

  • How can we check for backdoor malware software

    My son-in-law fell for a scam of tech support that began with a pop-up message on his ipad; It allowed the scammer talk on access to the ipad by attaching to a pc and installing "logmein". They stop it before paying any $ to the scammer, but they had had access long enough for intsaller everything they wanted anywhere. How find and remove anything the scammery may have installed on the ipad? is it possible that their iphones could also have been compromised if they were connected to the same wifi?

    Good spyware and some other malware villain is not easy to find or remove. The only way to be sure, something they have installed is gone is first to make a backup of your Mac. Especially your personal documents and photos.

    Erase the drive of the Mac and reinstall OS X. Apply updates from Apple for the operating system is up-to-date. Reinstall your applications from third party of their records of origin or digital downloads. Copy manually , back, your personal data.

    Not merge in a backup Time Machine or another type of backup. The purpose of the backup in the first step was to make sure that you do not lose your personal files, only not to restore automatically. Which would bring to any possible malware.

  • My computer is very slow. I went a while without protection against the virus, but received a recently. My computer always appear infected. How can I check for any existing viruses and delete them?

    VIPRE Antivirus.

    To get VIPRE Antivirus help, go to Sunbelt Software forum help Malware , or see the web page How to help to remove this infection .

    If your computer has become infected after that you installed VIPRE, you can get the free malware removal service by filling in the Form of Product Support .

    Boulder computer Maven
    Most Microsoft Valuable Professional

Maybe you are looking for

  • Cannot delete files from USB HDD CCC attached to Time Capsule

    Hello I use an external DRIVE (WD MyBook Studio) disc that contains two partitions: "CCC-Backup' (where Carbon Copy Cloner stores its backups/clones) and 'Media' (for my movie collection). This HARD drive was attached to my iMac, but now I have the s

  • CQ61: Reboot for Compaq CQ61 error

    After rebooting my system, I come to a screen to enter the system password.I tried the battery take nothing helped.This is the message I get after too many password attempts.deactivation of the system key is 73589451

  • What software to use with T400 webcam?

    I have a laptop T400, and I want to use the webcam built into my laptop, but I can't find software to do this. I want just to take pictures or record video. Does anyone have any suggestions? Freeware please. Thanks in advance.

  • D000044 of error on blue screen

    I was chasing a melware scan in safe mode in windows vista home one he ran for 15 to 20 min. I got a blue screen that said stop the d000044 of unknown hardware error I was wondering if anyone had any ideas or suggestions. because I could find very li

  • multi color shifts

    Using XP on HP CM1312 nfiMFP. Now get offset color multi on text, etc., trying to use color copy/print. Color cartridge indicates left of color of 4% on all cartridges except blk to 67%. How to fix this prob? I've tried the config button. BLK print O