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

}

}

}

}

Tags: Adobe Animate

Similar Questions

  • Create lines based on the difference in date

    Hello

    I would like to create lines based on the difference between the start and end dates (per year).

    for example

    ID1  Start_time                                             End_time                                                      ID2
    07/01/2003 1, 12.00.00.000000000 2005-01-07 12.00.00.000000000 123

    07/01/1999 1, 12.00.00.000000000 07/01/2003 12.00.00.000000000 345

    I need:

    ID1  Start_time                                             End_time                                                      ID2
    07/01/2004 1, 12.00.00.000000000 2005-01-07 12.00.00.000000000 123

    07/01/2003 1 12.00.00.000000000 07/01/2004 12.00.00.000000000 123

    1 01/07/2002 12.00.00.000000000 07/01/2003 12.00.00.000000000 345

    07/01/2001 1, 12.00.00.000000000 01/07/2002 12.00.00.000000000 345

    07/01/2000 1, 12.00.00.000000000 01/07/2001 12.00.00.000000000 345

    07/01/1999 1, 12.00.00.000000000 07/01/2000 12.00.00.000000000 345

    Thank you

    Hello

    Here's one way:

    SELECT ID1

    , ADD_MONTHS (start_time, 12 * (LEVEL - 1)) AS start_time value

    , ADD_MONTHS (start_time, 12 * LEVEL) AS end_time

    id2

    FROM table_x

    CONNECT BY LEVEL<= months_between="" (end_time,="" start_time)="">

    AND PRIOR id2 = id2

    AND PRIOR SYS_GUID () IS NOT NULL

    ;

    I'm assuming that id2 is unique.

    Would what results you if end_time wasn't exactly N years after start_time?

  • Bookmarks created automatically based on the word 2013 Table of contents.

    Bookmarks created automatically based on the word 2013 Table of contents.  In the earlier version of Word, the Style of the Table of contents built into bookmarks when PDFing.

    I thought about it.  There is a new check box, you must activate in 2013 of Word when exporting to PDF format that allows to convert the elements of bookmarks when PDFing.

  • When you save a file to the [.jpg] format, I wonder to choose a quality from 1 to 100. What are the changes in the created file based on the selected quality setting?

    When you save a file to the [.jpg] format, I wonder to choose a quality from 1 to 100. What are the changes in the created file based on the selected quality setting? I would like to know what changes, so in the future, I can set my camera to one who will give me the highest quality in a first time, which allows me to make cultures and always preserve the quality.

    Thank you

    Dovid

    Thank you twenty-one... your answer of common sense to me.

    so, in short, can I assume down the chosen quality over compression algorithm?

  • Create Unique Session Variable based on the login page

    Hello:

    I'm building a dynamic website with Dreamweaver CS5 with Coldfusion 9.

    My question is how can I set a session variable to read a certain value. It is currently when my clients go to the login page they enter their username and password. I was able to create a session variable that contains the user name as value. So in all their pages read Welcome website "all that was their connection username. Now, I want to get the session variable to read the same table but the different FullName field. This way, that the web pages will say Welcome "FullName (based on their login user name)" I tell myself that I have to configure a query parameter, but after trying and failing for four hours to produce a successful result, I resorted to post my problem here. I appreciate the help and advice.

    My information:

    DataSource = Table 'Access' = 'Logininfo' (current) land (for the session variable) = 'User_name' (desired) field (for the session variable) = "full name".

    Currently using (server behaviors: Variable de Session) MM_Username on each relevant page for the user.

    My sign in page code is as follows:

    Head:

    < IsDefined ("FORM.username") cfif >

    < cfset MM_redirectLoginSuccess = "members_page.cfm" >

    < cfset MM_redirectLoginFailed = "sorry.cfm" >

    < "MM_rsUser" datasource = cfquery name = "Access" >

    "SELECT AccessLevels FROM Logininfo WHERE username, password, username, FullName is < cfqueryparam value =" "#FORM.username #" cfsqltype = "cf_sql_clob" maxlength = "50" > AND password = < cfqueryparam value = "#FORM.password #" cfsqltype = "cf_sql_clob" maxlength = "50" >

    < / cfquery >

    < cfif MM_rsUser.RecordCount NEQ 0 >

    < cftry >

    < cflock scope = "Session" timeout = "30" type = "Exclusive" >

    < cfset Session.MM_Username = FORM.username >

    < cfset Session.MM_UserAuthorization = MM_rsUser.AccessLevels [1] >

    < / cflock >

    < cfif IsDefined ("URL.accessdenied") AND false >

    < cfset MM_redirectLoginSuccess = URL.accessdenied >

    < / cfif >

    < cflocation url = "' #MM_redirectLoginSuccess # ' addtoken ="no">"

    < cfcatch type = 'Lock' >

    <! - the timeout of cflock management code - >

    < / cfcatch >

    < / cftry >

    < / cfif >

    < cflocation url = "' #MM_redirectLoginFailed # ' addtoken ="no">"

    < cfelse >

    < cfset MM_LoginAction = CGI. SCRIPT_NAME >

    < cfif CGI. QUERY_STRING NEQ "" > "".

    < cfset MM_LoginAction = MM_LoginAction & "?" & XMLFormat (CGI. QUERY_STRING) >

    < / cfif >

    < / cfif >

    Body:

    Connection < h1 > < / h1 >

    < p > please enter your login information the registration form in order to access your member account page. < /p >

    < form ACTION = "" < cfoutput > #MM_loginAction # < / cfoutput > "method ="POST"id ="login"> < table width ="auto"border ="0"align ="center">"

    < b >

    < td > < label for = "username3" >

    < div align = "right" > user name: < / div >

    < / label > < table >

    < td > < span id = "sprytextfield1" >

    < input type = "text" name = "user name" id = "NomUtilisateur2" accesskey = "n" tabindex = "10" >

    < span class = "textfieldRequiredMsg" > a value is required. </span > < / span > < table >

    < /tr >

    < b >

    < td > < label for = "password" >

    < div align = "right" > password: < / div >

    < / label > < table >

    < td > < span id = "sprypassword1" >

    < input type = "password" name = "password" id = "password" accesskey = "n" tabindex = "15" >

    < span class = "passwordRequiredMsg" > a value is required. </span > < / span > < table >

    < /tr >

    < b >

    < td colspan = "2" > < div align = "center" >

    < input type = "submit" name = "submit" id = "submit" value = "Login" accesskey = "n" tabindex = "20" >

    < / div > < table >

    < /tr >

    < /table >

    < / make >

    < script type = "text/javascript" >

    var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1");

    var sprypassword1 = new Spry.Widget.ValidationPassword ("sprypassword1");

    < /script >

    I'm sure it is something simple and will show my status as a rookie for the asking, but thanks for your help!

    A session variable is also the best route to go? I'll use this to query databases to display and allow them to change contact information, also show their invoices and request services.

    I don't know CF so forgive me, but you can create a session for fullname variable or use a query on your pages to filter the data WHERE username = user session variable. Looking at your code, it looks like you can add a session to the full name variable here:

  • How to set the binding on a LOV variable based on the value of the calling page

    Here is the scenerio: Page is a login (username and password) page and their values are stored in a pod of support. On successful login page two is called (createRequest) based on
    a view object 'Userequest '. One of the fields is EmpNo which is a selection on the element of choice ("EmpByMrgLOV" read only view Explorer that contain the variable bind "UserNameId"). I want only to be displayed in the LOV
    employees who report to connected users. I tried different ways to set this parameter, but without success. It's my first attempt using JDeveloper and ADF and 4 days have already
    was devoted to it. Can someone please tell me where and how to proceed? Be as detailed as possible. I use Jdeveloper 11.1.2.3.
    Thank you.

    Published by: spcornell on February 27, 2013 12:09

    If your still to know how to to this topic, here's an option. I hope this helps.

    -----------------PART 1-----------------------------------------------------------------------------------
    Override the default constructor as this.
    lov instance will be created after the entry of the TF of the 2nd screen, so by LoggenInUser then will start,
    and will be used to create the instance of lov uses this value as a bind variable.

    SerializableAttribute public class EmpByMrgLOVImpl extends EmpByMrgLOV {}

    private String myusernameid ="";

    /**
    * This is the default constructor (do not remove).
    */

    public EmpByMrgLOVImpl() {}

    Set usernameid here when built
    get the usernameid of the bean class - btw the bean will be updated on the Taskflow method call before execution and now and set in constructor
    FacesContext facesContext = FacesContext.getCurrentInstance ();
    ELContext elContext = facesContext.getELContext ();
    ExpressionFactory expressionFactory = facesContext.getApplication () .getExpressionFactory ();
    ValueExpression exp = expressionFactory.createValueExpression (elContext, "#{mySOMEBean.LoggedInUser}", Object.class);
    This.myusernameid = (String) exp.getValue (elContext); set the user to act as link var

    }

    {} public void setmyusernameid (String myusernameid)
    This.myusernameid = myusernameid;
    }

    public String getmyusernameid() {}
    Return myusernameid;
    }

    }

    -----------------PART 2--------------------

    variable binding must Access EmpByMrgLOV VO using groovy as below

    You EmpByMrgLOV YOUR query tab, add bind var as below:
    Name = EmpSOMEUser (change to what your query)
    Type = String
    Value = ADF. Object.viewObject.myusernameid

    -----------------PART 3--------------------
    Once you have created a method taskflow run between your fist and 2 nd page, add set / gets in the bean for the var as below

    public MySOMEBean {}
    private Stirng LoggedInUser ="";
    {} public void someMethodCalledBeforeTFEntryintoSecoundScreen (String loggedinuser)
    if(loggedinuser!=null)
    setLoggedInUser (loggedinuser);
    else {}
    System.out.println ("not loggedin user");
    setLoggedInUSer (null); This will result in a null btw pointer
    }
    }
    public setLoggedInUSer {(String loggedinuser) {blah blah}}
    public String getLoggedInUser() {blah blah}
    }

    So part3 gets put first based on what you collect on your first page, then
    part1 at lov construction that uses part3 for her time

  • Page number variable based on the anchor text &amp; SEO numbered list

    I looked and looked, not only in Adobe help centers but also just in Google, and I can simply find an answer one way or another to my questions!

    I would like to do 2 things:

    1 use a variable to refer to that page more information can be found on a certain subject (i.e. for more information, please see page #.), even if the page number will no doubt change I have continue to work on this project and eventually build my book from the various documents that I created.  I can insert a kind of marker or anchor text or whatever it is I need the information that I am referencing, as long as it is not visible, of course.  I would just have a dynamic reference, so I don't have to go back through and try to check my page references are all correct.  The variable of the current Page will help me not in this case.

    2. I would also like to refer to numbered tables I have; they are currently configured as being numbered by a custom paragraph style which is mode number, 'continue previous number "; Another situation where the table numbers will change because I continue to work on this book and I want a dynamic solution.  If I need to insert a variable to calculate the numbers in the table, rather than using the paragraph numbering style, it is very good; I prefer to do a little more work now, so that I can be sure my references are accurate, when this is said and done!

    Thanks in advance for any help you can give!

    Cross references.

  • Create links based on the color in Flash

    I have a picture with seven distinct colors.  I would like for each color is linked to a separate html page if clicked.  Can Flash the link to a page based on the color of the selected area?  If so, how?  Otherwise, any ideas on a work around?

    Thank you!

    A button has four images. The fourth framework is the "hit". All that is in this framework will define the hotspot of the cursor to the button.

  • Update a variable based on the expiration date checking against now() in each row of a table

    I use Coldfusion 9,0,0,251028 on Windows 7 64 bit with a Microsoft Access 97 database.

    I am creating a query that loops through all the rows in a table and checks if the current date is earlier than the date of expiration or later. 

    If the expiration date column is earlier to now(), it sets the column "is_current" to 0, which is a variable that determines if a message appears on a page (breakingnews.cfm) different. 

    The column that has the expiry date is "exp_dat" in the "news" table. The query I have at the moment is:

    <cfquery name="expire" datasource="#db#">
    

    Two things:

    1 - a query will never affect rows that you did not. So if new lines have the is_current set to 0, then it's because you want to set or out in the instructions of your return or you set a default value to the column. Just make sure that you set the 1 column when you insert the new line.

    2. Why are you doing this at all? Say you run your update query (which is relatively intensive) a millisecond before the expiration of one, it will still appear on your page. Why you not just do "SELECT * FROM MaTable WHERE correspondents > now() '?

    Obviously using cfqueryparams, but this is just an example. It seems for now what you do is store obsolete data in a database and cause you more work and overhead.

  • Create the object based on the Instance of TestStand

    Hello

    I currently have TestStand code that creates an ActiveX to a StationGlobal object reference...

    Currently, the created ActiveX object reference is always the same... I am looking for a way to create a different ActiveX object reference depending on which instance of TestStand open...

    So I guess I'm wondering if there is an easy way to do this? Is there a variable that I could use to distinguish the various teststand and somehow that integrate Options create?

    Thanks for any response.

    I can imagine that this Engine class property can help you:

  • From LR6.1 to LR6.3: rename folders created are based on the date of importation rather than the date of shooting!

    I started using LR with version 2... My import workflow was even up to 6.1 and all my files are organized in the same way for more than 10 years.

    I went on LR6.2 given the changes made in the import dialog. But upgraded to LR6.3 think the problem has been resolved.

    But now I noticed that all my photos are renamed and placed in folders corresponding to the date of importation rather than the date of shooting... I rename my files from custom and is gone in this dialogue, but has not as how to restore LR import my photos using the date of shooting. This creates havoc on my hard drives and in LR. I use the date of shooting a lot to find my photos, since I often neglect to add keywords.

    I really need to be able to get the date of shooting on the behalf of my photos and have copied them in the folder the correct date.

    Thanks in advance for your help.

    BTW: something has changed in the way the forum appears. Research is not very powerful... it has not brought something, yet I know that the import dialog has been at length when 6.2 was introduced. In addition, I see no browser passed a few more recent messages. I don't like the new interface.

    Well, I answered my own question. Yes, I was looking for settings in the destination Panel... There is a line that shows what would change the name... and it showed the date of importation as the new name... but actually... It was only to show you what the name change would look like. Because I had a selected image, I thought it would show that the change of name for this image. But it is not related to the image... The import worked as expected... My apologies for disturbing him. .

  • Create table based on the timestamp prtition generate ORA-14752

    Hello

    I have following question - why create table 1 generate ORA-14752 script? Script 2 works without any problem. Feel it is on interval - day/month. How to create the script table 1?

    Database:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    1.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTOYMINTERVAL (1, 'DAY'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

    2.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTOYMINTERVAL (1, 'MONTH'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

    YM in NUMTOYMINTERVAL stands for the year and the month. With NUMTODSINTERVAL it should work.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTODSINTERVAL (1, 'DAY'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

  • How to create a dependent list of values based on the relationship master detail

    Hello

    I'm on jdev 11.1.2.4.

    1. I have a table main 'Reception' with the columns receipt_id and student_id (ReceiptVO)

    2. as well as an array of details 'Receipt_Detail' with the columns receipt_id, course_id (ReceiptDetailVO)

    (There are some othere columns in the two tables, but I've only mentioned those which is relevant to this example.)

    3. the two tables are related with receipt_id.

    I want to create a dependent class LOV that filter courses related to the student selected in the main table. (There is a student_course table that holds student_id, relationship of course_id, StudentCourseVO)

    to do this, I have

    1 created VO based on the student_course table

    2 Add a view that filters based on the id of the student

    3 assigned this VO to receipt_detail tables course_id

    It comes

    in the accessor receipt_details VO view, I do not show the ability to select the student_id of the main table (IE ReceiptVO). It only shows the columns in the ReceiptDetailVO.

    Please can you help me?

    Thank you

    What you need in your ReceiptDetailVO is the StudentId of master ReceiptVO attribute.

    To do this, you can:

    1. for your ViewLink (between ReceiptVO and ReceiptDetailVO), you must generate the Source accessor:

    In this way, in the VoRowImpl Java to ReceiptDetailVO class, you will get a way to access master ReceiptVO line (you can find a new method with the name that you gave the name of the accessor in the top of the dialog box)

    2. then, in the ReceiptDetailVO, create Transient attribute, say, MasterStudentId. Access Java's VORowImpl class, within the get for this new attribute accessor method, use the previous step name accessor method to get the line main and finally master StudentId.

    3. the rest is easy - use this new attribute transitional to filter LOV about the student teacher ID...

  • Can I import this module settings to automatically create variables?

    Hi all

    I try to reuse a Labview VI within TestStand as a module of code.  There are a lot of input and output parameters, and I need to create a separate variable for most of them (probably globals file) so that I can change values dynamically during test sequences.  I see in the code module loading, associated parameters are automatically imported into the parameters of the step, but I would like to know if there is a way to automatically create variables to "convert" the parameters of the code module.  I read a few threads on the creation of dynamic variable and property magazine steps, but these do not seem to have what I'm looking for.  Please notify.  And, as usual, if it looks like I'm wrong understand how TestStand, please correct me.  I am only a few weeks to use it.  Thank you very much.

    GSinMN

    The answer is no, you can't.

    You can ask TestStand create types of complex data for you.  There is a small button next to the parameter and it will create the type definition.  However, you should always create all instances and then move those to and from the VI.

    By default, TestStand will link the error message on the wire with the Step.Result.Error.  The rest are pretty much up to you.

    I guess the question/s would be: How does he know where to create the instances?  FileGlobals? People of the country? Settings? Globals station?  Step properties?  Constant value?  There are a ton of places that seem to be the options in question.  This can be a good feature request...

  • How to migrate a report created by a user in OBIEE from one Instance to another?

    Hi all

    How to migrate a custom report created by the user in one instance to another.

    For example the user created a custom in the instance of the UAT report now I need to move it to PROD.

    Thank you

    Vishwamber Shetty

    Hello

    In a simple way, you can select State of catalog goto and Archieve it. Copy this physical file on the other machine new catalog goto and unarchieve it.

    AjitR

Maybe you are looking for