Use the string as instance name

var character: Array = new Array();

for (var i: int = 1; i < = 26; i ++)

{

If (I < 10)

{

Persona.push ("persona0" + i);

}

on the other

{

Persona.push ("persona" + i);

}

}

//

var personaclip = persona [4]; persona04

var personainstance:MovieClip = new personaclip();

addChild (personainstance);

What I'm trying to do here, is first to create a table of all 26 clips that are already in the library and the value of export for actionscript, persona01 to persona26.

Can I choose the number for the clip to use, which is persona04. I would like to add that, for the scene. So I first create the instance of the element persona04 through personainstance and then add it by addChild.

But the variable personainstance is where I'm going wrong I get an error #1007 trying to create an instance on an element that is not a constructor. How can I make it clear that for the movieclip personainstance I want to select the clip of persona04 form the library? Guess I have to convert the string "persona04" in the name of the constructor, somehow.

creating instances of dynamic class using strings
-------------------------------------------------------------

var ClassRef: Class = Class (getDefinitionByName ("className"));
var classInstance: * = new ClassRef();
addChild (classInstance);

Tags: Adobe Animate

Similar Questions

  • Expection while using the string (compare-ignore-case, uppercase) function

    Hi all

    I am using soa suite 11.1.1.6

    JDeveloper 11.1.1.6

    I tried to use the string functions (only 2 xp20:upper - box (), oraext:compare-ignore-case()) with an xpath expression. But it is throwing an error saying that the xpath expression is invalid. I used the same xpath expression in an assign activity that works very well. The string functions are works well when it is used with constants. But the case failed when they are used together this way

            <assign name="Assign1">
                <copy>
                    <from expression="bpws:getVariableData(xp20:upper-case('inputVariable','payload','/client:LoanEligibiltyRequest/client:LoanType'))"/>
                    <to variable="HL"/>
                </copy>
            </assign>
    

    This is the log

    < 1 July 2013 19:07:10 IST > < error > < oracle.soa.bpel.engine.dispatch > < BEA-0000

    00 > < could not handle message

    javax.xml.xpath.XPathExpressionException: internal error xpath

    at oracle.xml.xpath.JXPathExpression.evaluate(JXPathExpression.java:242)

    at com.collaxa.cube.xml.xpath.BPELXPathUtil.evaluate(BPELXPathUtil.java:)

    247)

    Thanks in advance

    It may be wise to cast to a string also. Sometimes you get the signatures of the rear instead of content element if you specify.

  • How cut the length of the string IE channel name here, if it exceeds 20 characters or letters. The channel name is dynamically analyzed the spreadsheet/xml file.

    How cut the length of the string IE channel name here, if it exceeds 20 characters or letters. The channel name is dynamically analyzed the spreadsheet/xml file.

    My Council of Europe in the .js file is

    function generateHTMLMarkup (i, channel) {}
    Alert ("this is lang" + str);
    var str ="";
    "Str += '.

    ";
    "Str += '.
    "+ ""+""+"
    ";
    Alert ("this is lang" + str);
    return str;

    }

    nerateHTMLMarkup: function (i, channel) {}
    Alert ("this is lang" + str);
    var str ="";
    "Str += '.

    ";
    str += "" +
    "" +
    "" + channel ['name'] + "" +.
    "" + "
    ";
    "Str += '.
    "+ "" + "
    ";
    Alert ("this is lang" + str);
    return str;

    etc.

    Give mthe rhythm and the exact code where Ihave tio get implemented.

    in the code, replace change

    channelName var = channel ['name'];

    TO

    channelName var = channel ['name'];

  • Keep the text perpendicular to the base line when you use the string.

    Is there a way to keep the text perpendicular to the base line when using the warp function?  I'm trying to reproduce a decal with curved text.  When I use the string to get the text that is curved like the original, the letters are slightly tilted.

    You could try to make each letter on a separate text layer, then use Image > transform > free transform to adapt the letters in place.

    A lot more control over the placement of the letter and size that warp text offers.

  • Using the string Variable name to ChnFind

    Overview - I find crossing points of zero on a set of data so that I can calculate the phase shift of channel to another in my data.

    Small image - I start by finding the zero 1 cross in the data, once I found I want to use the index to find the next and so on

    Problem

    The posted script comes from looking for the 1st pass by zero before moving on to the next channel. The problem is that I can't find out do my group and channel changes with loops.

    Option Explicit  ' force explicit declaration of all variables in a script.
    Dim intCount, intChan ' loop variables
    Dim z

    IntCount = 2 GroupCount-1 ' groups
    Call GROUPDEFAULTSET (intCount) ' change the current group
    IntChan = 1 to ChnNoMax ' Browse channels
    Z = ChnFind ("Ch(""[intCount]/[intchan]"")<0") 'this="" does="" not="" work,="" but="" i'm="" not="" sure="" how="" to="" fix="">
    MsgBox (z)
    next

    I don't know I'm missing something obvious.

    MK

    Hi Michael,

    You need not global variables to simplify this, but I would certainly use object variables to simplify.  When indexing of groups or channels, it is easier to use the variable of index with the Data.Root.ChannelGroups collect or Group.Channels collection directly.  I also prefer to store the group object and the channel object in a variable.  For example, you can then use Channel.DataType to add exactly the same string data to the new group coming from the old group.  You can also easily get the name, unit and all sorts of other properties directly from the object variable.  I prefer to use a separate group object variable to reduce congestion in the colde, although it adds 2 lines to your example of code snippet.

    Set FromGroup = Data.Root.ChannelGroups (intCount)
    Set FromChannel = FromGroup.Channels (intChan)
    Define participatory = Data.Root.ChannelGroups ("Index" & FromGroup.Name)
    The rise in the value = ToGroup.Channels.Add (FromChannel.Name & "Rising", DataTypeChnFloat64)
    Fall in the value = ToGroup.Channels.Add (FromChannel.Name & "Falling", DataTypeChnFloat64)

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Consolidation of the connection by Instance name strings

    With the help of SQLD 4.0.2 / RDBMS 11 G r2

    I have a lot of connections defined through multiple oracle instances.  I would like to consolidate all connections per instance (or somethings similar) name for MISTLETOE.  I know that I can color each connection (for all connections in instance1, blue green for all connections to the instance 2, etc.), but I would like to be able to use the sign more to reduce / enlarge each instance together, eliminating the need to view all of the defined connections available on the screen.

    I did a little research in the forum but no luck.  Any ideas?

    Thanks in advance.

    You can create the connection folder, "add to the file.

    There is no automatic grouping of the instance at this time.

  • How to use the String with an external dispatchEvent event.target.name?

    ... I hope that the question of the title makes sense...

    On my stage, I have an external SWF loaded with a button. When you click the button dispatches the main event scene.

    On the main stage a listener can load a SWF it in a magazine called Gallery.

    The charger of the Gallery is also shared by the buttons on the main stage, who use the event.target.name chain to appeal to sovereign wealth funds with corresponding names.

    I use tweens to fade and, in the content of the Gallery when a key is pressed.

    --

    Loading of the FSV worked until I tried to create a universal function for the dispatchEvent buttons...

    The problem I have is that I don't know how to set the string to indicate to the newSWFRequest where the SWF file when triggered by external buttons.

    (I maybe do this wrong... but thought that the best way to load a SWF on the main stage from an external SWF was using dispatchEvent?)

    My code raises the event and the charger of the Gallery Faints, but then it does not find the new SWF:

    Error #2044: Unmanaged by the IOErrorEvent:. Text = Error #2035: URL not found.

    Please can someone help me understand how to make the point in the chain in the right direction? (I think that the errors only are in bold below)

    Code:

    var myTweenIn2:Tween;

    var myTweenOut2:Tween;

    var nextLoadS2:String;

    Listening external inclinometer shipped external event

    addEventListener ("contactStage", btnClickExtrnl);

    function btnClickExtrnl(e:Event):void {}

    nextLoadS2 =?

    myTweenOut2 = new Tween(gallery,"alpha",None.easeOut,gallery.alpha,0,0.2,true);

    myTweenOut2.addEventListener (TweenEvent.MOTION_FINISH, tweenOutCompleteF2);

    }

    Function universal BTNS

    function tweenOutCompleteF2(e:TweenEvent) {}

    myTweenOut2.removeEventListener (TweenEvent.MOTION_FINISH, tweenOutCompleteF2);

    myTweenOut2 = null;

    var newSWFRequest:URLRequest = new URLRequest ("SWFs /" + nextLoadS2 + ".swf");

    myTweenIn2 = new Tween (Gallery, "alpha", None.easeOut, gallery.alpha, 1, 0.2, true);

    Gallery.Load (newSWFRequest);

    Gallery.x = Xpos;

    Gallery.y = Ypos;

    }

    Thank you.

    If this code is on the timeline of a child of the main timeline of your external swf add parent 3rd in two lines with parent.parent.

  • Activate search resource group using the string key

    Hi all

    RIM has provided APIs (Resource Bundle) to support the localization of the applications. We are able to use it

    ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME).getString(key);
    

    He expects int key and generated dynamically by Blackberry. There are 2 cases.

    1. Local labels, we are aware and we can provide keys for those who, for the latter is no problem.
    2. From backend error codes. This is not a definitive list. This is the string value. But we cannot find the resource group by using this key of type string. We have to check what the error code and create the key to this and allows to retrieve the label.
    if(errorCode.equals("SOME_ERROR_CODE"){
       Dialog.alert(LanguageResource.getString(SOME_ERROR_CODE));
    } else if (errorCode.equals("ANOTHER_ERROR_CODE"){
       Dialog.alert(LanguageResource.getString(ANOTHER_ERROR_CODE));}
    

    To avoid this check, we thought that if this was possible.

    String msg =  LanguageResource.getString("SOME_ERROR_CODE"));
    if (msg == null) // Label not found
       Dialog.alert(LanguageResource.getString("GENERAL_ERROR");
    else
      Dialog.alert(msg);
    

    Now, API provides no support for this, is the solution to create the own property file and load them but I think that the Blackberry does support playback of the file as Java Standard properties or may be something else. The same reflection API is not supported in Blackberry up to now, there may be support in the future. This could allow to dynamically use the variable as the key name.

    Someone did it faced simular situation and made a work around? All entries would help.

    Kind regards

    Sandeep

    Edited: updated information on option of the reflection API.

    It will never take in charge of reflection as the baseline for BB Os is J2ME and therefor java 1.3/1.4

    you will have to translate the error to the resource key string yourself.

  • switch the case: should use the string value?

    in the example below, I have two points to a switch box. The first works and is not the second. In the second I tried to use a variable to concatinate the string for the case. For some reason whenever I do, it is not locate the second case. It seems like it should work...

    for (c = 1; c < = numItems; c ++) {}

    model var = app.project.items [c];

    var scale = 100;

    If (comp instanceof CompItem) {}

    for (i = 1; i < = comp.numLayers; i ++) {}

    {Switch (COMP. Layer (i). Name)}

    case 'textLines_NFLAM': we're working //This

    targetWidth = 1400;

    COMP. Layer (i).scale.setValue [(scale, scale);]

    setTextLayer_caseSensitive (comp.layer (i), lineValue);

    If (scaleTextLayer (COMP. Layer (i), comp.layer (i).sourceRectAtTime(1,_true).width, targetWidth)) {}

    modifiedLayers.push (comp.layer (i));

    }

    break;

    showName var = 'TA ';

    case 'textLines_' + showName: / / it does not work unless I change to: case "textLines_TA":

    targetWidth = 1430;

    COMP. Layer (i).scale.setValue [(scale, scale);]

    setTextLayer_caseSensitive (comp.layer (i), lineValue);

    If (scaleTextLayer (COMP. Layer (i), comp.layer (i).sourceRectAtTime(1,_true).width, targetWidth)) {}

    modifiedLayers.push (comp.layer (i));

    }

    break;

    }

    }

    }

    }

    It works for me (at least it works):

    myname = "textLines_TA"; var

    showName var = 'TA ';

    {Switch (myname)}

    case 'textLines_' + showName:

    Alert ("caught");

    break;

    by default:

    Alert ("no to not catch");

    break;

    }

    I suspect, there is something else.

    Dan

  • IN parameter is the string of column names I want to SELECT delimited

    Hi guys,.

    Please bare with me. Not a pro at writing stored procedures.

    What I try to do is to pass a parameter of 'IN' to the proc. The setting is a varchar2 which is a comma-delimited string.
    I want to put this string in the SELECT statement.

    This setting is called "P_SelectFields".

    The value in the passage in the proc is like:
    P_SelectFields = ' CUSTOMERS SUM (CLI_SERVED) AS SUM (EI_INTC) + SUM (NEI_INTC) AS INTERVENTIONS,
    SUM (TOT_EMPRTN) AS EMP_RETURN, SUM (TOTAL_RTS) AS SCHOOL_RETURN
    "


    That's what I've got and I know that it works, if I put the string instead of the parameter it works. !

    PROCEDURE GET_NATIONAL_TOTAL_RESULTS (P_SelectFields IN varchar2, P_AGREEMENT_TYPE_IND AGREEMENT_TYPE.agreement_type_ind%TYPE, io_cursor in SYS_REFCURSOR)
    IS
    BEGIN
    OPEN FOR Io_cursor

    SELECT year_desc,
    P_SelectFields - that's where I want my partameter go.

    OF SPF_RESULT_VW
    WHERE r_num = 1 - FILTER for the LAST PERIOD for EACH YEAR
    and agreement_type_ind = P_AGREEMENT_TYPE_IND - desired FILTER FOR Agreement_type_ind
    GROUP BY year_desc
    ORDER BY year_desc
    ;

    END GET_NATIONAL_TOTAL_RESULTS;


    That's what I'm after you run the proc.

    YEAR_DESC = 2011-2012
    : B2 = SUM (CLI_SERVED) ACE, SUM (EI_INTC) CUSTOMERS + EMP_RETURN SUM (NEI_INTC) AS OF THE INTERVENTIONS, SUCH AS SUM (TOT_EMPRTN), SUM (TOTAL_RTS) SCHOOL_RETURN

    Where is ': B2 = "come from?".

    What can I do to make my parameter is "picked up" by the proc?

    Thank you

    Firstly: in relational databases, there is no distinction between 'fields '. Tables is not 'fields', they have columns.
    It is my experience that that call columns 'fields' basically treats the database as a flat file system. It's a very bad idea!

    If you want to pass as a parameter column names, you need dynamic SQL.
    However, PL/SQL was invented to reduce the analysis and using of the dynamic SQL, you'll at least soft-parse each statement.

    Dynamic SQL is obviously in the documentation, but most people here think that they don't need to read the documentation.

    So, for once
    glance

    OPEN io_cursor FOR
    'SELECT year_desc,'||
    P_SelectColumns||
    ' FROM SPF_RESULT_VW '||
    'WHERE r_num = 1 '|| --FILTER FOR LATEST PERIOD FOR EACH YEAR
    'and agreement_type_ind = P_AGREEMENT_TYPE_IND '||-- FILTER FOR desired Agreement_type_ind
    'GROUP BY year_desc '||
    'ORDER BY year_desc'
    ;
    

    Please note that I have renamed the parameter.

  • change the default MovieClip instance name

    Hello

    My problem is the result of this code:

    for (var j = 0; j < numChildren; j ++)

    {

    If (getChildAt (j) block)

    {

    blocks.push (MovieClip (getChildAt (j)));

    var tempBlock = MovieClip (getChildAt (j));

    If (tempBlock.hitTestObject (mc))

    {

    test = true;

    }

    on the other

    {

    test = false;

    }

    }

    }

    now the thing is that will have more than one block, so if one of these blocks is not the "mc" then test will be False, even if the mc is in contact with another block, and I think that this can be resolved if I can get their name (I can do than tempBlock.name) and then change my else statement (is not the problem)

    what I need is to know how to change tempBlock names using the 'j' counter what I need exactly what

    tempBlock.name = "block" + j;

    but when I did it I get this error:

    Error #2078: Cannot modify the name property of a Timeline-place object.

    Thank you

    You cannot change the name of the instance of an object placed on the stage in the authoring environment (and all set on the stage in the authoring environment has an instance name if you assign one or not).  everything that has a name property can be assigned or changed by using the name property:

    var mc:MovieClip = new MovieClip();

    MC. Name = "OriginalName";

    //

    MC. Name = "newname";

  • the class and instance name

    How can I access a movieclip via an instance name in the 1 class file (not the main Document)

    And the class to recognize the movieclip when I use a code like this: this.y = player.y

    Player is the name of the instance.

    Thank you

    Already I saw a thread on the forum and did not have a good solution for this, but after a long hours, I found a solution with the minimum of effort:

    1. create a file in flash with a single movieclip named instance testMC
    2. on the timeline, write the following code to declare the class object

    var obj:TestingAccess = new TestingAccess (internship);

    Here, you must pass the scene as an argument to the constructor of the class

    3. create a class file and write the following code:

    package {}
       
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.display.Sprite;
    import flash.display.Stage;
       
       
    SerializableAttribute public class TestingAccess extends MovieClip {}
    var stagRef:Stage;
    var rootMC:MovieClip;
    public void TestingAccess(stag:Stage) {}
    the constructor code
    stagRef = deer;
    rootMC = MovieClip (stagRef.getChildAt (0));
    rootMC.testMC.rotation = 45;
    }
    } //Class
    } //Package

    I just a made a rotation for that Movieclip. It works

  • How to use the string as a terminal window control

    Hi all

    I am setting up a terminal window in my VI and to do this I have a control of the chain and an indicator of the chain.

    I want the user to be able to write a command in the terminal and when hitting enter into the control must update, but not before! I'd do it

    as the user to be able to enter several commands without having to re - click the control with the mouse, so he must stay in the

    control window.

    The result of this chain control is introduced to an external motor controller, which responds with a string entry in the string of an invoke node indicator.

    I tried to make some case of the event, but not quite sure how I'm going to only detect the input control.

    Any ideas how to precede?

    Thank you

    Concerning

    Tommy

    Yes, in the structure of your event, look for an event of your control chain called 'key' down... on the left, there are several upcoming parameters (char, Vcle etc.) where you can use for example the char find char = 13 (back).

    Look here: http://zone.ni.com/reference/en-XX/help/371361B-01/lvprop/control_key_down/

    Good luck

    Christian

  • Remove stale using the BPEL Console instances

    Hello

    I want to delete all obsolete instances in a particular area in production using the BPEL Console environment.

    Can anyone help me please with the same.

    Awaiting reply ASAP.


    Thanks in advance,

    Umang.

    Duplicate the $ORACLE_HOME/bpel/system/database/scripts/purge_instances_oracle.sql

    Change the following queries

       INSERT into temp_cube_instance
          SELECT cikey
            FROM cube_instance
           WHERE state = 9 AND modify_date < p_older_than;
       INSERT into temp_invoke_message
          SELECT message_guid , headers_ref_id
            FROM invoke_message im
           WHERE state =9 AND receive_date < p_older_than AND NOT EXISTS
           -- we do not want to delete those rows which are referenced by the delivered messages
           -- but also by the open cikey instance
           (SELECT 1 FROM cube_instance ci,
                          document_ci_ref dcr,
                          document_dlv_msg_ref ddmr
                WHERE im.message_guid = ddmr.message_guid
                      AND ddmr.dockey = dcr.dockey
                      AND dcr.cikey = ci.cikey
                      AND ci.state =9);
       INSERT into temp_dlv_message
          SELECT message_guid , headers_ref_id
            FROM dlv_message dm
           WHERE state = 9 AND receive_date < p_older_than AND NOT EXISTS
           -- we do not want to delete those rows which are referenced by the delivered messages
           -- but also by the open cikey instance
           (SELECT 1 FROM cube_instance ci,
                          document_ci_ref dcr,
                          document_dlv_msg_ref ddmr
                WHERE dm.message_guid = ddmr.message_guid
                      AND ddmr.dockey = dcr.dockey
                      AND dcr.cikey = ci.cikey
                      AND ci.state = 9);
    

    See you soon,.
    Prasanna

  • Use the string variable in the functions of film

    I want to know how to use a string as the URL variable in a Movie Clip event.

    example code:
    var numCount:Number = 1;
    var strMov:String = 'rock' + numCount;
    bob.removeMovieClip (strMov);

    Thank you very much!

    Turns out, I have solved my problem. I feel a bit stupid. Thanks for your help!

Maybe you are looking for