How to access child movieclip info of an object in an array?

Hi
I've dynamically created a whole bunch of movieclips.
I've given each clip a name based on a variable number:
     mc.name = "mc"+i;
I've also use addChild to add a couple of dynamic text fields to each movieClip, named myText1 and myText2.
I then push each movieClip object into an array:
     myArray.push(mc);
When I addChild the movieClips, they display fine, complete with each textField.  And if I use the following loop to trace the name of each clip in the array, I get:
     for(var i=0; i<myArray.length; i++)
               trace(myArray[i].name);
output:
     mc1
     mc2
     mc3
     mc4
etc
What I want to now is be able to access the text fields within each movieclip in the array.  However, I am getting errors when I try different ways.  For example:
     for(var i=0; i<myArray.length; i++)
               trace(myArray[i].myText1.text);
gives the error: A term is undefined and has no properties.
How do you access the values and contents of the children of movieClip objects that are stored in arrays?
Thanks
Shaun

For whatever reason, dynamically added children cannot be targeted that way.  If you added the textfields dynamically you may need to use getChildByName() to target them.  It partly depends on how you created them and whether or not you have direct access to them.  Aside from that you could also assign the textfields to variables that you create for the mc and target those by their variable names.
The following demos these two approaches:
var mc:MovieClip = new MovieClip();
addChild(mc);
var tf:TextField = new TextField();
tf.text = "this is text";
mc.addChild(tf);
// first way
tf.name = "tfield";
trace(TextField(mc.getChildByName("tfield")).text);
// second way
mc.tfid = tf;
trace(mc.tfid.text);
You could also store the textfields in arrays as they are created and have direct access to them with out the need to target the mc... the index should be the same as that which you use for the mc anyways.

