converting a string into a variable

I have a string that stores the name of the instance of the object:

var instName:String = e.target.name;

and now I need to use its information to do something like this:

instName. Alpha = 0.3;

but since it is a string, it causes this error:

1119: access of alpha property may not set a static String type reference.

Using the name property can be random if the instance name is not the same as the name property (they are not necessarily the same in AS3), but if the name property is the name of the instance, you can use:

This [instName] = 0.3 .alpha;

If the property name is not the name of the instance itself, but it is the instance name property, then you would use:

this.getChildByName (instName) .alpha = 0.03;  possibly subject to casting

Another option is to store a reference to the object itself.

var instRef:Object = e.target;  You can replace the object with the actual class

instRef.alpha = 0.3;

Tags: Adobe Animate

Similar Questions

  • split a string into separate variables

    Suppose I have a procedure that returns the following for the parameter,

    V_STR: = ' 10077500733 | 10077500733 | 14/04/2015 | Τ | AJ240557 | 2012 | GREECE | GR | MAN | 00108337640 | CLARKSON | DAVID"

    How to cut this string into separate variables?

    for example v1 = 10077500733

    v3 = 14/04/2015

    v4 = null;

    Thank you

    with qry (STR) as)

    Select ' 10077500733 | 10077500733 | 14/04/2015 | T | AJ240557 | 2012 | GREECE | GR | MAN | 00108337640 | CLARKSON | DAVID' the double

    )

    Select the level,

    RTrim (regexp_substr (str, ' [^ |] *(.| $) ', 1, level), ' |') ASPLIT

    of qry

    connect by level<= length="" (regexp_replace="" (str,="" '[^|]+'))="" +="">

    LEVEL ASPLIT
    1 '10077500733'
    2 '10077500733'
    3 April 14, 2015"
    4
    5 ' T '
    6 'AJ240557 '.
    7 '2012 '.
    8 "GREECE".
    9 "GR".
    10 "THE MAN".
    11 '00108337640'
    12 "CLARKSON."
    13 "DAVID."
  • convert the string into individual components table

    Hello Experts,

    I would like to display an array of strings in a display of text/string. for example:

    My array of strings is:

    ['I', 'L', 'O', 'V', 'E', 'L', 'A', 'B', 'V', 'I', 'E', 'W'], and I want to show this picture as I LOVE LABVIEW in an indicator of the string and not an indicator array.

    How do I do that? I tried flatten to sting, but it added a lot of zero to the channel indicator, and the display is not only correct appearance.

    I hope my question makes sense.

    The functions of concatenate strings will do exactly what you want.

  • convert a string into several strings

    I have a column 'name' in which records are like "shailesh singh negi", 'vipin kumar singh'... my requirement is to split this column into three columns such as "first name", "middlename", "name" and the chain should insert respectively as 'shailesh' in 'name', 'singh' in "middlename" and "negi" in the "lastname" column I used a query to split into two columns bt not able to do the same wid three columns...
    request for two columns is like that...
    substr (name, 1, instr(name,' ')-1) select firstname,
    substr (name, instr (name, "") + 1) lastname
    table;

    Hello

    See first Instr and Substr functions
    Example of

    select substr('shailesh singh negi',1,instr('shailesh singh negi',' '))  firstname ,
    substr('shailesh singh negi',instr('shailesh singh negi',' ')+1,instr('shailesh singh negi',' ',1,2)-instr('shailesh singh negi',' '))  middlename ,
    substr('shailesh singh negi',instr('shailesh singh negi',' ',1,2)+1,length('shailesh singh negi')-instr('shailesh singh negi',' ',1,2)) lastname
    from dual;
    
  • How to convert the string to the variable of the apex

    Hello

    I need to replace the overall point of the table column value chain in its value of origin when the page is rendered.

    the process code - plsql
    -column replacestring contain the string F100_EMPID value
    declare
    REP varchar2 (100);
    Start
    Select replacestring in the rep of emp;
    Select Replace ('EmployeeID', replacestring) in the content of emp;
    HTP.p (content);
    end;

    The output is:
    The employee ID is: F100_EMPID.

    but I need the actual value of the global element when the process is rendered.

    Select Replace (content, "EmployeeID",: F100_EMPID) in the content of emp;

    This statement gives a correct output: Employee id is: 230092

    I need to replace the string in the column of the table in the real global element inside the plsqcode for dynamic rendering code.

    someone please help me solve this problem.

    Thank you.
    ~ Logaa

    Hello

    What happens if you use:

    Select Replace (happy, 'EmployeeID', v (replacestring)) in the content of emp;
    or maybe
    Select Replace (content, "EmployeeID", v ("| replaceString |")) in the content of emp;

    Greetings,
    Roel

    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.Logica.com/

    You can assign this answer to your question in marking it as useful or Correct ;-)

  • String to the Variable of the PSP?

    Hello

    I was hoping I could buid programmatically a variable path shared and then use the Reading Variable VI to read a value.

    Unfortunately, while I can convert a PSP Variable in a string, I can't do the reverse. The output of the string to the shared Variable VI is not recognized by the Reading VI Variable. I tried to convert it to a PSP Variable to help more class specific, but she would not allow LabVIEW or the other.

    Is there a way to convert a string to a variable that is shared by program readable?

    Thank you!

    DUH... I can use the Container Seach VI, as the beginning of my posted code... X_x * slinks away in embarrassment *.

  • Converts a date into a date/time object string

    I have a JDBC call to enter data, including a date/time stamp.  For the life of me, I can't understand how to convert this string to a date/time field correct.  It is important, because I need to use validation strings to present a time more simplified users on a form.  But I like to keep the original date/time, so I can insert it again into a SQL db at the end.  I created a test process, so I can watch the progress.


    ' input string = ' 18/08/2010 16:41:23.

    Expression = dateTime-analysis-withFormat (/process_data/@datestring,"yyyy/MM/dd hh', 'FR', 'US', 'WIN',"CDT")

    Result = 18 August 2010 22:41:23 this

    So I try to put this value into a date field and I get the error:
    : Invalid ISO8601 DateTime:August 18, 2010 21:41:23 GMT:java.text.ParseException: date of: "August 18, 2010 22:41:23 this."


    I tried like 100 different variations to associate with an object date and time with the same result.  I can use the functions of analysis-dateTime or analysis-dateTime-withFormat throughout the day, but I can't get this string value in a proper date field.  Any ideas?  Please help as I'm about to pull out my hair... ... who won't be pretty.

    (Note: I know that my time zone came through OK but I am not concerned about it right now)

    To resolve this problem, I use ExecuteScript activity with the code:

    import java.util.Date;
    import impossible;

    String dateString = patExecContext.getProcessDataStringValue ("/ process_data/@input");

    SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-DD hh: mm :"); ")
    Date date = (Date) formatter.parse (dateString);

    patExecContext.setProcessDataValue ("/ process_data/result", date);

    where

    entry - process line with the dates of the string variable '2010-01-01 23:59:59 '.

    Date - date process variable

  • convert string into array of char

    What is the best way to convert a string to an array of characters?

    Thank you.

    String to byte array

  • Get string of data Variables

    Hello

    I'm post and retrieve data to an ASP page on a site.

    The data returned using the following function:

    var dataS3:String;
    function handleComplete3(event:Event):void
    {
         var loader3:URLLoader = URLLoader(event.target);
         dataS3 = loader3.data;
         trace(dataS3); 
    }
    
    

    The trace (showing the received data) looks like: score1 = 0.5244005132792953 & score2 =-0.27105341041929653

    How can I get these 2 partitions (score1 and score2), which seem to be part of a string of data, into separate variables that I can then later use as numeric values in frames (round/add/subtract/multiply/divide their)? Is there a way to analyze the 2 variables for use in mathematics from frame later? Would I declare var DataS3 differently or keep it as a string, and then somehow convert the string back to separate the numbers or integers?

    Any help appreciated.

    In general, you use objects, you can run a loop on this. You can also type cast that you do only when you must instead create a variable to use.

    Your example rewritten using a table and casting can be:

    function handleComplete3(event:Event):void

    {

    do a bunch of var = value pairs

    var urlVars:Array = String (event.target.data).split("&");)

    S5

    trace (String(urlVars[0]). Split ("=") [1]); a string of draws

    S6

    trace (String(urlVars[1]). Split ("=") [1]); a string of draws

    Now you want to conversion, just convert online numbers instead of again assign vars

    S7

    trace (Math.Round (Number (String(urlVars[0]). ((Split ("=") [1]) * 1000) / 1000); number of prints

    S8

    trace (Math.Round (Number (String(urlVars[1]). ((Split ("=") [1]) * 1000) / 1000); number of prints

    }

    The fundamental point is that you can use the data that you receive directly and unless it is in a feature called very intensively you can just multiple operations at the same time without saving changes out of additional variables.

    You are allowed to Garland and types of melting as you go. For example I have to split the string by one & ampersand into a temporary array, I did it for easier reading. To print your S7 I would have done this one line of code:

    function handleComplete3(event:Event):void

    {

    traces of your S7

    trace (Number (Math.Round (Number (String (String (Event.Target.Data). Split ("&") [0]). Split("=") [1]) * 1000) / 1000));

    }

    There is no difference between the S7 printing. You assigned a bunch of variables and set up one by one. I sank anonymously their Garland style without attributing all the variables working directly on the data. I just wanted to point the daisy chaining power of ActionScript. You can convert things as you go and condense the code and dynamic variable usage a bit.

  • convert a string to a path

    I want to assign a value to a global variable of the station (type: number) to the local variable (type: number).

    The problem is, that knowledge straight from the global variable of the station at the time of execution.

    I have a string like "StationGlobals.PARAMETER.SWITCH.xx.nRESISTOR_VALUE" - the characters 'xx' variable will be replaced when running...

    Now I want to convert this string to a path variable to assign to the local variable (type: number) the value of the global variable of the station (type: number)

    Do you know how I can do?

    Greetz

    Jonathan K.

    Try

    Locals.nCurrentResistorValue = Evaluate (Locals.sFunctionPath)

  • converting a string to some general engineering

    Hello world

    All know how to convert a string of engineering in a normal formatted string?

    Thank you

    Hi nem.

    in your vi there is no 'CH2-01. Do you mean "DAQ21"?

    See the attachment for a few minor changes (deleted sequence, its inhabitants, to build a better way). Why divide you your berries into 4 parts when you need to rebuild all the berries again?

    Are you sure this isn't a problem of formatting Excel? You set all the numbers in the excel worksheet to display in the form of "numbers"?

    When I try your vi I do not get any number in scientific format in Excel. (And I would say to transpose Excel import data...)

  • convert the string ASCI spell

    The attached VI allows me to convert a single ASCII character to the spell.

    If I have a string of ASCII characters, I can convert them to break the string into individual characters and converting each individually then forming a chain again. Is there an easy way to convert a hexadecimal ASCII without analysis string?

    For example: CN1003001A (string ASCII) must be equal to 434E3130303330303141 (string hex).

    Thank you

    String to byte array, number in hexadecimal string Concantanate String.

  • How to split a string into several substrings parent using a delimiter

    Hello

    I am forced to split a string into several substrings parent using a delimiter.

    And insert these substrings in variuou of the columns of a table in a row.

    For example. The sting is: ABC * DEF * GHI * JKH *.

    where ' *' is the separator.

    Desired output:

    Col1 Col2 Col3 Col4 Col5

    -------     --------     --------     -------     ---------

    JKH GHI ABC DEF (null)

    Could you please guide me how can I achieve this.

    Thank you

    Bogoss

    Hello Salim,

    Leave the thread for reference... got this excerpt:

    with t as

    (

    Select "c: its: hgfd:1:23" Str

    )

    Select

    REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 1, null, 1) col1

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 2, null, 1) col2

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 3, null, 1) col3

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 4, null, 1) col4

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 5, null, 1) col5

    t;

    This code snippet works well, but for the fixed columns. Here are 5 predefined columns.

    But I need to have a logic that I can browse the string any No.. sometimes.

    For example. If I get 3 secondary channels of the parent chain... I need to insert into 3 columns.

    And if I get 6 strings under... I need to insert into 6 columns.

    Could you please help me develop a logic like that.

    I use Oracle database 10g.

    And the data are currently being collected on external table... but I can store in a variable or a column of a database table.

    Thank you

    Bogoss

  • Convert the string separated by commas in the rows

    Dear gurus,

    I want to convert the string separated by commas in the rows to insert in the collection.

    for example, the string 1234,2323,23232,2343,34234
    Higher up in the chain must be converted to ranks in order to insert into the table or the collection

    Thanks in advance
    Sanjeev

    String in rows separated to convert the comma.

    with t
    as
    (
    select '1234,2323,23232,2343,34234' as txt from dual
    )
    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
      from t
     connect by level <= length(regexp_replace(txt,'[^,]*'))+1
    
  • Converts a string to a problem posed by the

    Hello!

    I get an ORA-01861: "literal does not format string" when you try to convert a string
    on a date.

    Currently stored as VARCHAR2
    14SEP11
    Should be
    to_date(start_op, 'DD-Mon-YY HH24:MI:SS') AS FORMATTED
    Date format
    NLS_DATE_FORMAT                DD.MM.RR 

    user545194 wrote:
    Hello!

    I select the column name:

    select to_date(start_op, 'DD-MON-YY') AS FORMATTED from table
    

    Column name: start_op

    A conversion problem?

    SQL> create table otn(p_date varchar2(7));
    
    Table created.
    
    SQL> insert into otn values('14SEP11');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select to_date(p_date,'DDMONYY') from otn;
    
    TO_DATE(P
    ---------
    14-SEP-11
    
    SQL> 
    
    SQL> alter session set nls_date_format='ddmonyy';
    
    Session altered.
    
    SQL> select to_date(p_date,'DDMONYY') from otn;
    
    TO_DATE
    -------
    14sep11
    
    SQL> 
    

Maybe you are looking for