Roots/path & this.parent - asking for simple clarification

Step - the sandbox is where all things happen.
MovieClip - an object that can be placed on the stage or in layers or attached to other clips.

Layers of MovieClips on stage
Example:
Stage > MC1 > MC2 > MC3
Family analogy to the hierarchy:
Environment > Grand Parent > Parent > child

(1) for access to the control of the MCs of the Document (stage) class
-If the STM is brought on stage and given names use you that name to control them. (Logic)
-If an object is dynamically added to the step how is it accessible? (Confused)

2) access control of MCs of MCs on the stage who '.as' file by running.
-Can change the properties of other MCs MCs? As scaleX, scaleY properties view? (Unknown/confused)

'This' and 'Parent '.
-this.parent.mc - when it does exactly?
-parent.mc - where it is exactly?
-mc - when it does exactly?

Usage example: Stadium > MC1 > MC2 > MC3

In step (Document class) is access MC3 then use: "mc3".
When MC3 accesses MC1 use: "this.parent.mc1".
When MC2 accesses to use on stage: 'scene' example 'stage.width.
Vaguely is that kind of how it works?


QUESTION--= =-

If someone is willing to clarify all the pieces of this or has a fan friendly use of 'This', 'Parent' and appropriate use of the roots depending on where you are on the stage or in a MovieClip and how to properly refer to an another MovieClip or the scene would be useful. Forgive me if I have an abuse of words, terms. I use Adobe Flash Professional CS5 and AS3.0

In AS3 you can reference objects by name or by reference. In AS2 you mainly referred to objects by name, so this may be confusing for some newcomers to AS3. A name he set, for example, when you drag a clip to the stage and type an instance name. A reference, on the other hand, is just an object that points to another object. You must create a reference when you dynamically create some MovieClips, for example:

var mcRef:MovieClip = new MovieClip();

The variable "mcRef" is a reference to this new MovieClip, however it didn't name. You can use "mcRef" as you would a named instance, the definition of the properties as "mcRef.x = 100", etc.. A reference is much more useful than a name, because it can be spent in the different application fields for you to access objects that would otherwise be difficult. For example, you can use a reference to refer to a deeply nested MovieClip without having to type it every time:

var mcRef:MovieClip = myMovie1.nestedMovie1.nestedMovie2.nestedMovie3;

mcRef.alpha = 0.5;

The "parent" means the container that particulat object resides in. So take the example of "mcRef" above, the "mcRef.parent" would be "nestedMovie2". "mcRef.parent.parent" would be "nestedMovie1" and "mcRef.parent.parent.parent" would be "myMovie1". For dynamically generated clips, the parent will be the subject of container you called "addChild()" add this child element to the display list. For example:

myParent.addChild (myChild);

The property "this" refers to the scope at which you call it. So, if you are in the document class, you call 'this', he referred to the scene. If you are in an external class, then it refers to the instance of the object of this class. This will allow you to access all of the properties in this scope, such as "this.x = 0", "this.alpha = 0.5", etc.. ". It will also allow you to cross to the top of the display list as in the use of «this.parent» Keep in mind that you do not explicitly refer to 'it', it is assumed. So you can easily just say 'x = 50' and it's the same as "this.x = 50".

Virtually all of the common properties are public (like x, y, scaleX, alpha, etc.) so as long as you have a reference to an object, you can change its properties from anywhere.

In general, you want to give their own class objects (of right in the library and go to the linking options). So lets say you have a graphic square, you can give it a class of "Square". If it's just a chart, with no particular feature, so he can't give it an external class file (IE Square.as). If you want it to have some custom methods and properties you need this external class. However, if you just want to add a static image on stage, then you can just use the auto-generated class. Anyway you if instantiating the object as follows:

var mySquare:Square = new Square();

addChild (mySquare);

If you want to add another square that you could do this instead:

var mySquare2:Sqaure = new Square();

mySquare.addChild (mySquare2);

Now, if you want to access mySquare2, you always use the reference "mySquare2.x = 100" for example. Stays of reference within the scope you created. Thus, for example, the following would NOT work: "mySqaure.mySquare2.x = 0". That works only with a named instance, not with references. You can, however, still use "mySquare2.parent" and which refers to "mySquare.

I hope this helps.

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • HP Envy 15-ae104no: install the HARD drive

    Hello. I have a question about the HP Envy 15 - ae104no which is equipped with a 256 Gb SSD m2. Before burning I would want to know if it is possible to install a sata 1 TB of disk as a 2nd hard drive in this PC. Thanks in advance. What about Peter

  • Dynadock U3 - Ethernet does not - send/receive flashing every 3 seconds

    My wife uses a Dynadock with a spectrum of XP.Ethernet worked fine when I first put in place, but I just noticed the wired connection does not work (only works with wireless). Send & receive lights on n/w Dynadock port flash every ~ 3 seconds, the Wi

  • Equium M50 - motherboard is dead

    Hi all I decided that my motherboard is fried. Can advise you on a number of things pls? 1. since I need to get a new motherboard, there you can recommend that will fit the envelope for my equium m50? Or should I stay with perimeter? 2. What is the b

  • Headphone Jack also for Microphone?

    Could not find cela anywhere I like the old school WIRED earphones have a microphone for use on a cell phone. Cannot test my microphone taken 2.5 mm on my XT1527 (bike E 2nd generation LTE). In addition, impossible to find in specifications anywhere.

  • XP invites a memory, but invites MS-DOS of Win 95 only

    When I copy files (for backup) command in XP, it comes up with 'Memory' and restricted on a folder with many files, some with very long file names. Yet when I use a similar shortcut that I postponed of Office 95 (on all later versions under Windows)