By clicking on a specific object in a picture

Hello

So I am currently working on a piece of code where I have 12 points (clips) on stage, gradually increasing their contact information. I want it so when you click on one, it moves its coordinate is back to zero. That's what I have so far:

for (i = 0; i < 13; i ++) {}

cArray [i] .addEventListener (MouseEvent.CLICK, blockEnemy);

}

function blockEnemy (e: MouseEvent): void {}

for (i = 0; i < 13; i ++) {}

trace ("eh...") It was surprisingly easy");

trace (e.target.name);

cArray [i] = 0 there;

}

}

This is the function only, the rest of my code works very well. I'm not sure on how to move the specific object that was clicked back to zero. When the code runs like this, it moves all the table back to zero, and I understand why it does this, but don't know how to fix it.

Any help is appreciated, thanks! ^-^

* I should also mention that there is only a movieclip in the table.

You said there were 12 video clips, then you said there was only a single movieclip. Do you mean that there are 12 copies of the same movieclip? Not that this affects the problem, I was wondering.

I think you can do what you want simply to this:

for (i = 0; i< 13;="" i++)="">

cArray [i] .addEventListener (MouseEvent.CLICK, blockEnemy);

}

function blockEnemy (e: MouseEvent): void {}

e.Target.y = 0

}

Tags: Adobe Animate

