Checking entire array for collision? How? AS 2.0

Hi!
I am doing a flash game with Actionscript 2.0 and have encountered a problem.
I have this statement _root.bulletArray = [] that is storing all my movieclips that have been created with attachMovieClip. I was able to store all bullets in the array because when I say for it to trace the array I get the following:
_level0.bulletCopy39
_level0.bulletCopy39,_level0.bulletCopy43
_level0.bulletCopy39,_level0.bulletCopy43,_level0.bulletCopy47
_level0.bulletCopy39,_level0.bulletCopy43,_level0.bulletCopy47,_level0.bulletCopy51
_level0.bulletCopy39,_level0.bulletCopy43,_level0.bulletCopy47,_level0.bulletCopy51,_level 0.bulletCopy55
_level0.bulletCopy39,_level0.bulletCopy43,_level0.bulletCopy47,_level0.bulletCopy51,_level 0.bulletCopy55,_level0.bulletCopy59
_level0.bulletCopy39,_level0.bulletCopy43,_level0.bulletCopy47,_level0.bulletCopy51,_level 0.bulletCopy55,_level0.bulletCopy59,_level0.bulletCopy63
and etc...
But how do I detect collision with ALL the bullets?
I have a movieclip that has the instance name: enemy
I have written the following:
if(_root.bulletArray.hitTest(_root.enemy))
trace("hit")
It dosent work, notihing is traced in the command thing.
But if I do the follwing:
if(_root.bulletArray[1].hitTest(_root.enemy))
trace("hit")
then it will detect the collision, but only of that bullet, not of the entire array of bullets.
Any help is highly appreciated! =D
----NOTE-----
I have also tried the followign without sucess:
if(_root.bulletArray[1,2,3,4,5,6,7,8,9,10].hitTest(_root.enemy))
trace("hit")