Similar Messages

  • Web Dynpro ABAP: How to access the content of a mime object?

    Hi everyone,
    does anybody know how to access the content of a mime object of a Web Dynpro component? I added a XML file as mime object to a web dynpro component. Now I want to read the content of this xml file within a method of the component controller. The code would look something like:
    DATA: xml_content type xstring.
    xml_content = read_mime_object("test_123.xml").
    Any ideas?
    Regards,
    Nils

    dude here's the modification that i've done but I can't still access the content of the properties...
               Mail mail = new Mail();
               String message2 = sqlException.getMessage();
               File file = new File("Add.properties");
               Properties props = new Properties();
               props.load(new FileInputStream(file));
               String[] emailadd = {props.getProperty("emailadd","defaultValue")};
               mail.postMail(emailadd,"An error has occurred, Auto-archive was unsuccessful.", message2,"[email protected]");
               Message was edited by:
    ryshi1264

  • How to access the parent class variable or object in java

    Hi Gurus,
    I encounter an issue when try to refer to parent class variable or object instance in java.
    The issue is when the child class reside in different location from the parent class as shown below.
    - ClassA and ClassB are reside in xxx.oracle.apps.inv.mo.server;
    - Derived is reside in xxx.oracle.apps.inv.mo.server.test;
    Let say ClassA and ClassB are the base / seeded class and can not be modified. How can i refer to the variable or object instance of ClassA and ClassB inside Derived class.
    package xxx.oracle.apps.inv.mo.server;
    public class ClassA {
        public int i=10;
    package xxx.oracle.apps.inv.mo.server;
    public class ClassB extends ClassA{
        int i=20;   
    package xxx.oracle.apps.inv.mo.server.test;
    import xxx.oracle.apps.inv.mo.server.ClassA;
    import xxx.oracle.apps.inv.mo.server.ClassB;
    public class Derived extends ClassB {
        int i=30;
        public Derived() {
           System.out.println(this.i);                  // this will print 30
           System.out.println(((ClassB)this).i);  // error, but this will print 20 if Derived class located in the same location as ClassB
           System.out.println(((ClassA)this).i);  // error, but this will print 20 if Derived class located in the same location as ClassA
        public static void main(String[] args) { 
            Derived d = new Derived(); 
    Many thanks in advance,
    Fendy

    Hi ,
    You cannot  access the controller attribute instead create an instance of the controller class and access the attribute in the set method
    OR create a static method X in the controller class and store the value in that method. and you can access the attribute by 
    Call method class=>X
    OR if the attribute is static you can access by classname=>attribute.
    Regards,
    Gangadhar.S
    Edited by: gangadhar rao on Mar 10, 2011 6:56 AM

  • How to access PC Suite info if I lose my N900?

    How come the only way to access the contacts and backed up info on the Nokia PC Suite, is to connect a nokia phone to it? Im just curious as to how I can regain my contacts if I was to lose my N900 at any stage. Coz in that case, I wont have a nokia to connect to it.....or, will any phone with bluetooth be able to ragain those contacts once I connect to it?
    Appreciate your help
    Regards
    Paul

    the safe thing to do is use pc suite (and hopefully soon Ovi Suite 2.2) to sync your info, that way your info is available in what ever app / service you've used.. outlook for example.
    the backup is really targetted at nokia devices. it wasn't that long ago that kbackus could only belrestored to the same handset model, at least now you can restore between handsets.
    syncing is the safest way to keep your data available.. use backups to retain device settings ad non syncable info

  • How to access Datasource tag info (struts-config.xml)  in POJO

    Hello friends,
    I am doing a project in struts.I have stored the database connection information in data-source tag of struts-config.xml file.This is the code.
    <data-sources>
    <data-source>
    <set-property property="autoCommit" value="false"/>
    <set-property property="description" value="oracle Data Source"/>
    <set-property property="driverClass" value="oracle.jdbc.driver.OracleDriver"/>
    <set-property property="maxCount" value="10"/>
    <set-property property="minCount" value="2"/>
    <set-property property="user" value="system"/>
    <set-property property="password" value="manager"/>
    <set-property property="url"
    value="jdbc:oracle:thin:@localhost:1521:gd"/>
    </data-source>
    </data-sources>
    Now I want to access this data in POJO.I know how to use it in action class but unable to use it in POJO.To access it in action class , the code goes like this....
    ServletContext context=servlet.getServletContext();
    DataSource datasource=(DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);
    Connection con=datasource.getConnection();
    Can anyone tell me what to do?.Any help will be highly appreciated.Thank you in advance.

    You will need to use the JSR 88 API to access deployment descriptor configuration.
    See the Programming Deployment for Oracle WebLogic Server documentation for more information.

  • How to access PCI configuration info from CVI

    I am using CVI. I need to read the resources allotted to my PCI interface card, Access the memory, IO and use the interrupt.

    Hello
    you best bet would be to use the low level functions like inp and outp. Or better yet, use VISA, check out this link
    But CVI is general is targeted more towards application development, and not really for driver development. VISA is a pretty powerful tool for this, so you might want to explore that some more.
    I hope this helps
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • How to call child movieClip within childMovie clip  by others layer MovieClips.

    Object(root).my_movieclip2.my_movieclip3.my_movieclip24.gotoAndPlay(18);
    not working,,,

    Assuming you do get this to work the way you're asking, what happens when the structure of my_movieclip2 or my_movieclip3 changes? You're either going to have to search through and find every place that references them or you're going to wind up in a situation where you're scared to make any changes because of the sheer amount of work that's involved.
    A more robust approach is to do this:
    dispatchEvent('someEvent', true);//true says "bubble this up the display list"
    then in movieclip24, something like
    stage.addEventListener('someEvent', onSomeEvent);
    function someEvent(e:Event):void {
         gotoAndPlay(18);
    Note that in my own work I wouldn't do it this way, but you have to start somewhere in terms of understanding concepts.

  • I'm trying to set up Family Sharing. My settings show that the people I chose are there but I don't see any shared information. How do I access the shared info?

    I'm trying to set up Family Sharing. My settings show that the people I chose are there but I don't see any shared information. How do I access the shared info? All computers are using Yosemite 10.10.1 and are new 13" MacBook Pros.

    Hi wmcknigh,
    Welcome to Apple Support Communities.
    The article below should help you resolve the issue with shared content not appearing after setting up Family sharing on the MacBook Pros.
    If you don't see your family's shared content - Apple Support
    Cheers,
    -Jason

  • How can I access the "vision info" in an image

    Hi,
    Development Environment:
    LabVIEW 2012 32-bit (12.0f3)
    Vision 2012
    Description:
    I would like to get more information regarding the "vision info" in an image.
    There is a VI called IMAQ Is Vision Info Present 2 - which tells me whether any vision info is present in the image.
    But then what can I use to read or access this vision info, aside from using IMAQ Read Custom Data - or is this all there is?
    ie.  I have created a template in Vision Assistant using the Template editor and highlighted some mask areas - how can I open this up in LabVIEW and get this information?
    The Vision help files don't seem to define this to a low level of detail.
    Thanks!
    Christopher Farmer
    Certified LabVIEW Architect
    Certified TestStand Developer
    http://wiredinsoftware.com.au
    Solved!
    Go to Solution.

    Hi Christopher,
    Have you tried our IMAQ Get Geometric Template features VI? Information on this VI can be found here: http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_get_geometric_template_features/
    This VI will allow you to reference your created template image and returns the features of that image giving the ‘Feature Type’ and the associated data with that feature. This should allow you to access the data you need.
    Blake C.
    Applications Engineer
    National Instruments
    www.ni.com/support

  • Error while accessing Child Form process info

    I've created my Process task Adapter and attached it to "AD User" Process Definition.
    When I try to retrieve information about AD Groups from the child form of UD_AD_USER (form named AD_RSC), I get the following error:
    ERROR,28 okt 2007 15:08:26,765,[XELLERATE.DATABASE],select obi_key, UD_ADUSER_VERSION from UD_ADUSER where obi_key=5
    java.sql.SQLException: ORA-00904: "OBI_KEY": invalid identifier
    the problem is that there's NO field named OBI_KEY in the standard UD_ADUSER table.
    The same thing happens when I'm trying to access child form data through Xellerate API
    ( getChildFormDefinition(long plParentFormDefinitionKey, int pnParentFormVersion) or getProcessFormChildData(long plChildFormDefinitionKey, long plProcessInstanceKey) )
    is it some king of bug? I haven't found anything at metalink :(

    I have no issues getting child table information using the APIs... I am doing it on both 9.0.1.X versions and 9.0.3.X versions. I would suggest looking at how you are getting the process keys.. (i.e., are you mapping it in through the adapter, getting it from findObjects, etc)... and also look at your configuration of the child tables and make sure everything is active and kosher.
    If you post the rest of your code, I might be able to help you.
    Cheers,
    Deborah

  • How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    Hi,
    Thanks for the suggestion. I've been playing around with some of the classes of the java.net package and java.io
    Using the URL class i can get the content of the data from a STATIC page and output that response to file so that is does not display to the client broswer.
    But this only works if the URL i give points to a static html page.
    So the problem i'm getting is if i'm righting in arguments in the URL, this means that server needs to process the arguments i give and its sends back a dynamic result. Because its dynamic the URL class can not handle this and throws me an exception everytime :(
    Have u ever tried to do some things like this?
    Rahul

  • HT4910 sold my ipad today. the concern is how to access all info stored in cloud and if possible eventualy merge data into new andriod tablet. Thanks all of you who respond.

    sold my ipad today. the concern is how to access all info stored in cloud and if possible eventualy merge data into new andriod tablet. Thanks all of you who respond.

    >
    <IfModule mod_weblogic.c>
    WebLogicCluster 127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7003,127.0.0.1:7103,127.0.0.1:7104
    MatchExpression /app1
    </IfModule>
    <Location /weblogic>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
    DebugConfigInfo ON
    PathTrim /weblogic
    </Location>
    <IfModule mod_weblogic.c>
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    MatchExpression /app2
    </IfModule>
    <Location /weblogic>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    DebugConfigInfo ON
    PathTrim /weblogic
    </Location>
    >
    This configuration is weird little bit. There is MatchExpression /app1 and MatchExpression /app2 and at the same time two <Location /weblogic> sections. Are you sure you understand what that configuration stands for?
    Try something like this ...
    <Location /app1>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
    DebugConfigInfo ON
    </Location>
    <Location /app2>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    DebugConfigInfo ON
    </Location>
    where /app1 and /app2 are contexts of your weblogic applications.
    http://download.oracle.com/docs/cd/E11035_01/wls100/plugins/apache.html
    http://httpd.apache.org/docs/2.0/mod/core.html#location

  • How to access objects in the Child Form from Parent form.

    I have a requirement in which I have to first open a Child Form from a Parent Form. Then I want to access objects in the Child Form from Parent form. For example, I want to insert a record into a block present in Child Form by executing statements from a trigger present in Parent Form.
    I cannot use object groups since I cannot write code into Child Form to first create object groups into Child Form.
    I have tried to achieved it using the following (working of my testcase) :
    1) Created two new Forms TESTFORM1.fmb (parent) and TESTFORM2.fmb (child).
    2) Created a block named BLK1 manually in TESTFORM1.
    3) Created two items in BLK1:
    1.PJC1 which is a text item.
    2.OPEN which is a push button.
    4) Created a new block using data block wizard for a table EMPLOYEE_S1. Created items corresponding to all columns present in EMPLOYEE_S1 table.
    5) In WHEN-NEW-FORM-INSTANCE trigger of TESTFORM1 set the first navigation block to BLK1. In BLK1 first navigable item is PJC1.
    6) In WHEN-NEW-ITEM-INSTANCE of PJC1, code has been written to automatically execute the WHEN-BUTTON-PRESSED trigger for the "Open" button.
    7) In WHEN-BUTTON-PRESSED trigger of OPEN item, TESTFORM2 is opened using the following statement :
    open_form(‘TESTFORM2',no_activate,no_session,SHARE_LIBRARY_DATA);
    Since its NO_ACTIVATE, the code flows without giving handle to TESTFORM2.
    8) After invoking OPEN_FORM, a GO_FORM(‘TESTFORM2’) is now called to set the focus to TESTFORM2
    PROBLEM AT HAND
    ===============
    After Step 8, I notice that it passes the focus to TESTFORM2, and statements after go_form (in Parent Form trigger) doesnot executes.
    I need go_form with no_activate, similar to open_form.
    Edited by: harishgupt on Oct 12, 2008 11:32 PM

    isn't it easier to find a solution without a second form? If you have a second window, then you can navigate and code whatever you want.
    If you must use a second form, then you can handle this with WHEN-WINDOW-ACTIVATED and meta-data, which you have to store in global variables... ( I can give you hints if the one-form-solution is no option for you )

  • XML basic, how to access info by tag

    One quick question:
    I have an xml file, and at the very beginning there are these tags with data that i need to get. I have learned how to access nodes to retrieve information-like employee, name, age, id, but for these tags that appear only once, I am lost as how to process them. For instance here, I only want the string 15-09-2008.
    <JAVS>
    <TEST>15-02-2004</TEST> <---------- (how do i get just this line?
    <STAGE>3</STAGE>
    <MEETING_DT>15022004</MEETING_DT>
    <MEETING_DT_S>15FEB04</MEETING_DT_S>
    <DAY>MON</DAY>
    .<Employee>
    <Age>...
    <ID>...
    Thanks

    The main xml file holds employee data:
    .<Employee>
    <Name>...</Name>
    <Age>...</Age>
    <ID>...</ID>
    </Employee>
    .<Employee>
    <Name>...</Name>
    <Age>...</Age>
    <ID>...</ID>
    </Employee>
    which i can grab by getting:           NodeList nl = docEle.getElementsByTagName("Employee");
    and going from there getting the name, age, id stuff
    however, this <employee> information is preceded by other information such as <Day> and <meeting_dt> which i need. However, this is not repeating information and appears once. That is my problem. I try NodeList n2=NodeList nl = docEle.getElementsByTagName("JAVS"); and then looking for <Day> but this failed.
    <JAVS>
    <Day>15-02-2004</Day> <---------- (how do i get just this line?
    <STAGE>3</STAGE>
    <MEETING_DT>17022004</MEETING_DT>
    Entire xml file:
    <JAVS>
    <Day>15-02-2004</Day> <---------- (how do i get just this line?
    <STAGE>3</STAGE>
    <MEETING_DT>17022004</MEETING_DT>
    .<Employee>
    <Name>...</Name>
    <Age>...</Age>
    <ID>...</ID>
    </Employee>
    .<Employee>
    <Name>...</Name>
    <Age>...</Age>
    <ID>...</ID>
    </Employee>
    </JAVS>
    -----------------------

  • Accessing internals: how to retrieve connection count info

    Hi,
    I'm wondering if it is somehow possible to get the actual state of the Toplink JPA pool, i.e. how many connections are in the pool, how many are active etc.
    I was unfortunately not abel to figure out how to access this information, ie. the same thing which was possible with jdbc:
    org.apache.commons.dbcp.BasicDataSource.getNumActive();
    org.apache.commons.dbcp.BasicDataSource.getNumIdle();
    Would be helpful to monitor the state of the pool and how many connections are currently opened to the db.
    thanks
    erich

    Erich,
    In JavaSE where the TopLink connection pool is most commonly used the following should work for you:
            Server server = ((EntityManagerImpl) getEntityManager()).getServerSession();
            int numWrite = server.getDefaultConnectionPool().getTotalNumberOfConnections();
            int numRead = server.getReadConnectionPool().getTotalNumberOfConnections();Doug

Maybe you are looking for