Similar Questions

  • Flash CC: access a specific object on the stage

    I'm writing the javaScript code to execute with Flash CC.

    How can I access a specific object on the stage? It has a name (square_sym), but I can not read the code. What should I do?

    TIA

    He needs an instance name.

    If there is not a button or a movieclip, right click on the object > click on convert to symbol > select movieclip > ok > in the properties panel, enter an instance name, for example square_mc.

    then on the timeline that contains the button or movieclip you can use:

    This.square_mc to reference the movieclip.  other chronologies, there are also pointers to reference the movieclip

  • Check if it is a specific object

    Hello!

    I need to check if the event with a click: event.target is a specific object of a class, for example:

    if (event.target == com.foo.Bar)
    

    But it does not work. In the Inspector of my debugger I see this:

    target = com.foo.Bar (@8dcdae1)

    How can I check if the object (event.target) comes from a special class (com.foo.Bar)?

    Best regards.

    You write "is not" logic like this:

    If (!) (Event.Target) is Bar))

    Gordon Smith

    Adobe Flex SDK team

  • How to remove blocks of stamps for a specific object cache

    Hello world

    is it possible to remove the blocks that belogns to a specific object (a table for ex) of the buffer cache.

    as you know, there is
    alter system flush buffer_cache;
    command, but it does a job for all to buffer cache. If you ask me why I want to than this, for reasons of tuning. I want to test some plsql codes when they are run as if they are running for the first time (reading the disc).

    PS: I use oracle 11g r2

    Melody to reduce I/O logic.

    That's all you need. Your willingness to 'scenario' will NEVER materialize in real time conditions, unless you resize the buffer cache to something really small, forcing them to always make each statement of physical i/o.

    This is how Oracle works. Design a database that is more suited to your taste, or learn to live with it.

    ---------
    Sybrand Bakker
    Senior Oracle DBA

  • Determine whether the instance of the object is of a specific object class.

    I was not able to find the answer in the documentation or in the forum. My terminology is perhaps a bit off (Java and c# background back to PL/SQL programming).

    The general question is: given an object instance how to determine if the type of the instance is of the same kind as a specific object class.

    In particular, I do a unit test and examine the returned object instance. The effective yield is described as follows

    -This data structure contains a pointer to an LDAP session
    SESSION OF SUBTYPE IS RAW (32);

    I expect an instance of DBMS_LDAP. SESSION. To confirm this, I propose that the returned pointer DEREF and see if it's a type of DBMS_LDAP. SESSION. When this is confirmed, then I can further the return of reference.

    Draft code is

    BEGIN
    IF DEREF ({RETURN$}) some_operator_which_compares_object_types DBMS_LDAP. SESSION
    THEN
    RETURN TRUE;
    ON THE OTHER
    RETURN FALSE;
    END IF;
    END;

    where some_operator_which_compares_object_types is what I need to know.

    Thank you for your help. And of course, the other way to do business and/or links to the correct location in the documentation are appreciated.

    Kind regards
    Bill

    I think you are looking for [IS OF | http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions014.htm] condition.

    SQL> create or replace type mytype as object(a number);
      2  /
    
    Tipo creato.
    
    SQL> declare
      2  x mytype := mytype(1);
      3  begin
      4  if x is of (mytype)  then
      5  dbms_output.put_line('OK');
      6  end if;
      7  end;
      8  /
    OK
    
    Procedura PL/SQL completata correttamente.
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • Select the color in position specific xy of a picture?

    Hello

    I'm building an action and could simplify the workflow if I could choose color to a specific place in each picture.

    Specifically, I want to select the pixel at the top in the center of the images (which are all 500x500px) and make sure that the color of the background color.

    How to choose a location specific xy like that?

    Thank you.

    You can use a script and call the script with your action.

    #target Photoshop
    function main(){
    if(!documents.length) return;
    app.activeDocument.colorSamplers.removeAll();
    var X = activeDocument.width.as('px')/2;
    var sample = activeDocument.colorSamplers.add( [ new UnitValue( X, 'px' ), new UnitValue( 1, 'px' ) ] );
    app.backgroundColor=sample.color;
    app.activeDocument.colorSamplers.removeAll();
    }
    main();
    
  • Specific objective Lightroom Presets

    Can't seem to solve this problem of Lightroom since I use my new camera, a Sony A7ii. I used it with a native lens from Sony (a 24-70 f.4 FE) and a variety of lenses vintage (with adapters).

    That is the problem. After having played with and award of the basic presets for the camera/FE 24-70, the presets combo of same - as well as lens corrections - are applied to all photos, including those taken with other lenses. I tried to reverse this problem by removing the lens corrections and assign a new preset - thinking this would remove the lens corrections for all photos taken with the objectives other than the 24-70 FE. No luck. This made out lens correction presets on all future imports, including those taken with the EF 24-70.

    So what I am doing wrong? I know that in pre-selected preferences, there are options of specific camera and ISO specific presets. But what about the specific glasses?

    The default value of the profile of lens for lenses with adapter (not recognized) is how to associate the Sony lens profile you use (FE 24-70mm).

    Try this:

    (1) select a raw image file shot with that of the adapter mounted lenses and click on the "Reset" button at the bottom of the Panel parameters develop.

    (2) in the Panel next to "Setup" lens Corrections, click the two-headed arrow and select "Reset Lens default profile." 'Make' should now be set to "None" and "Setup" the value "Default".

    3) go to the menu develop > set default settings > click "Update to current settings".

    This should prevent a profile of lenses apply to unrecognized adapter lenses and your goal (s) Sony will be the profile of lens with your settings 'by default'. You can change the default settings of 100 of distortion and vignetting 100 for each objective independently with unique values.

  • Size of the specific object

    Hello everyone,

    Is it possible to create objects that are specific size, as you can do in Illustrator? I'm sure it's something obvious, but I can't remember what it is.

    All the shape tools are similar in the parameters with the exception of line and polygon tools. Simply click on the drop down arrow next to the little star (blob icon)

    in the toolbar options to access the options of geometry.

    MTSTUNER

  • How you can run a report on the distribution of click on the specific links on an email?

    We would like to see the breakdown on the clicks on the different specific links on an e-mail. I am aware that we can get this report looking at clicks on email and on specific traffic on the landing pages, Web site and/or document downloads, but I was wondering if there is a report in Eloqua showing the distribution of click on the links on an email?

    Thank you!!!

    Hi Melissa,

    I think breaking click link by E-mail might be what you are looking for.

    You can find it in the folder of electronic mail analysis reports.

  • How to click to view the object and click to hide the object

    I'm very new to Flash and I create an ad that has a simple animation that cycles between two pieces of content. I including, but I have a button on the lower part called 'Important information' and clicking on, I want to bring up a screen that displays important information. I want there to be a 'Close' button on the important information screen, which brings back you to the animation. What is the best way to do it? I have trouble finding a tutorial, but for me, it doesn't seem like a rare action.

    With the help of professional Flash Action Script 3.0 and CC 2015

    There are several ways to do it, but all require that your screen is an object.  a clip that you create in the IDE would be typical.

    Add the movieclip on the stage where you want it to appear and assign it an instance name, for example info_mc.

    during your use of actionscript Panel:

    removeChild (info_mc);  to remove the display info_mc and the addChild (info_mc) to get it back on top of everything else.

    for a button trigger info_mc reappear:

    btn.addEventListener (MouseEvent.CLICK, infoF);

    function infoF(e:MouseEvent):void {}

    addChild (info_mc);

    }

    the code for the close button will also call a listener function that executes removeChild (info_mc)

  • Align a specific object in a group to a key object

    Hello

    I have two objects in a group as yellow and green box. I want to align this group box specifically yellow to a black box as a key object as shown in the second screenshot below. Advice and assistance is greatly appreciated. Thank you.

    penang_marathon2.jpg

    David,

    What about cheating and creating a transparent consideration or nostroke/nofill than green and add it to the group so that the yellow we'll be in the middle or Center, so it can just be aligned as if it was by itself (depending on the alignment, of course)?

    Or by aligning the yellow to black and then drag the green above him, smart guides are your friends, and the group then subsequently?

    Apart from this, it is difficult to see what alignment you are after.

  • CTRL + click to select behind objects?

    I take 4 control clicks to activate the selection behind! Is this normal? Why 4 and not another?

    No, it is not normal that it takes 3 clicks. It takes 2: one to enter select behind fashion and the second to select the next behind object.

    It works best when you move the mouse just between the first and the second click.

  • By clicking on the invisible object

    Hello

    I have an object on the stage, I do this invisible object and give him a listener to listen for a click. But then, when you click nothing happens. Someone has any idea how to click the invisible?

    Interactivity of invisible objects. Use the alpha property.

  • Find the angle of rotation of the anchored object, replace that specific object by letter

    I got indd file customer. General problem is that he described certain letters of the words.

    In fact, he described the letter e and that it rotates 180 °. It also makes with the letter c and there a rotation that anchored-178, 8250 ° oppose.

    Now, I tried to change this objects to the real letters. Problem is that I can't find the option for the rotation of an object in the Find/Replace dialog box, and also I can't fint in Grep. So, what are my options?

    Thanks in advance...

    PS. If there is a possibility to change one of them, I can change a second with finding anchored object and change it to specific letter...

    Looks like someone could not find the real schwa or o open on their keyboards

    Possible, but tricky.

    This Javascript will search history containing the text for items cursor which rotated 180 degrees and replace them with a question mark. Replace the question mark with the character really wanted in notation Unicode Javascript ("\u... ("-here character four-digit hexadecimal code).

    It really isn't a good way to check if it really is one that you should be replacing, so it does not blindly on all 180 degrees of rotation objects...

    (You can simply change the "180" to your another number to check the other characters).

    all_text = app.selection[0].parentStory;
    
    for (thingy=all_text.allPageItems.length-1; thingy>=0; thingy--)
    {
         alert (all_text.allPageItems[thingy].rotationAngle);
         if (all_text.allPageItems[thingy].rotationAngle == 180)
         {
              all_text.characters[all_text.allPageItems[thingy].parent.index].contents = "?";
         }
    }
    
  • Click on Exchange of objects between the button tilelists

    I have an application that allows users to Exchange items between the two tilelists and then save the changes they made or reset all changes.

    What I want now however is for users to be able to click on the 'Add selected link' and 'Unlink selected' buttons and whatever point they have currently selected in the component tilelist will be moved to the other tilelist. By example, if a user clicks on an item in the left hand tilelist and then click on the button 'Add the selected link' while the item is always selected this point will then be on in hand right tilelist. I don't know if this is possible without drag each item well.

    Basically, I want to advance the application so that it includes this feature as well as drag and drop. The reason of all, it is that my application will be installed on a system and some versions of this system will be used by a TV as remote so obviously drag / drop would be difficult without a mouse so it comes to propose an alternative.

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application

    ' xmlns:mx = ' http://www.Adobe.com/2006/MXML "layout =" " absolute "creationComplete ="initprofile1NewsAndSportSO ();"

    >

    < mx:Script >

    <! [CDATA]

    import

    MX. Collections.*;

    import

    flash.net.SharedObject;

    public var

    profile1NewsAndSportSO:SharedObject;

    private var profile1NewsAndSportaddLinksFullAC:ArrayCollection = new

    ArrayCollection([)

    {link:}

    "www.bbcnews.com" , label: "BBC News" , icon: "image7" , largeImage: "assets/images/bbcnews_small.png" , title: "BBC News" , description: "BBC News description will go here"

    },

    {link:}

    "www.itv.com/" , label: "ITV" , icon: "picture5" , largeImage: "assets/images/itv_small.png" , title: "ITV" , description: "ITV Description will go here"

    },

    {link:}

    "www.skynews.com" , label: "Sky News" , icon: "image10" , largeImage: "assets/images/skynews_small.png" , title: "Sky News" , description: "Sky News Description will go here"

    }

    ]);

    private var profile1NewsAndSportaddLinksAC:ArrayCollection = new

    ArrayCollection([)

    {link:}

    "www.bbcnews.com" , label: "BBC News"

    },

    {link:}

    "www.itv.com/" , label: "ITV"

    },

    {link:}

    "www.skynews.com" , label: "Sky News"

    }

    ]);

    private function profile1NewsAndSportReset():Sub

    {

    resetprofile1NewsAndSportAC();

    profile1NewsAndSportAddLinksTilelist.DataProvider

    = profile1NewsAndSportaddLinksAC;

    profile1NewsAndSportLinkChoice.DataProvider =

    New

    ArrayCollection ([]);

    }

    private function resetprofile1NewsAndSportAC():Sub

    {

    profile1NewsAndSportaddLinksAC.RemoveAll ();

    for every()var obj:Object in

    profile1NewsAndSportaddLinksFullAC) {}

    profile1NewsAndSportaddLinksAC.AddItem (obj);

    }

    }

    private function initprofile1NewsAndSportSO():Sub

    {

    profile1NewsAndSportSO = SharedObject.getLocal)

    'profile1NewsAndSport '.

    );

    If

    (profile1NewsAndSportSO.size > 0) {

    If

    (profile1NewsAndSportSO.data.profile1NewsAndSportaddList) {}

    if (profile1NewsAndSportSO.data.profile1NewsAndSportaddList! = 'empty' )

    ){

    var profile1NewsAndSportaddList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportaddList.split (',' )

    );

    var profile1NewsAndSporttempAC1:ArrayCollection = new

    ArrayCollection();

    for every()var str:String in

    profile1NewsAndSportaddList) {}

    for every()var obj1:Object in

    profile1NewsAndSportaddLinksAC) {}

    If

    (str is obj1.label) {

    profile1NewsAndSporttempAC1.AddItem (obj1);

    continue

    ;

    }

    }

    }

    If

    (profile1NewsAndSporttempAC1.length > 0) {

    profile1NewsAndSportAddLinksTilelist.DataProvider = profile1NewsAndSporttempAC1;

    }

    }

    }

    If

    (profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList) {}

    var profile1NewsAndSportchoiceList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split (',' )

    );

    var profile1NewsAndSporttempAC2:ArrayCollection = new

    ArrayCollection();

    for every()var str2:String in

    profile1NewsAndSportchoiceList) {}

    for every()var obj2:Object in

    profile1NewsAndSportaddLinksAC) {}

    If

    (str2 is obj2.label) {

    profile1NewsAndSporttempAC2.AddItem (obj2);

    continue

    ;

    }

    }

    }

    If

    (profile1NewsAndSporttempAC2.length > 0) {

    profile1NewsAndSportLinkChoice.DataProvider = profile1NewsAndSporttempAC2;

    }

    }

    }

    on the other

    {

    profile1NewsAndSportReset();

    }

    }

    private function saveprofile1NewsAndSport(event:MouseEvent):Sub

    {

    var profile1NewsAndSportaddList:string = ""

    ;

    If

    (profile1NewsAndSportAddLinksTilelist.dataProvider) {}

    If

    (Collection ArrayCollection (profile1NewsAndSportAddLinksTilelist.dataProvider) .length > 0) {

    for every()var obj1:Object in

    profile1NewsAndSportAddLinksTilelist.DataProvider) {}

    profile1NewsAndSportaddList += obj1.label +.

    ","

    ;

    }

    }

    on the other

    {

    profile1NewsAndSportaddList =

    'empty '.

    ;

    }

    }

    profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;

    var profile1NewsAndSportchoiceList:string = ""

    ;

    for every()var obj2:Object in

    profile1NewsAndSportLinkChoice.DataProvider) {}

    profile1NewsAndSportchoiceList += obj2.label +.

    ","

    ;

    }

    profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;

    profile1NewsAndSportSO.Flush ();

    }

    []] >

    < / mx:Script >

    < mx:Button click = "profile1NewsAndSportReset ()" id =" " Reset

    "

    Label ="

    Reset " y=" 5 "height = » 25 " x=" 5 "

    / >

    < mx:TileList id=" profile1NewsAndSportLinkChoice "fontWeight =" " "BOLD"

    "

    dragEnabled ="

    true "dragMoveEnabled =" " true "dropEnabled =" " true "height =" " 129

    "

    width ="

    650 "top =" 5 "left =" 521 "columnCount =" 5 "rowHeight =" 145 ""

    "

    columnWidth ="

    125 "backgroundColor =" #000000 "color =" #FFFFFF "" "

    / >

    < mx:TileList id=" profile1NewsAndSportAddLinksTilelist "fontWeight =" " "BOLD"

    "

    dragEnabled ="

    true "dragMoveEnabled =" " true "dropEnabled =" " true "height =" " 129

    "

    width ="

    385 "top =" 5 "left =" 128 "columnCount =" 3 "rowHeight =" 145 "columnWidth =" 125 "" "

    "

    backgroundColor ="

    #000000 "color =" " #FFFFFF "

    / >

    < mx:Button click = "saveprofile1NewsAndSport (event)" id =" " Save "label =" " Save the changes

    "

    x = »

    5 " y=" 38 "width = » 113 "height = » 25.5 "

    / >

    < mx:Button x=" 269 "y =" 142 "label =" Add link selected "id =" profile1NewsAndSportAddLinkButton " "

    / >

    < mx:Button x=" 774 "y =" 142 "label =" remove the link selected "id =" profile1NewsAndSportRemoveLinkButton " "

    / >

    < / mx:Application >

    You pasted the code of an AIR application? The code I provided works fine for me.

