How to dinamically name objects in a for statement using addChild

Hi.
I was wondering where did go the for statement with
attachMovie from library in AS 3.
I mean i was having in AS 2:
for (i=0; i<5; i++) {
attachMovie("sim", "sim"+i, i);
Now in AS 3:
for (var i=0; i<5; i++) {
addChild(new sim());
I can't figure out how to name every instance of the "sim"
object from library that i add to the stage without using string.
How do I dinamically name the added instances of the object
from the library for future reference and usage throughout the
code?
Thanks a lot.

Well except those items aren't named! :)
The sim class (BTW it is generally better practice to have
class names start capitalized so that they can be distinguished
from instances which should be lower case.) would need to have a
name property if you wan't to name the instances.
This code create a variable which refers to each Sim instance
and those variables have a "name" of sim0, sim1, etc. And I think
this would be close to replicating the AS2 behavior. But AS3 is a
shift in thinking about your content as well and I don't think this
is probably the best approach.
The bad thing here is that the references aren't typed. Which
disables a lot of the good things that the compiler can do for you.
The following code would do the same thing as clbeech's and give
each instance a name (assuming the class definition includes a name
property.)
var i:int;
for(i=0;i=5;i++){
var curSim:Sim=new Sim();
curSim.name="sim"+i;
addChild(curSim);
Then the trick which is new in AS3 is to use the
DisplayObjectContainer.getChildByName() method when you want to the
retrieve an instance by its name. The help files do caution that
this is slower than something like getChildAt() which retrieves the
values from an array.
So perhaps that points the way toward a better way of
managing these types of things. Perhaps you should create an array
and push a reference to each of your Sim instances onto that array.
But it all really depends upon what you are trying to accomplish.

Similar Messages

  • How do I name documents in Pages for iPad?

    How do I name documents in Pages for iPad?
    When I create a new documents in Pages it is saved simply as Blank. I need to be able to edit this and give my new document a name such as "Pricing Proposal", etc.
    Is this possible in Pages for iPad, and if so how do I go about it?

    Ah yes: that works. I swear I tried that when searching for how to do this, but I must not have held my finger down long enough.
    Thank you so much for your help

  • How do I access my raw settings for further use?

    I opened a jpg in CR, made some changes, opened the image, then saved (from within PS) and closed it.
    Later I needed to create a duplicate of this image and apply the same CR settings I'd used, but I can't find them. When I open the original jpg, all of the CR settings are set to zero.
    Is there any way I can access the CR settings I entered? I want to see what they are, not delete them, not get back to the pre-CR-edit stage.
    If this is not possible, what could I have done otherwise to retain access to my CR settings? Should I have saved the image from within CR? If so, how would the CR settings be availalbe for tweaking or copying?
    Is there an automatic xmp file that would have this info, and if yes, where would i find it?
    Finally, how do I save CR settings in the future for subsequent access?
    Many thanks!

    The xmp data is written into the original jpeg file, not a sidecar file.
    Here's the drill (I'm doing it as I write this msg):
    1. Select a jpeg in Bridge.
    2. Right click on the image and select Open in Camera Raw...
    3. Perform an edit (I did a drastic exposure reduction to make the edits obvious).
    4. Click on Open Image, comes up in Photoshop with edits.
    5. Shutdown PS and Bridge.
    6. Re-open Bridge, select and open same image.  Opens in Camera Raw automatically, shows edits, and new CR settings.
    As I stated in my earlier post, the only way to "de-Camera Raw" the jpeg image is to clear settings from within Bridge.  Again, the jpeg is being re-written with the edits within the file as exif data.  And no, there is no message that such a re-write is occurring.
    Richard Southworth

  • How to save downloaded files from safari for offline use?

    Need help how to save downloaded PDF or images from Safari for offline use. On Mac or PC, we "save as" the files. How do you do it on safari on iPhone?

    You can't detach email attachments as separate files, though you can view supported formats as attachments. If you're viewing webmail with Safari, the attachments aren't saved on the iPhone.
    Apple hasn't made any announcements about new feature for the iPhone and rarely does. The other iPhone users in this user-to-user forum have no access to unannounced Apple plans, and speculation about them is prohibited by the forum Terms of Use.
    If you want to make a suggestion to Apple, post it on the iPhone Feedback page:
    http://www.apple.com/feedback/iphone.html
    Message was edited by: modular747

  • How do I create accessible Mobile APP for IPAD using flash Builder 4.7?

    How do I create Accessible Mobile App for IPAD usign Flash Builder 4.7?
    I tried updating enabling accessbile = True and other configuratoin from this site: http://www.adobe.com/accessibility/products/flex/best-practices.html
    but NO LUCK. When I tested on IPAD it freezes my App.
    Thanks for your time and help,
    Nim Pat

    In the second example, the photo is set to background with a tile. The other parts are over top of the photo and done with layers with a background color setting.

  • How Do You Test a Flash Drive for Errors Using OS X?

    HI. In Windows there are Flash Drive tester that tests if there's something wrong with the Flash drive's chips. How do you test a flash drive for errors on OS X? I bought the HP v220w which is tiny for a 16GB and it's metal. The whole thing goes into the plug. Design wise, it is great, it's very elegant like a jewelry. Thanks in advance.
    Gbu.

    Format it for OS X and run a surface scan on the partition. That should show any hardware problems that don't keep it from working altogether.

  • Australian.  How do locate apps which are suitable for Australian use,

    How do I locate applications which are relevant for Australian use, for example a shopping application; a travel application;
    Do I have to do a search in itunes for the category I want, and then go and read about that application (if a website is offered).
    Are the only forums for specific applications, attached to each individual application? That is, there is no one forum which deals with queries/features of applications in itunes?

    Apps aren't an iTunes issue, per se, since iTunes only downloads and transfers them. Try:
    Installing and using iPhone applications
    Installing and Using iPod touch Applications

  • [ORACLE 9] OPEN FOR statement USING bind variable

    Hi,
    I have a loop that only fetches 1 record instead of 7:
    DECLARE
    lv_into varchar2(40);
    lv_qry  varchar2(400);
    type curtest_ref is ref cursor;
    curtest          curtest_ref;
    lv_compteur number(4) := 1;
    lv_client_loc   varchar2(100);
    BEGIN
    dbms_output.put_line( 'Début' );
    lv_qry := 'select client_loc from tmp_jbm where client_id = :A ';
    open curtest for lv_qry using lv_compteur;                
    loop
                    fetch curtest into lv_client_loc ;
                    exit when curtest%notfound;
                    dbms_output.put_line( 'ligne: '       || to_char( lv_compteur )
                                       || ' Client Loc: ' || lv_client_loc );
                    lv_compteur := lv_compteur + 1;
                    exit when lv_compteur > 6;
         end loop;
    EXCEPTION
        when others then
                 dbms_output.put_line( 'Erreur exception: ' || sqlerrm );
    END;
    [/END CODE]
    It looks like the cursor only fetches 1 record and then stops.
    Many thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The code is doing what you have asked it to do.
    Incrementing lv_compteur := lv_compteur + 1; inside the FOR LOOP will not refresh your CURSOR as the CURSOR OPEN statement is outside the loop.
    You could change your lv_qry variable to something like this:
    lv_compteur_min number(4) := 1;
    lv_compteur_max number(4) := 6;
    lv_qry := 'select client_loc from tmp_jbm where client_id BETWEEN :A AND :B';and OPEN the cursor by passing two variables
    open curtest for lv_qry using lv_compteur_min, lv_compteur_max ;

  • How to get BW Objects not optmized for HANA on just migrated System from ORA to HANA?

    http://www.saphana.com/servlet/JiveServlet/previewBody/1363-102-2-1810/SDN_HANA_opt_InfoCube%20FINAL.PDF
    HI  .....HANA Experts
    We are early birds for HANA Technology !!!
    The above link is showing how to convert and limitations etc.
    We just migrated BW from Oracle to HANA.
    Our experts converted some BW Obejcts to HANA Optimized , some still open.
    Q1) In this juncture, to take the current stcok, Do we have any report which extract  directly list of BW objects which are still not optimized for HANA.
    Q2) How to get list of tables not yet fully loaded into Memory [or] How to get list of Infocubes & DSO's not yet fully loaded into main memeory
    Q3) When we optimize objects - The size in memeory & persistance store - Size is increasing - Is it normal behaviour ?
    Rgds
    PR
    PR Srinivas

    Hi,
    PR Srinivas wrote:
    We just migrated BW from Oracle to HANA.
    Our experts converted some BW Obejcts to HANA Optimized , some still open.
    ---- DSOs should not be converted. If you still want to please check RSODSO Table and check the column IMOFL (HANA Optimized setting for the DSO).
    For the InfoCubes, please refer to RSDCUBE table and CUBESUBTYPE column with value F for HANA optimized setting.
    Q1) In this juncture, to take the current stcok, Do we have any report which extract  directly list of BW objects which are still not optimized for HANA.
    Q2) How to get list of tables not yet fully loaded into Memory [or] How to get list of Infocubes & DSO's not yet fully loaded into main memeory
    Please check m_cs_tables to know which tables are loaded to memory and which are not.(Refer to LOADED column).
    Q3) When we optimize objects - The size in memeory & persistance store - Size is increasing - Is it normal behaviour ?
    Please check the Delta memory and perform Delta Merge. Please search on SCN to get the details on the same.
    Rgds
    PR
    PR Srinivas

  • How to make my object to wait for server response

    Hi ,
    I need some one suggestions on thread concepts.
    First Let me know my scenario is fit for thread concept.
    is it possible then how I can reach to solution.
    I have scenario like
    I send a request to server and server is taking some time to process the request.
    if I am calling the method on server it showing no results bez i know server takes some time.
    for that my calling method has to be wait for some time.
    Thanks
    Babu H

    Hi ,
    Let me give more information about that between my java class and server
    i have the bridge library which is also written in other than java.
    for that i used the njawin tool make as java wrapper class and accessing the java wrapper class(Bridge Server).
    the java wrapper class has post_request and poll_response methods so that why i 'm using only these methods in my java class to access the server.
    exactly I don't which technology is resided in Brdige server and actual Server bez that has been developed some one.
    poll_respnse means server has posted the response to client.
    Thanks
    Babu H

  • How do I name the IP address for my new iPad?

    I have six 'wireless clients' on my AirPort Extreme.  The first five are identified by name, i.e. GJ's iphone, GJ's Mac Mini, etc.  However, my new iPad does not show a name but just the IP Address of 10.0.1.5.   My new iPad does have a name but for some reason does not show up.  What should I try.
    Thanks.

    Unfortunately, the Client ID display does not always work correctly on all devices. 
    Soon, you may notice that other items that were previously displayed with the Client ID may now display just as an IP address......and your new iPad may "switch" from the previous IP address display to the Client ID display.
    Then, things may change around again in a week or two.  It's a bug that hopefully Apple will fix on the next firmware update.

  • How to set default object placement & wrap for drag-and-dropped files

    I am working on a document into which I need to drag-and-drop a number of files from the Finder: JPGs, PDFs, and so on. Each time I drag a file into Pages, by default its placement is set as "Floating (doesn't move with text)" and "Object causes wrap" is active.
    I would much prefer that the default settings be "inline" and "object does not cause wrap," so my drag-and-dropped images will appear within the text and move with it.
    Is there a way to change this default setting?

    Niel's suggestion is good. You might also try posting your question in the Tiger Server forums. I'm sure Tiger Server has several ways of dealing with this.

  • How do I download an OS (Lion) for a used-IMac that's had a complete memory wipe?

    I just recently bought a used-Imac (only 5 months old) from a friend of mine which he did a complete memory wipe on the computer. Operating System and all. He had Mountain Lion which is the operating system the computer is asking me to reinstall but I can't because my apple I.D. never purchased Mountain Lion. He told me that he got it illegally which I didn't care too much for. I know the OS is only $20 which I would gladly pay for but the problem is that I have to have OS X v10.7 Lion to be able to download it. I tried downloading a version of it but it had said that I didn't have enough space on my disc for it? By the way, did I mention that nearly all memory was wiped away from the computer. I had 230-something gigabytes on my computer so this didn't make any sense to me as to why it couldn't download 10.7 Lion. Can anyone help me on this?

    You only need Snow Leopard 10.6.8 in order to download Mountain Lion.
    Upgrading to Snow Leopard
    You can purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard - Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
    After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mountain Lion if your computer meets the requirements.
         Snow Leopard General Requirements
           1. Mac computer with an Intel processor
           2. 1GB of memory
           3. 5GB of available disk space
           4. DVD drive for installation
           5. Some features require a compatible Internet service provider;
               fees may apply.
           6. Some features require Apple’s iCloud services; fees and
               terms apply.
    Upgrading to Mountain Lion
    To upgrade to Mountain Lion you must have Snow Leopard 10.6.8 or Lion installed. Purchase and download Mountain Lion from the App Store. Sign in using your Apple ID. Mountain Lion is $19.99 plus tax. The file is quite large, over 4 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
         OS X Mountain Lion - System Requirements
           Macs that can be upgraded to OS X Mountain Lion
             1. iMac (Mid 2007 or newer) - Model Identifier 7,1 or later
             2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) - Model Identifier 5,1 or later
             3. MacBook Pro (Mid/Late 2007 or newer) - Model Identifier 3,1 or later
             4. MacBook Air (Late 2008 or newer) - Model Identifier 2,1 or later
             5. Mac mini (Early 2009 or newer) - Model Identifier 3,1 or later
             6. Mac Pro (Early 2008 or newer) - Model Identifier 3,1 or later
             7. Xserve (Early 2009) - Model Identifier 3,1 or later
    To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
         Are my applications compatible?
             See App Compatibility Table - RoaringApps.
         For a complete How-To introduction from Apple see Upgrade to OS X Mountain Lion.

  • How can I unlock my UK phone for AUS use when sourced from UK Apple Store (so without service provider to do it for me)?

    So my Aus iPhone that I had unlocked to do a bit of travelling went for a swim in the Med- my service provider back home informed me that in order to claim on insurance internationally that I should get a new one from an Apple Store and send them the bill etc etc. I did that, and all was fine with the rest of my trip on a prepaid UK sim.  Now I am home and want to put my AUS sim in (where I am under postpaid contract) but my iPhone is not recognising it, with an error message of 'Invalid Sim'.  My service provider cannot help as the product was sourced from Apple originally and not them. Can someone let me know how this can be fixed?

    Okay, so if you purchased your iPhone from an Apple store in the UK then it is fully unlocked.  Apple in the UK sell fully and officially unlocked iPhones, so you should not have a problem with inserting any sim card into your phone.  The phone will be unlocked as long as you purchased the phone in the UK for the full purchase price and not as sim free rather than unlocked.
    Have a word with your provider, as there could possibly be a problem with your sim card.  Get a new sim card and try that.  There is no reason why this should not work on an unlocked iPhone.

  • How do I enable the administrator account for FTP use.

    I utilized an FTP enabler software to enable FTP on my Mac.  And I can FTP into the subaccounts on my Mac but I can not do so with the Main administrator account (mine).  So I went into terminal to test the Main Administrator, I get the following message.  I'm lost as to what to do to enable FTP with the Administrator account.
    Name (192.168.1.9:Administrator): Administrator
    331 User Administrator accepted, provide password.
    Password:
    530 User Administrator may not use FTP.
    ftp: Login failed
    What I'm trying to do is to be able to scan documents from my Xerox Printer to all the Macs in our home.  I have set up my wife's and daughter's Macs to allow for scanning documents to their accounts on their Macs.  They each are sub accounts as I am the Administrator for their Macs.  Additionallly, I created a subaccount on my Mac and I'm able to scan to it as well. But when I try to scan to my Administrator account, it won't work.
    Any help would be appreciated. I'm using Mountain Lion on all 3 Macs with the latest version.  I enabled FTP on all 3 Macs.

    Thanks for your suggestions but it was more complicated than what you suggested.  I was finally able to find a guy at xerox that was able to resolve the issue.  I believe it involved changing some settings deep inside the bowels of the programming code much like the old days of using MS DOS to change internal settings on a PC.  I watched him do it on my screen and it involved deleting the administrator account from being locked down within the O/S. 
    Regardless, thanks for the suggestion.

Maybe you are looking for

  • TextArea text not displayed correctly with ImageSnapshot

    I am having an issue with the ImageSnapshot.captureImage command capturing the text in a TextArea. Attached are two files illustrating the issue. The "screenshot.jpg" pic shows how the TextArea controls are displayed on the screen. The "created jpg.j

  • Server does not return query metadata check the query

    hi, i want know how to  use bex query designer, when i  insert a data provider,the message is appear "server does not return query metadata check the query", who can help me ? thanks a lot ! addition: my current entironment is: gui710 with sp4,bi710

  • How to Debug multiple Applets in a IDE

    Hi, I am relatively new to Java. At work, I have a client-server style application where applets are deployed to the clients in an html page. Background:* The sequence is something like this: - Client goes to the relevant url - The returned html page

  • How exclude values based on text in web report

    hi , i wanted some clarifications how to exclude values based on text in web report.

  • Setting system properties accessible from BPEL independent of ENV

    I am implementing a BPEL Process in which I am referring to a folder in my local server.Is there any way where I can set some sytem properties such way that the folder path could be dynamically accessed independent of the server/environment. Ex:-in d