Iterate through the objects of the child in components

I have a custom component named myComp that has three TextInputs. And in the main application there is a button that adds the component dynamically to the VBox named myVBox, I would like to know how iterate through the added components and display the text inside each of the TextInputs in a box of Alret. I'm pretty new to flex and I couldn't find examples for this.

Thank you

Code example,

Custom component

MyComp1.mxml


http://www.adobe.com/2006/mxml">
     
     
     

Application


http://www.adobe.com/2006/mxml"
     layout="absolute"
     creationComplete="init()">
     
          
     

     
          
          
          
          
     

Hope this helps you

Tags: Flex

Similar Questions

  • Iterate through the DB using DBcursor-> get with the DB_DBT_USERMEM flag set for DBT

    BDB works in mode TDS. You want to iterate over a database using a DBcursor from beginning to the end. set the flag DB_DBT_USERMEM on the structure of the DBT with data pointing to a block of memory allocated fixed size to organize content in a single record reading. Currently the cursor get fails with DB_BUFFER_SMALL. I guess that's because the cursor-> get retrieves several records.

    It is possible to iterate over the DB using the cursor said while allocating memory for only a 1 user database? Each call to cursor-> get with DB_NEXT / DB_PREV / DB_FIRST DB_LAST etc. would be updated of the unique registration entry.

    Hi Kedar,

    No, DBcursor-> get() picked up several key/data elements if you are using the DB_MULTIPLE or DB_MULTIPLE_KEY flags. See "Bulk Retrieval:
    [http://www.oracle.com/technology/documentation/berkeley-db/db/programmer_reference/am_misc_bulk.html#am_misc_bulk_get]
    You want only to retrieve a single record per call, so do not use the above indicators. In this case, the DB_BUFFER_SMALL error indicates that the length of the item requested/retrieved is greater than that specified for the DBT via his "ulen" field
    [http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/dbt.html#dbt_DB_DBT_USERMEM]
    If you want to iterate through all the records in the database (including duplicates, if the database is configured to support), you must use the DB_NEXT flag.
    Note that when the DB_BUFFER_SMALL error returned the field 'Size' of the DBT is on the length needed for the item requested; You can check this value to determine how the size of your buffer provided (or you can know in advance the size of the items in the database).
    Here is an excerpt of the example code to "Retrieve records with a cursor" with the necessary adjustments for the TCD data:
    [http://www.oracle.com/technology/documentation/berkeley-db/db/programmer_reference/am_cursor.html#am_curget]

         DB *dbp;
         DBC *dbcp;
         DBT key, data;
         int close_db, close_dbc, ret;
    
         //...
    
         /* Acquire a cursor for the database. */
         if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) {
              dbp->err(dbp, ret, "DB->cursor");
              goto err;
         }
         close_dbc = 1;
    
         /* Initialize the key/data return pair. */
         memset(&key, 0, sizeof(key));
         memset(&data, 0, sizeof(data));
    
         /* Retrieve data item in user suplied buffer. */
    #define BUFFER_LENGTH 1024
         if ((data.data = malloc(BUFFER_LENGTH)) == NULL)
              return (errno);
         data.ulen = BUFFER_LENGTH;
         data.flags = DB_DBT_USERMEM;
    
         /* You can supply your own buffer for the key as well. */
    
         /* Iterate through the database. */
         while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0)
              /* Operate on the retrieved items. */
         if (ret != DB_NOTFOUND) {
              dbp->err(dbp, ret, "DBcursor->get");
              goto err;
         }
    
    err:
         // ...
    

    Kind regards
    Andrei

  • detect pageitems groups and iterate through the items in each group

    Hello

    I can use some help with a script that I'm trying. The script creates a new layer based on a fill color of objects and then move the item to the new layer.

    What I can't understand is how to check if a pageItem is a group, and if so, scroll through all the objects within the group. What I have so far (snippit) is:

    var doc = app.activeDocument;
    var LayerName = "0";
    var MyArray = new Array;
    
    for ( j=0; j < Counter; j++ ) 
        {
        CurrentItem = doc.pageItems[j];
        if (CurrentItem.typename != "GroupItem" && CurrentItem.typename != "CompoundPathItem" && CurrentItem.parent.typename != "GroupItem" && CurrentItem.parent.typename != "CompoundPathItem") 
           {  
            LayerName = ConstructLayerNameBasedOnFillColor( CurrentItem );
            CurrentItem.move( app.activeDocument.layers.getByName( LayerName ), ElementPlacement.PLACEATBEGINNING );
           }
          else 
           {  
            if (CurrentItem.typename == "GroupItem") //  seems to be wrong as it also returns true for an item within the group
            { 
             myArray = [];
                for ................ // cycle through each item within the group
                 {
                  LayerName = ConstructLayerNameBasedOnFillColor( CurrentGroupItem );
                  MyArray.push(LayerName);
                 }
             LayerName = GetMostCommonColor(MyArray);
             ................. // move the group (including all items within the group) to layer LayerName
              }
           } 
        }
    

    Is the part that I need help:

    1:  if (CurrentItem.typename == "GroupItem") //  seems to be wrong as it also returns true for an item within the group
    2:     { 
    3:     myArray = [];
    4:      for ................ // cycle through each item within the group
    5:         {
    6:          LayerName = ConstructLayerNameBasedOnFillColor( CurrentGroupItem );
    7:          MyArray.push(LayerName);
    8:         }
    9:     LayerName = GetMostCommonColor(MyArray);
    10:     ................. // move the group (including all items within the group) to layer LayerName
    11:    }
    

    line 1: how to check if the pageItem is a group

    line 4: scroll all the items in the Group

    line 10: move the group to a new layer

    Any help is appreciated.

    Have you tried running the loop backwards in the case where the index is messed up.

     m=0; m < CurrentItem.pageItems.length-1; m-- 
    
  • Iterate through the custom Classes?

    Hello

    Suggests, I have a class with public properties as

    Class person {}

    public var address: String;

    public var name: String;

    public var fathername:String;

    etc etc.

    }

    Now I want to iterate over them in a simple way as

    for {(var clé: string en personne)}

    trace ("property is" + key + "and the value is" + person [key]);

    }

    But does not allow it to do with the AS3 Classes

    Now, I want you guys to suggest me what would be the simple and best way to iterate over them, because I don't want to do so much if (else) about it.

    Thank you

    You can try using the describeType() method:

    http://livedocs.Adobe.com/Flash/9.0/ActionScriptLangRefV3/Flash/utils/package.html#describ eType ()

  • Need to iterate through the tab order

    I've been an iteration through form fields and Annotations (of type Widget), but now I need to follow the tab order.

    How should I do?

    THX,

    -RFH

    ISO 32000-2 WD, 7.7.3.3, table 30 says that 'W' means 'Order Widget'.  It was originally spec'd in the documentation on the Adobe Extensions ISO 32000-1, level 3.  (more details can be found in these two documents)

  • Iterate through the items in the cluster

    Hi all

    I have a cluster with several elements of the same type. I want one any of them handle in the same way, keeping however their labels. My solution works, however, it is prone to errors of cabling one its not really scalable. you have a better idea?

    Thank you!

    RubeGoldberg alarm!

    What is the problem with the application of the function of math on the cluster directly?

  • Iterate through the attributes unknown cluster

    Hello

    I try to write a VI that revieces a unknown cluster (it should work with any cluster) and travels its attributes.

    for each attribute, I run different commands depending on the type.

    I tried to work with variants, but I couldn't get the actual values of the cluster (only the type and name) attributes.

    What would you recommend using a VI like that?

    Thank you!


  • help to loop through the elements of page

    Hello

    I am new to InDesign scripting and I need a way to programmatically iterate through the items on a page in a document and get the entire block of text ID (Using javascript). Once I have a match of the text block I'm looking for, I'll have to update its content. Is there an easy way to do this?

    Thanks in advance!

    -Lloyd

    Hey!

    var myTextFrames = app.activeDocument.textFrames;
    var myTextFramesNo = myTextFrames.length;
    

    Now myTextFramesNo has number of blocks of text in the document and myTextFrames holds text objects frame. Now you can run through the blocks of text and content of the kit for each of them like this:

    myTextFrames[0].contents = "My Frame Contents";
    

    This is for beginning

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • How iterate over the attributes of a single entity?

    I'm working on a script of transformation of the logic model. I take a list of entities:

    var = model.getEntitySet () .toArray () entities;

    iterate over the entities:

    for (var e = 0; e < entities.length; e ++) {}

    var = [e] entities entity;


    and try to get a list of all the attributes of the current entity:

    var attributes = entity.getAttributeSet () .toArray ();

    After that, I try to iterate through the attributes:

    for (var a = 0; a < attributes.length; a ++) {}

    attribute var = attributes [a];

    While performing an iteration on the attributes, I realized that the list is always the same. I always get a list of all the attributes probably of the whole model, even for entities without any attribute.

    How can I get a list of the attributes of a single entity?

    Hello

    Use entity.getAttributes)

  • to access the property of the child of a display object

    I need help to understand how to access a property of a child of a DisplayObject.

    within a class, I have an object with the name of the variable: btnLMain

    I assigned a name property: btnLMain.name = "btnL;

    btnLMain also has a property: btnLMain.clickNum = 0; It's the one that I need to access

    When I instantiated (btnL) class that contains this code in the parent class, I need to access the 'clickNum' property so I did this:

    var dispObj:DisplayObject = btnL.getChildByName (btnLMain);

    displayObj.clickNum ++;

    but then, I get the error: 1119: access to property may be undefined clickNum through a reference with static type flash.display:DisplayObject.

    so then I looked at the documentation and as I understand it, I am not able to access the child of the DisplayObject property as it is a static property... Please correct me if I'm wrong.

    so now, I try to understand how to access this property in the child class.

    do you have any tips for me?

    Thank you!

    For what you described, the following line is meaningless...

    var dispObj:DisplayObject = btnL.getChildByName (btnLMain);

    because you said that the name property, that you assigned to the btnLMain is btnL, which would make btnL and btnLMain representative of the same object.  Or maybe I just missed something the explanation.

    How you declare btnLMain first?  If it is defined in a way such As btnLMain... var = new Something(), then you have a direct access using the btnLMain variable and should be able to use btnLMain.clickNum

  • How to access the child of the view object that is defined via the display link?

    JDeveloper 11.1.1.2 using:

    I defined the purpose of view 2 (ParentVO and ChildVO) and 1 notice link to specify the relationship between them.
    In the definition of link to view, I exposed the view of child object in the parent object from view with the name of the accessor "childlist is."

    In my module of the application, the data model contains the instances of the objects two view. The child view object instance has been added to the parent object instance see through display link

    I install the ParentVO to create both ViewImpl and ViewRowImpl classes and expose all accessor methods.
    But I can't find a get of the ViewRowImpl class method to access the ChildVO of the ParentVO.

    What is the right way to access the instance of ChildVO of ParentVO line line instance IE. ParentVORowImpl class?

    You should have a getEmployeesView method in the departmentsViewRowImpl class.

    You can try it with the HR schema and dept/emp tables to see if it works for you?

  • Error 1448. LVOOP: Referring to objects of the child class

    Hi all.

    In a project using LVOOP, I defined a class parent with several attributes. Of this class, there are three classes of children who inherit the attributes of the parent class and also have their own.

    Imagine that I instantiated an object belonging to the parent class and initialize its attributes. So I want this object even belong to a class of the child in particular, and refer to its attributes in the class of the child, of course, keep the values of the parent class. How can I do?

    I tried to use "in a more specific class" tool but I get the following text: "error 1448: bad type cast." LabVIEW does not deal with the run-time value of this class of LabVIEW as an instance of the given class of LabVIEW. »

    Exactly the same problem is committed and solved here http://lavag.org/topic/7473-lvoop-class-variable-as-child/, but because the links are temporarily disabled I can't download and understand the code example, which shows what it says there.

    Thank you very much
    Francisco.

    Hi Francisco,.

    Take a look at this thread: http://forums.ni.com/ni/board/message?board.id=170&message.id=362388&requireLogin=False

    Christian

  • Is there a tool or function (in Illustrator or InDesign) that selects any form and 'punches' a 'hole' of this form down through several objects for the paper or the work plan?

    Is there a tool or function (in Illustrator or InDesign) that selects any form and 'punches' a 'hole' of this form down through several objects for the paper or the work plan?

    Your objects punch must be in a large group; It will cut through all that is below.

    Create the shape you want to cut and set it to black Uni. Select your group and your form and (in the transparency palette), click make mask.

    Uncheck the Clip, and then return to the palette.

  • How to access the child object of a movieclip

    Hi, I made the pictures dynamically and I access Bastien is child movieclip

    var totalThumbs:Array = new Array()

    var ThumbMC:MovieClip()

    var childThumb:MovieClip()

    var xpos:Number = 10

    for (var i: Number = 0; i < 10; i ++) {}

    ThumbMC = new thumbOb() //thumbOb is the movieclip in the library class

    addChild (ThumbMC)

    ThumbMC.x = xpos

    childThumb = new animationclip() //animationclip is the movieclip in the library class

    ThumbMC.addChild (childThumb)

    ThumbMC.addEventListener (MouseEvent.Click, thumbClick)

    XPos += 100

    }

    function thumbClick(event:MouseEvent):void {}

    event.target.childThumb.gotoAndPlay ("clicked") < < THIS ERROR SHOWING

    }

    There are a number of errors in what you show so I have to imagine that you are not in strict mode minimum of coding.  You should avoid using event.target and event.currentTarget are using, otherwise you are likely to find the target, it's not what you expect it to be.  currentTarget is always linked to the object that has the assigned listening port, not children of that object (using target may end up doing).

    When you add dynamically content, targeting usual syntax parent.child does not work.  You start to use other means of access to the child.  One way is to store the child in another reference (like a table) and directly target.  Another way would be to use the getChildByName() method... Here is an example of using this approach...

    var xpos:Number = 10;

    for (var i: Number = 0; i<10;>
       
    var ThumbMC = new thumbOb();  thumbOb is the class movieclip in the library
    ThumbMC.num = i;
    addChild (ThumbMC)
    ThumbMC.x = xpos
       
    var childThumb = new animationclip() //animationclip is the movieclip in the library class
    childThumb.name = "childThumb" + String (i)";
    ThumbMC.addChild (childThumb)
       
    ThumbMC.addEventListener (MouseEvent.CLICK, thumbClick)
    XPos += 100
    }

    function thumbClick(event:MouseEvent):void {}
    var childThumb is MovieClip (event.currentTarget) .getChildByName ("childThumb" + String (event.currentTarget.num));.
    childThumb.gotoAndPlay ("clicked");
    }

  • A tap above an object can be used to make the clip through the object?

    A tap above an object can be used to make the clip through the object?  So that transparency can see through the object.


    I have a square that has a line above it.  I would like to see the transparent background behind the square in the area occupied by STROKE. Example below:

    Transparent.jpg

    I would like the white area (which was created using the Brush tool and applying a stroke) to display the transparent background behind the red square - or whatever that fall behind the place.


    I have read and tried many tutorials and suggestions on the forum without success. (Group of knockouts, mask opacity, etc...)  I even created a much simpler red square with an accident stroke by default and still unable to get transparency through red square.


    I'm probably just missing something.


    Is this possible using a stoke?  Anyone able to help?


    Thank you

    -Chris

    Or:

    Stroke (s) select 0) and Ctrl + G for group races if more than one,

    (1) with the stroke (s) selected object > decompose the aspect, and

    (2) with all selected Pathfinder > Subtract from shape area / less Front according to version.

Maybe you are looking for