the name of the instance of a button recovery

Hello all, I need to retrieve the name of the instance of a button just click on it, in the function on (release). Sincerely yours Mohen

Ah, the 'this' in a symobl of button refers to the timeline that the button is,
not the chronology of the button itself... You must use movieClips as
buttons and not the button symbols.

--
Dave-
Developer leader
www.blurredistinction.com
Adobe Community Expert
http://www.Adobe.com/communities/experts/

Tags: Adobe Animate

Similar Questions

  • How to get the name of the instance of button to display in the dynamic text box

    first of all, thank God for you people. Laughing out loud.

    Here is my scenario, I am the designer of consumate and learning coding by leaps and bounds, today its been a lot of stumbling blocks however.

    I have a site I designed that contains buttons that navigate the user at various points on the timeline using image tags. When they arrive at the appropriate image tag, they are presented with a movieclip containing two layers. The bottom layer is a card, and the top layer is a collection of buttons printer having a component tooltip on them showing you the information on detailed mouse printer on and takes you to the Remote UI printer on release. each button has a name of unique queue for the printer appropriate under its name of the instance (e.g. itm100_btn). Here's the jist... I want to be able to place a dynamic text box near the printer and using action script button it display printer queue name automatically simply based on the button, targeting, or even place the dynamic txt area inside the printer button mc. See, on some pages, there are like 24 printers... I'm AFRAID to have to put all these names in manually because there are total 150 printers! OUCH...

    Oh it is AS2.0 with Flash cs4

    In short... God bless you people... for the love of God someone help me? Laughing out loud.

    Thank you so much peoples!

    "I make things look purdy, but do not know why the sky is blue".

    to create a movieclip button:

    create a (insert/new symbol/movieclip) movieclip and attach a stop() to its first image and etiquette 'up '.  create any graphic you want for the up state button movieclip.  create a 'more' and, if necessary, a "low" setting

    When you place this button movieclip on stage give an instance name (for example, printer1) and use:

    {Printer1.onRollOver = Function ()}

    this.gotoAndStop ("over");

    }

    {Printer1.onRollOut = Printer1.onDragOut = Function ()}

    this.gotoAndStop ("up");

    }

    {Printer1.onPress = Function ()}

    this.gotoAndStop ("down");

    }

    and add your onRelease to do all that.

    If you also wanted to add a textfield that displays the instance name of the button when the button is postponed, place a textfield on the framework of the "over" and give it a name instance (say tf) and associated to the MovieClip "over" frame that uses:

    TF. Text = This._name;

  • Get CC HTML5 Flash click on the name of the instances?

    I make the escape games and often have many elements in a scene, each with flash instance names, on mouse over or mouse click, carry out an event or a text.

    I use CC Flash and HTML 5 output and are unable to exit the instance names in the paper, is it not possible? Can someone suggest an alternative method of answering a lot of buttons/movieclips etc.

    Here's my test code: -.

    //stage.enableMouseOver(24);
    var clicked = "";
    var clickedname = "";


    //NEED TO FIND OUT MOVIECLIP INSTANCE NAME??

    var key1 = exportRoot.key1
    //key1.name = "key1"

    //console.log(key1ref.name)


    stage.on("click", function (evt) {
       
        //clickedname = stage.getObjectUnderPoint(evt.stageX, evt.stageY)
        //clicked = evt.target
       
        clicked = evt.target
       
        console.log(clicked)
        //output result to log
       
        /*if (clicked == "key1"){
            console.log("clicked key 1")
        }*/
       
    });

    Thank you still Ned, these products come from the exit console.log statement that contains the clicked var...

    I work, it's a little long breath but it works, really appreciate your help on this mate!

    He lay mouseChildren to false, what has done it (and not using a string), of course I wasn't getting the upper container which is the movieclip/name when you click on!

    var clicked;

    Key1 = exportRoot.key1 var

    Key1.mouseChildren = false; VERY IMPORTANT ;-)

    Key2 = exportRoot.key2 var

    Key2.mouseChildren = false

    var = exportRoot.key3 Key3

    Key3.mouseChildren = false

    stage.on ("clicked", function (event) {}

    clicked = event.target

    If (clicked == key1) {}

    Console.log ("clicked 111111111111111 key")

    }

    ElseIf (clicked == key2) {}

    Console.log ("clicked key 2222222222222222")

    }

    ElseIf (clicked == key3) {}

    Console.log ("clicked key 3333333333333333333")

    }

    });

  • Name of the instance

    Flash CC

    I create a number of buttons using the following:

    setBut ('butPass', 'Password', bY, bX, bS);

    setBut ('butUser', 'Username', bX, bY += 80, bS);

    etc.

    function mcP(e:MouseEvent):void

    {

    aTf.text = e.target.name +":" + ar [0] + ' ~ ' + ar [1] + ' ~ ' + ar [2]; "

    }

    function setBut(vMcn:String,_vBt:String,_vX:int,_vY:int,_vS:Number):void

    {

    vMc var = new ButtOn;

    vMc.name = vMcn;

    vMc.addEventListener (MouseEvent.CLICK, mcP);

    vMc.txt.text = vBt;

    vMc.txtS.text = vBt;

    vMc.x = vX;

    vMc.y = vY;

    vMc.scaleX = vS.

    vMc.scaleY = vS.

    addChild (vMc);

    }

    I'm trying to name the new instance (vMc.name = vMcn;), but on the use of different buttons, I get the following returns:

    Instance4, trial.8, instance12, instance16 etc.

    What I am doing wrong?  Thank you...

    First of all, try to use

    e.currentTarget.name

    Instead of

    e.Target.Name

    The 'target' may end up being something that lives inside the object with the lsutener, for example a shape or other object.  But the "currentTarget" will be the object which is the listener who are entrusted to him.

  • Create Variables based on the name of the Instance

    I have a class called distributor that I use on several different items in my project. They are all objects in two positions (circuit-breakers and switches) where I hide or show the chart of alternatives for the object. What I want to do is instead of using my variable "distributor", I wish it were a dynamic variable that changes based on the name of the instance of the object in question. I use the "this.posOne.visible = true;" given that an instance name of a clip inside the object that corresponds to posOne and posTwo. I guess that there is a way to make a this.instanceName or something to that effect, but I'm not sure. If I put the name of the instance of the circuit breaker to "cb1", I would like to than the variable to change to "cb1". This way I can use the same code for all my electrical appliances, but are able to trace their individual to simulate the flow of current on the drawing.

    "the package classes.comps.

    {

    import flash.events.MouseEvent;

    import flash.display. *;

    public class distributor extends MovieClip

    {

    public var twopos:Boolean = true;

    public void twoPosition()

    {

    the constructor code

    addEventListener (MouseEvent.MOUSE_DOWN, twoPosClick);

    buttonMode = true;

    }

    function twoPosClick(evt:MouseEvent):void

    {

    If (twopos)

    {

    this.posOne.visible = false;

    this.posTwo.visible = true;

    twopos = false;

    }

    on the other

    {

    this.posOne.visible = true;

    this.posTwo.visible = false;

    twopos = true;

    }

    }

    }

    }"

    because, from what I know, all your symbols have kid instances posOne and posTwo and they all work the same, none of them do need their own class.  they can all have the same base class (for example, TwoClass):

    :

    package {}

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    SerializableAttribute public class TwoClass extends MovieClip {}

    public void TwoClass() {}

    each of your symbols has a posOne and a posTwo instance.

    I don't know which instance reflects what should be the initial state of each symbol, but if it is posTwo, use the following.  If the initial state is posOne, use this.posTwo.visible = false in the constructor.

    this.posOne.visible = false;

    each sybmol must have a mouse to the bottom of the headset with active mode button

    this.addEventListener (MouseEvent.MOUSE_DOWN, posTwoClick);

    this.buttonMode = true;

    }

    private void posTwoClick(e:MouseEvent):void {}

    the following two lines of code to toggle the visible property of the posOne and posTwo.

    this.posOne.visible =! this.posOne.visible;

    this.posTwo.visible =! this.posTwo.visible;

    }

    because you want the 'position' to be accessible outside the class, getPositionF is public and returns a string that reflects if posOne or posTwo is visible (or if this symbol is "off" or "on").

    public function getPositionF (): String {}

    {if (this.posOne.visible)}

    Return this.posOne.name;  or, the return of 'off '.

    } else {}

    Return this.posTwo.name;  or, back "on".

    }

    }

    }

    }

  • pass the name of symbol instance variable

    Hi all

    I'm trying to find a way to pass the instance name (ID) of an object selected in a variable, so I can navigate on a label on the timeline of the same name.

    So far, I tried different variations of:

    sym.getSymbol () //logs as "not defined".

    sym.getSymbolTypeName / / stores the name of the symbol in the library, not to the instance

    Any ideas?

    Thank you

    -Dave

    Hi David,

    You can use "e.target.id" on your button click event to get div id of the button.

    Alert (e.Target.ID);

    The weird thing only is that it seems to add "Stage_" value, so if your div button is called "myButton", the foregoing will alert you "Stage_myButton".

  • Only one instance of the same function call button?

    I have 4 instances of the same key on a single layer on a timeline of the "coverflow_mc" mc named 'ThatsMe_btn_a' to 'ThatsMe_btn_d' IE the same button, same position... He just changing the name of the instance on 4 key frames. Why he calls the function fine for button but not to b, c or d? There is a stop on each of these frameworks and I can see the SWF that it prevents the correct images.

    Picture 7.png

    function thatsMe() {}

    right = new Sound();

    right.attachSound ("right");

    right.start (0,1);

    trace (subTotal);

    }

    _root.coverflow_mc. ThatsMe_btn_a.onRelease = function() {}

    subtotal = 2

    thatsMe();

    };

    _root.coverflow_mc. ThatsMe_btn_b.onRelease = function() {}

    subtotal = 1

    thatsMe();

    };

    _root.coverflow_mc. ThatsMe_btn_c.onRelease = function() {}

    Subtotal = 3

    thatsMe();

    };

    the other buttons do not exist when your code runs.

    to remedy this, make sure that the other buttons exist when your code runs.  You can disable their visible property, so they cannot be seen.

  • Name of the Instance Service dispatcher (Admin API Blackberry 5.0)

    Hello!

    I'm developing an application to activate using the API of Administration Blackberry blackberry users. I did successfully. But I have some confusion about Dispatcher Service example name. How do we get the instance name? And where you can get all this?

    I use BAA 5.0.0.26.

    Windows Server 2003

    .NET framework 2.0

    Any help would be appreciated. Thanks in advance!

    Rizwan Ahmed

    Software engineer

    Hosting Controller Inc..

    Hi Rizwan,

    Welcome to the forums!

    You can get the name of the dispatcher from the console DOWN or programmatically by using one of the findServiceInstancesBy calls * (BAA). The example code moveUser() in the API documents indicates this fact.

    Kind regards

  • Get the name of the Instance of the Application in an IOM PrePopulationAdapter

    We have at disposal of the IOM to multiple Active Directory domains. To do this, we installed a connector AD, Multiple Instances of the Application of several Instances of IT resources, while using one and the same resource object and form. Self-service console we want to request an account (Instance of the Application) to a user, and we can choose AD1, AD2, and AD3. When we choose, lets say, AD3 do we want to pre-fill the field organization name (OU in AD) with a specific organizational unit in Active Directory corresponding to the Application Instance AD3. The problem is that in the PrepopulationAdapter we have not managed to identify the instance of the application of demand.

    Here's how to get the instance of the application of demand in an adapter to prepopulate:

    prepopulate (RequestData requestData) serializable public get {RequestServiceException}
    String response = "";
    RequestBeneficiaryEntity targetEntity = requestData.getBeneficiaries () .get (0) .getTargetEntities () .get (0);
    EntityType of OIMType = targetEntity.getRequestEntityType ();
    If (entityType! = OIMType.ApplicationInstance)
    Return ' ';

    try {}
    String entitySubType = targetEntity.getEntitySubType ();
    ApplicationInstance appInst is getAppService () .findApplicationInstanceByName (entitySubType);.

    .... Continue your own code

    getAppService is the ApplicationInstanceService API.

    -Kevin

  • Need to know the instance name of window for Acrobat Reader XI

    I try to use a custom web program that launches Adobe Acrobat Reader XI and want to know the instance name for this version of Acrobat Reader window. I updated my version of Acrobat Reader 10.0 and the instance name of window seems to have changed, once again!

    This is the story of the instance name of the window for Acrobat Reader in case you don't know what I am referring. I tried all the supposed possible variation of what I expected it to be and all seem to fail. Adobe seems to have changed the name of the instance of the window.
    Also another note is that the new name of the server is "ACROVIEWR11" and it is the XI (11) version installed on a 64-bit computer to Windows 7, so who can make a difference.
    Any help would be greatly appreciated

    Acrobat Reader 10 - the window instance name = Acrobat
    Acrobat Reader 6 & 7 - the window instance name = Adobe Reader
    Acrobat Reader 5 - window instance name = Acrobat Reader

    Why not just use a reporting tool to find out?

  • Shared services - your system already has the instance with the name epmsystem1

    Hello

    I'm putting in a new development system EPM 11.1.2.1 enviropment. I thought that I could connect to a database already configured Shared Services databases and configure the new instance in him epmsystem1 (the default), but he complains with the message error "your system already has the instance with the name epmsystem1.

    Is it really necessary to create a new name for the instance?

    11.1.2.1 in each instance EMP name must be unique, so if you have already configured an instance in an environment and you want to add a new instance, it must be unique.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How can I make the < Instance name > the same as the name of the clip in an animation.

    Hi, I'm a moderator for a small game project and I have a very big problem. Even if I used flash for animation for a long time, I am a newbie when it comes to something technical. I just got a request to make of each video clip I use to have a uniform < Instance name > in each frame of the animation. Only if they have told me that earlier... Y at - it an easier way to do the < Instance name > the same as the name of the clip another that you enter manually. I have 16 characters with 12 parts of the body with 20 animations each with approximately 6-7 frames for each part of the body, it will take me months and nightmares evey night enter everything by hand. Please help me keep my sanity!

    I don't know if I explain properly, so here's a picture:

    Instance.jpg

    Thank you!

    I don't know a easy way to do it.

    you could do a file jsfl to do, but it is not for beginners.

  • Name of the instance is null?

    I have generated a list of movieclip containing different text.

    for (var i: int = 0; i < locationarray.length; i ++) {}

    locationmc = new locationname();

    addChild (locationmc)

    locationmc. Name = "LOC1"

    locationmc.locationtxt.Text = locationarray [i];

    locationmc.x = Math.floor (Math.random () * 500);

    locationmc.y = Math.floor (Math.random () * 300);

    locationmc.y = 100;

    locationmc.x = 200;

    trace (locationmc. (Name)

    locationobject.push (locationmc)

    locationmc.addEventListener (MouseEvent.MOUSE_DOWN, mousedown)

    locationmc.addEventListener (MouseEvent.MOUSE_UP, mouseup)

    stage.addEventListener (MouseEvent.CLICK, testobject);

    }

    But when I do a check on the name of the instance he would show to null, the code for the control is

    public void testobject(e:Event) {}

    trace (e.Target.Name)

    trace (e.currentTarget.Name)

    }

    It is possible e.target is not what you think it is.  Try e.target tracing to see what you are trying to get a name of.  When you draw e.currentTarget you will get the object that has the assigned listener, which in this case is the stage that does not implement a name property.

  • name of the instance in the superclass

    Hello

    I have a few screens on stage. Each screen have their own class and I can't acess all movieclips in their breast by the instance name. Each screen extends the DragableScreen class. In this superclass, I made them all dragable and other things. Everything works fine. But how do I access one of the objects inside the screen (by its instance name) in the superclass display? Each of my screens have movieclip in it, named 'content '. How can I target this movieclip inside the DragableScreen.as?

    use getChildByName or as your dynamic super class.

  • Purpose of the instance name from default OC4J (House)

    Hello
    When installing Oracle Application Server 10 g Release 3, I put another name OC4J instance by default (at home), for example AS_Inst. When I started the server, I have two instances OC4J: by default (at home) and the name of the instance that I defined during installation (AS_Inst). I would like to ask why there are two instances and what is default OC4J instance (at home)?

    Thanks awfully for help.
    Concerning

    Instance of default OC4J used for administrative purposes... for example you want to deploy an application using Application server control's default home is necessary.

    HTH,
    REDA Mareddi
    http://www.freeoraclehelp.com

Maybe you are looking for