Maybe you are looking for

  • I want to install an SSD, but then change drive under normal storage

    Hi, quite new and mac OS lovers, bought one after windows kept crashing on me I bought an iMac 27 "mid-2011 running with a 1 TB 4 GB 3.1 ghz i5 drive Im going to attempt to install a SSD (never opened an iMac upward before but ive read online) I want

  • I would like to replace a with an equivalent Canon Sigma lens.

    The lens is a Sigma 70-300mm 1:4-5. 6 DG with macro.  Which Canon lens would come close? The body is a T3i Rebal EOS. Thank you

  • When Stopping unhandled exception

    During the shutdown of Windows XP with Service Pack 3 I get this error message: Unhandled exception has occurred in your application. Could not load file or assembly 'Sq/ServerCe.Version=3.51.0 Culture = neutral public key token = 89845dcd8080vv91 da

  • The use and the importance of pushing blackBerry SDK

    Hello As far as the Service of Blackberry Push has been revealed, I studied the documentation about this feature and fell on several issues: 1 BB Push SDK. Is it correct to say that the main purpose of this framework is to help you efficiently create

  • Want System Restore to format my backup disk. It's bad.

    Windows 7 Ultimate 64 bit. Windows backup and restore... I had a hardware failure on my C: drive. I had a backup disk in the machine. I installed a new hard drive. I put the recovery disk and went to the image of system restore from another location.