You need to use a loop to go thru the entire array one element at a time...
for(i=; i<bulletArray.length; i++){
     if(_root.bulletArray[i].hitTest(_root.enemy))
          trace("hit")

Similar Messages

  • Quick question how to wrie entire array in one go without loop

    I have the following loop, which goes around store array and write each element to file one at a time, i have been told that i can do this an easy way by writting the entire array at once. Can anybody tell me how to do this?
    int storeSize = store.getCount();
    for (int i = 0; i<storeSize;i++)
    output.writeObject(store.elementAt(i));

    i believe the method is
    Arrays.fill(
    read the api of the Arrays classPerhaps you should read the API, too, before
    offering advice.eerm, i dont need to read the api because i know this method exists:
    static void      fill(Object[] a, Object val)
    Assigns the specified Object reference to
    each element of the specified array of Objects.I'm sorry, you're absolutely right. Original poster, stop serializing objects
    to that ObjectOutputStream, and instead fill an array with multiple
    references to the same value. Whew, that was a close one, eh mates?

  • How the files are decreasing from RBS storage after some time i delete docs from document library, where shld I check the settings for this?

    HI
    I created a web application and configured  rbs storage ,
    I uploaded documents (for ex: 18 number)
     after uploaded  documents ,  and observed the RBS storage folder, number of files are increasing (39 number) , its working fine
    and also  I run the querys to check the rows increasing or not , (when I upload new doc rows are increased its fine also)
    select count(*) from alldocs
    Select count(*) from AllDocstreams
    but when I delete some docs from document library ,
    1)the doc itself deleted from document library
    2)when I check the rbs storage  there is no number of files are decreased(its still 39 files ), its same as  before doc deleted from doc library
    after some time I found the number of files are decreasing from RBS storage folder in sql server,
    here I want to know the how the files are decreasing from RBS storage  after some time, where  shld I check the settings for this? and how I control on it
    here how I know the settings for cleaning up orphan BLBOS how  these deleted BLOB
    adil

    1. WHen you delete the file from Sharepoint, it is still present in Recycle bin. This is a default setting in sharepoint for 30 days. Once files are deleted fro Recycle bin, it can also be delete from RBS
    2. There is a RBS cleanup job which deletes files from RBS. for more info check 
    http://mehuljamod.blogspot.in/2012/09/remote-blob-storage-maintainer-rbs.html

  • How to check with table for cursor..?

    How to check with table for cursor..?
    Here I have Table temp_final_plan
    Here i want to update if already exit...below is the procedure....
    CREATE OR REPLACE PROCEDURE spu_final_profit_plan
    AS
    -- Constant declarations
      ln_errnum number := 0;
    -- Variable declarations
       ls_errmsg app_errors.err_msg%TYPE;
       ls_appmsg app_errors.app_msg%TYPE;
       ls_appid  app_errors.app_id%TYPE;
    -- Cursor declaration for final_update_el
    CURSOR cur_final_update_el IS
        select '910' ent,
               '9127316' center,
               post_acct,
               sum(avg_mtd_01) sum_avg_mtd_01,
               sum(avg_mtd_02) sum_avg_mtd_02,
               sum(avg_ytd_01) sum_avg_ytd_01,
               sum(avg_ytd_02) sum_avg_ytd_02
          from mon_act_cypy
         where rec_type = 'A'
           and sum_flag = 'D'
           and yr = '2008'
           and substr(ctr_or_hier, 1, 2) = 'el'
           and ent || sub_ent in
               (select ent || sub_ent
                  from ent_ref
                 where roll_ent || roll_sub_ent = '999100')
         group by post_acct
        having sum(avg_mtd_01) <> 0
            or sum(avg_mtd_02) <> 0
            or sum(avg_ytd_01) <> 0
            or sum(avg_ytd_02) <> 0;
    -- Cursor declaration for final_update
    CURSOR cur_final_update IS
        select b.plan_ent b_plan_ent,
               b.plan_ctr b_plan_ctr,
               a.post_acct a_post_acct,
               sum(a.avg_mtd_01) sum_avg_mtd_01,
               sum(a.avg_mtd_02) sum_avg_mtd_02,
               sum(a.avg_ytd_01) sum_ytd_mtd_01,
               sum(a.avg_ytd_02) sum_ytd_mtd_02
          from mon_act_cypy a,
               plan_unit_tbl b
         where a.ent || a.ctr_or_hier = b.ent || b.ctr_or_hier
           and a.rec_type = 'A'
           and a.sum_flag = 'D'
           and a.yr = '2008'
           and b.hier_tbl_num = '001'
           and a.ent || a.sub_ent in
               (select ent || sub_ent
                  from ent_ref
                 where roll_ent || roll_sub_ent = '999100')
         group by b.plan_ent, b.plan_ctr, a.post_acct
        having sum(a.avg_mtd_01) <> 0
            or sum(a.avg_mtd_02) <> 0
            or sum(a.avg_ytd_01) <> 0
            or sum(a.avg_ytd_02) <> 0;
    -- Begin the procedure body
       BEGIN
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update_el IN cur_final_update_el
       LOOP
       EXIT WHEN rec_final_update_el%NOTFOUND;
       IF rec_final_update_el. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update_el.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update_el.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update_el.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update_el.sum_avg_ytd_02,       
           WHERE ent = rec_final_update_el.ent
             AND center = rec_final_update_el.center
             AND post_acct = rec_final_update_el.post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update_el.ent,
                                             rec_final_update_el.center,
                                             rec_final_update_el.post_acct,
                                             rec_final_update_el.sum_avg_mtd_01,
                                             rec_final_update_el.sum_avg_mtd_02,
                                             rec_final_update_el.sum_avg_ytd_01,
                                             rec_final_update_el.sum_avg_ytd_02);
       END IF;
       END LOOP;
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update IN cur_final_update
       LOOP
       EXIT WHEN rec_final_update%NOTFOUND;
       IF rec_final_update. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update.sum_avg_ytd_02,       
           WHERE ent = rec_final_update.b_plan_ent
             AND center = rec_final_update.b_plan_ctr
             AND post_acct = rec_final_update.a_post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update.b_plan_ent,
                                             rec_final_update.b_plan_ctr,
                                             rec_final_update.a_post_acct,
                                             rec_final_update.sum_avg_mtd_01,
                                             rec_final_update.sum_avg_mtd_02,
                                             rec_final_update.sum_avg_ytd_01,
                                             rec_final_update.sum_avg_ytd_02);
       END IF;
       END LOOP;
    -- EXCEPTION handling section
       EXCEPTION
    -- Fire OTHERS Exception case by default
       WHEN OTHERS THEN
    -- ROLL BACK Transaction, if any failure
       ROLLBACK;
       ln_errnum := SQLCODE;
       ls_errmsg := SUBSTR(SQLERRM, 1, 100);
    -- Log the ERRORS into APP_ERRORS table using SPU_LOG_ERRORS procedure
       spu_log_errors(ln_errnum, ls_errmsg, ls_appid, ls_appmsg);
    -- End of the stored procedure
    END spu_final_profit_plan;
    [\pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I'm not sure what you mean by, 'How to check with table for cursor..?' but I'll offer a comment on your Code Snippet. I think you want to know how to check if a record exists so you know if you need to perform an INSERT or an UPDATE.
    Here is a snippet of your code. I'll put my comments in "Comment" style in your code.
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update_el IN cur_final_update_el
       LOOP
    /* There is no need to test for %NOTFOUND since you are using Cursor FOR Loop! 
    ** This construct automatically exits when the last record is processed. */
       EXIT WHEN rec_final_update_el%NOTFOUND;
    /* Is this where you would like to know how to Check if the record already exist??
    ** I asked this because, 'rec_final_update_el.' is not valid syntax.  Are you looking for
    ** an Cursor Attribute or Method you can check here? 
    ** I would suggest a Primary Key or Unique Index on ENT, CENTER, and POST_ACCT
    ** on the TEMP_FINAL_PLAN table. Then simply perform an INSERT and code an
    ** Exception to UPDATE when you get a DUP_VAL_ON_INDEX exception.  Otherwise,
    ** you will need to simply run an Implicit or Explicit Cursor to test if the row exists and
    ** use this return value to determine if you should INSERT or UPDATE.  */
       IF rec_final_update_el. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update_el.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update_el.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update_el.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update_el.sum_avg_ytd_02,       
           WHERE ent = rec_final_update_el.ent
             AND center = rec_final_update_el.center
             AND post_acct = rec_final_update_el.post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update_el.ent,
                                             rec_final_update_el.center,
                                             rec_final_update_el.post_acct,
                                             rec_final_update_el.sum_avg_mtd_01,
                                             rec_final_update_el.sum_avg_mtd_02,
                                             rec_final_update_el.sum_avg_ytd_01,
                                             rec_final_update_el.sum_avg_ytd_02);
       END IF;
       END LOOP;I hope I've answered your question, but if I haven't please provide more details so we can better understand your request.
    Craig...

  • How to check in Cube for Non cumulative calculation?

    Hi All/surendra (Inventory Specialist)
      I am now supporting the Inventory cube. I never worked in inventory. I have read all the documents like
    a. How to Inventory
    b. Surendra's Inventory with 3parts
    c. Non cumulative..
    But none of the above docs gave me solution how to go ahead to find or compare with R3 for the first time consultants who is handling Inventory..
    Can you pls help me resolve the following issues?
    1. May I know how actually the NON CUMULATIVE calculation is done for filelds 0VALSTCKVAL and 0VALSTCKQTY  and also other KF's like ISSUE and RECEIPT qty, blocked qty, scrap, stck transit etc as I dont see any mapping done in transformation, if it is not done for Inventory, how it is fetched.??
    2.Also I wanted to know what are the fields used cumulated for the above fields as I dont see any transformation mapping done for Key Figure and understood all Inventory docs that the KF are not visible as they are NON CUMULATIVE KF's.
    3. How to compare the Inventory stock with R3 Material Stocks as when I compare with transaction MC.9, I see the values are totally different?? how and which transactions or tables supposed to be compared? Also we are not 2lis_03_BX in our Inventory. so I am not sure how they loaded the Inventory. Looks I need to redesign, can you tell steps to check and apply if I have initialize to make sure that my data will come correctly??
    Thanks a lot for all you help and efforts in advance.

    The source field for quantities is the field CPQUABU, and for values it is the field CPPVLC.
    Explanation for the routine :-  
    IF ( COMM_STRUCTURE-processkey EQ '000' "Other Receipts
    OR COMM_STRUCTURE-processkey EQ '001' "Goods Receipt / Vendor
    OR COMM_STRUCTURE-processkey EQ '004' "Material Transfer / Receipt
    OR COMM_STRUCTURE-processkey EQ '005' "Stock Adjustment InvD +
    OR COMM_STRUCTURE-processkey EQ '006' "Stock Adjustment Other +
    OR COMM_STRUCTURE-processkey EQ '010' ) "Receipt from Stock Transfer
    AND COMM_STRUCTURE-bwapplnm EQ 'MM'
    only stock in transit is considered
    AND COMM_STRUCTURE-stocktype CA 'FH'
    only movements which are relevant for stock control
    AND COMM_STRUCTURE-stockrelev EQ '1'
    AND COMM_STRUCTURE-cpquabu 0. *
    The above part is used for the KF : 0ISSTRANSST - Issue Quantity: Stock in Transit
    IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
    OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
    OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
    OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
    OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
    OR COMM_STRUCTURE-processkey EQ '110' ) "Issues from Stock Transfers
    AND COMM_STRUCTURE-bwapplnm EQ 'MM'
    only movements which are relevant for stock control
    AND COMM_STRUCTURE-stockrelev EQ '1'
    AND COMM_STRUCTURE-cppvlc 0
    see OSS note 630254
    AND ( COMM_STRUCTURE-stockcat IS INITIAL OR
    ( COMM_STRUCTURE-stockcat CA 'EQ' AND
    COMM_STRUCTURE-indspecstk CA 'AM' ) ).
    result value of the routine
    RESULT = COMM_STRUCTURE-cppvlc. *
    This part is used for : 0ISSTOTSTCK - Issue Quantity Total Stock
    Hope this hepls,
    Reg,
    Rahul

  • We are interested to know how/where to check query runtimes for any Query in SAP BW?

    We are interested to know how/where to check query runtimes for any Query in SAP BW?
    Is there any table or program to get the query run time details per query for a particular day.

    Hello Sravan,
    Bex statics tables would be 'RSDDSTATHEADER','RSDDSTATINFO' & 'RSDDSTATEVDATA'. all these can found in one view 'RSDDSTAT_OLAP'.
    above can give historical statistic.
    For current Query statics : T-code RSRT, and select debug mode select display statistics and then execute.
    Once you get the output press F3(one step back), there you can see statics of the query for that particular execution.
    Thanks,
    Mallikarjuna

  • How to check Business Partner for archiving ?

    Hi friends,
    I want to check the BP for Archiving.
    So I am trying to set the Archiving Flag in BP Status Tab
    But the Archiving Falg Check box is never in Display Mode and so I am not able to check the BOx. What is the use of that box if it can't be accessed ? Any clues on how to check it ?
    Many thanks
    C.K.

    Hi,
    You can run DACONTROL transaction to set the deletion flag for business partner.
    -Thanks,
    Ajay

  • HT201359 how can i find out what all the charges on my checking account are for?

    how can i find out what all the charges on my checking account are for?

    If you log into your account on your computer's iTunes via the Store > View Account menu option, you should then see a Purchase History section with a 'see all' link to the right of it. Click on that and you should then see a list of your purchases - the most recent purchase is above the list. I'm not sure if that shows auto-renewing subscriptions (I don't have any so I can't check).
    If you can't find the charges and you haven't added or changed your card details on your account (when you do then a small temporary store holding charge may be applied to check that the details are correct and valid, which should disappear within a few days) then you can contact iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • HT2534 How can I check my balance for my I tunes gift card on my I pad?

    How can I check my balance for my I tunes gift card on my I pad?

    You can view the balance of your iTunes account : on my iPad it shows at the bottom of, for example, the Featured tab in the App Store app under my account id (or you can view your account via Settings > iTunes & App Store and it should show on the screen that you are taken to). If your balance is zero then it might not show.

  • Is there a solution for iphone 4 too like iphone5, It doesnt have tab Cellular. How to check call duration for total dialled calls (after resting) on a particular day?

    How to check call duration for total dialled calls (after resting) on a particular day in iphone 4?
    Is there a solution like iphone 5, i.e.Settings > Cellular.

    if the device is unlocked cellular is called mobile

  • HT5576 Email sent Check your inbox for an email with instructions on how to reset your security information but i haven't got anytthng in my email

    Email sent
    Check your inbox for an email with instructions on how to reset your security information
      but  i haven't get anything in my email

    I never got mine either. I ended up scheduling for them to call me to reset my security questions.

  • HT1338 When we check for updates, how do we know they are valid and not malware?

    When we check for updates, how do we know they are valid and not malware?

    If they are from Software Update they are valid.
    You can also go to
    http://support.apple.com/downloads/
    Then click on the app (not download it) and you will see this...
    http://support.apple.com/kb/DL1426 and check the security SHA.

  • How  to take check print out for self and in favour of Bank for DD payment

    HI
    I have a requirement  to take check print out for self and in favour of Bank for DD payment from AP module, how it is possible.
    Syam

    hi syam,
    Step 1: Create a down payment request: F-47
    Step 3: Make payment through : F-58
    While entering the input parameters, Enter amount: 1050,
    For 50 Rs, you take Bank Charges account through GL Fast entry.
    Account Entry
    Vendor Dr (Spl GL): 1000
    Bank Charges Dr 50
    SBI Cheque Issue clearing Account Cr  1050
    Regards,
    Ramakrishna

  • I have an IMac and opened an email that may have been infected with a virus. How do I check my IMac for a possible virus?

    I have an IMac and opened an email that may have been infected with a virus. How do I check my IMac for a possible virus? What does PPC mean?

    You would be better posting this in the Lion forum.
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.7_lion?view=discussi ons
    It's possible you email contained a virus, but unlikely.  There haven't been any reports of email viruses effecting the mac. 
    My understanding is the Apple provides security updates for all malware including viruses.
    There have been reports of a --
    -- Phoney virus checking program
    -- flash malware.
    ppc -- Power PC.   An older computer processor used by Apple.  Last Mac shipped with PPC was in 2006.
    I've read about two virus checking programs for the mac. One is clamav.  The rest are either junk or malware.
    http://www.clamav.net/lang/en/
    Security update.
    http://support.apple.com/kb/HT1222

  • How to create array for activex control

    Now I am using microsoft form 2.0 combo box activex control in LabVIEW. My problem is I cannot create control array for the combobox like in visual basic. In visual basic, if we want to create control array for combo box or else, we just copy and paste onto the same form.
    For example if I copy combo1 and paste it onto the same form it will become 2 combo box i.e combo1(0) and combo1(1). So,how can I make same like that in labview using that activex?

    I'm sorry,I do not really understand. I've tried what have you told me by using automation refnum, but it is not working.
    I attached the file. if, let say , I want to make this three combobox red back colour simultanously, how to do it?
    Attachments:
    combo_box_activex.vi ‏28 KB

Maybe you are looking for