Disorder by referencing the name of the instance of different chassis

Newbie here. All my code is frame 1 and works very well except for a single event onRelease. In the context of 20 (labeled "gameOver") there is a button that has an instance name of btnQuit. I want that button to do something onRelease. The code works fine if I put it inside the button like this: (release) {... etc. But I would like to have all my code in frame 1 in a timeline called "scripts".

I am missing something to make reference to instance name of the button (maybe a '_root', 'this' or some of those things that I don't understand).

Here is the code that works when put into 20 frame in the button, but not in frame 1 in a different timeline:

btnQuit.onRelease = function () {}

Calculate elapsed time
var now = new Date()
var elapsedTime = now - startTime; startTime defined beforehand

var strTime:String = Math.floor (elapsedTime / (1000 * 60 * 60)) + ': ' +.
(Math.floor (elapsedTime / (1000 * 60)) % 60) + ': ' +.
(Math.floor (elapsedTime / (1000)) % 60);

Send data to PHP
dataOut = new LoadVars();
If {(finalScore > 89)
dataOut.passed = '1';
} else {}
dataOut.passed = '0';
}
dataOut.score = finalScore;
dataOut.time_spent = strTime;
dataOut.send ("lesson.php", "_self", "POST");

}

The button should be in the presence of the code when the code is executed.  Then you either need to have this Framework 1 button or have this code in the frame of 20.  You might have in frame 1 and turn it invisible until the frame of 20 if it is an option.

Tags: Adobe Animate

Similar Questions

  • foreign key referencing the table in different schema

    I create a foreign key for the table in the schema A a table to diagram B.

    I do that by grant references (column name) on the name of the table to username;


    is there any drawback/disadvantage in the creation of foreign keys referencing tables in another schema?

    Not as such, no.

    Generally, you want to check a second time when you are in this kind of situation that the two tables really belong in different schemas. It should be relatively rare to find a child table that belongs to a different schema than the parent. Sometimes, but it should be an exception, not the rule.

    Justin

  • 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/

  • 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")

    }

    });

  • 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

    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.

  • 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

  • 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".

  • How to get the instance name of the Clip?

    Hello!

    Is there a way to get the name of the instance of an element of travel when he's on the stage?  In my dress up game, I need to know which elements are on the doll to keep them visible.  My drag and drop feature uses a table and currentTarget:

    var dragArray:Array = [Doll.Drawers.Dress1, Doll.Drawers.Dress2, Doll.Drawers.Dress3, Doll.Drawers.Dress4];
              
              for(var i:int = 0; i < dragArray.length; i++) 
                {
                        dragArray[i].buttonMode = true;
                        dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
                        dragArray[i].addEventListener(MouseEvent.MOUSE_UP, item_onMouseUp);
                }
    
    
    function item_onMouseDown(event:MouseEvent):void 
              {
                   var clip:MovieClip = MovieClip(event.currentTarget);
                   clip.startDrag();
              }
      
    function item_onMouseUp(event:MouseEvent):void 
              {
                   var clip:MovieClip = MovieClip(event.currentTarget);
                   clip.stopDrag();
                   if(clip.hitTestObject(Doll.Skins))
                        {
                                 //Here's where the problem starts!   ----------------------------------------------  //
                                  trace("It's on the doll!");
                        }
              }
    
    

    It can run this code.  However, instead of plotting "It's on the doll!", I would like to transform the currentTarget in its instance name, which should be "Doll.Drawers.Dress1" etc. and to register this name in a table.

    How can I do this?

    I looked into e.target.name, but I keep getting errors...

    Use the name property of the item (if it is the movieclip that you want the name):

    var dragArray:Array = [Doll.Drawers.Dress1, Doll.Drawers.Dress2, Doll.Drawers.Dress3, Doll.Drawers.Dress4];
    
              for(var i:int = 0; i < dragArray.length; i++)
                {
                        dragArray[i].buttonMode = true;
                        dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
                        dragArray[i].addEventListener(MouseEvent.MOUSE_UP, item_onMouseUp);
                }
    
    function item_onMouseDown(event:MouseEvent):void
              {
                   var clip:MovieClip = MovieClip(event.currentTarget);
                   clip.startDrag();
              }
    
    function item_onMouseUp(event:MouseEvent):void
              {
                   var clip:MovieClip = MovieClip(event.currentTarget);
                   clip.stopDrag();
                   if(clip.hitTestObject(Doll.Skins))
                        {
                                 //Here's where the problem starts!   ----------------------------------------------  //
                                  trace(clip.name);  // but that won't be Doll.Drawers.Dress1.  it might be Dress1.
                        }
              }
    
    
    

Maybe you are looking for