How to write "for loop" for this block in as3?

hello all, could you please help me to write a for loop for the following code?
PS: bx1,bx,2bx3... are movie clips, xfir1,xsay1,xad1,xtip1,xdil1 are dynamic text boxes.
var xmlLoader9:URLLoader = new URLLoader();
xmlLoader9.addEventListener(Event.COMPLETE, showXML99);
xmlLoader9.load(new URLRequest("spops.xml"));
function showXML99(e:Event):void
XML.ignoreWhitespace = true;
var fir:XML = new XML(e.target.data);
bx1.xfir1.text =  fir.sno[0].aa.text();
bx1.xsay1.text =  fir.sno[0].bb.text();
bx1.xad1.text  =  fir.sno[0].cc.text();
bx1.xtip1.text =  fir.sno[0].dd.text();
bx1.xdil1.text =  fir.sno[0].ee.text();
bx2.xfir2.text =  fir.sno[1].aa.text();
bx2.xsay2.text =  fir.sno[1].bb.text();
bx2.xad2.text  =  fir.sno[1].cc.text();
bx2.xtip2.text =  fir.sno[1].dd.text();
bx2.xdil2.text =  fir.sno[1].ee.text();
bx3.xfir3.text =  fir.sno[2].aa.text();
bx3.xsay3.text =  fir.sno[2].b.text();
bx3.xad3.text  =  fir.sno[2].cc.text();
bx3.xtip3.text =  fir.sno[2].dd.text();
bx3.xdil3.text =  fir.sno[2].ee.text();

And for the second, try this:
var stThings:Array = [st1, st2, st3];
var bxThings:Array = [bx1, bx2, bx3]
var globalURLRequest:URLRequest = new URLRequest ("tgs.aspx?st=1003")
for each(var stWhat in stThings)
stWhat.addEventListener(MouseEvent.CLICK, clickHandler);
stWhat.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
stWhat.addEventListener(MouseEvent.MOUSE_OUT , outHandler);
function clickHandler(event:MouseEvent):void
navigateToURL(globalURLRequest,"_blank")
function overHandler(event:MouseEvent):void
var index:int = stThings.indexOf(event.target);
bxThings[index].visible = true;
function outHandler(event:MouseEvent):void
var index:int = stThings.indexOf(event.target);
bxThings[index].visible = false;
It's difficult to interpret your code--you may want to take some time to write more readable code.
For example, what is an 'st1'? Is it a button? What does it do?
Consider if it were a button made to load Story 1... a much more readable name would be btnStory1.
Also, there really is no advantage to identifying events as eeeeevt, zeeeevt and changing those.
Pick a convention and stick to it. I prefer 'event', others use 'e' or 'evt'.
And try to use function names that mean something, "function a1003mo(zeeevt2:MouseEvent):void {" is much more easily read as "function outHandler(event:MouseEvent):void"
I'd be interested to see what it is you're making, I believe there are some real opportunities to optimize it.
HTH
-Ted

Similar Messages

  • How to write Select statement for this codition

    I need to check whether SGTXT contains BELNR value.
    SGTXT is a text field and It should be matched with BELNR
    How to write select statement for this.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT should have the given BELNR Value.
    Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.

    Hi,
    data temp(12).
    concatenate '%' belnr '%' into temp.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT like temp.
    If belnr is having multiple values,just create a internal table as follows.
    types : begin of ty,
            belnr....
            temp(12),
            end of ty.
    data itab_ type standard table of ty.
    data wa type ty.
    loop at itab into wa.
    concatenate '%' wa-belnr '%' into wa-temp.
    modify itab from wa index sy-tabix transporting temp.
    endloop.
    Change your select statement accordingly.
    Kindly reward poits if it helps.

  • How to write  complex sql for this

    Hi ALL,
    I have a requirement like this
    I have 5 tables which i have to join to get the result
    but there no join column to 2 other table.
    I want to get all the applications using cobal,running on UNIX.
    How to write the query for this
    1.APP
    APP_i DESC
    1 Accounts
    2 Payments
    3 order transfer
    4 Order processing
    2.Techgy
    techid techdesc
    1 cobal
    2 Java
    3.APP_Techgy
    APP_I Techid
    1 1
    2 1
    3 1
    4 2
    4.Pltfrm
    pltfmid pltfrmdesc
    1 Windows NT
    2 UNIX
    5.APP_Pltfrm
    APP_I pltfrmid
    1 1
    2 1
    3 2
    4 2
    ouput must be
    APP_i Desc techDESC pltfrmdesc
    3 ordertranfer Cobal UNIX
    Thanks in advance

    This ('descr' in place of 'desc')?
    SQL> select a.app_i, a.descr, t.techdesc, p.pltfrmdesc
    from app_techgy atc,
       app a,
       techgy t,
       app_pltfrm ap,
       pltfrm p
    where atc.techid = t.techid
    and atc.app_i = a.app_i
    and atc.app_i = ap.app_i
    and ap.pltfrmid = p.pltfmid
    order by a.app_i
         APP_I DESCR                TECHDESC             PLTFRMDESC         
             1 accounts             cobal                windows nt         
             2 payments             cobal                windows nt         
             3 order transfer       cobal                unix               
             4 order processing     java                 unix               
    4 rows selected.

  • How to write a PCR for this ?

    Hi SAP-HR Experts .
    Dear friends , My Company Requires a specific requiremnt that at the date of any Employee's
    B'day his one day salary should get doubled and he is entitled to get one leave on his B'day .
    I do not know how to write a PCR for this ?
    May some Body tell me how to meet this requirement Please .
    tell me please step by step how to go through ...
    It will be great help for me .
    Best regards : rajneeesh

    I think you can make it with something like this:
    Write a PCR in schema, you can call the rule with "actio";
    000860 ACTIO 9BIR AR               Birthday
    Rule 9BIR
    9BIR Rule for Birthday
            NUM=FG C   Set                   " F (fixed indicator for deadline calculation); G (Birth date from infotype 0002);C (complete months)
            NUM/12     División              " Number of completed months divided by  12
            NUMV0O2L   Off.Lng en arg.var.   " the last two places of the number are entered in the variable argument.
                                " if the rest is not 00, there is nothing to do
              00                             " if the rest is 00
                ZERO= N    AmtNumRteZeit = 0 "
                AMT=  1002 Set               " wagetype of  salary
                AMT/TKDIVI División          " divides the amount by  Partial Period Parameter Whole Month
                ADDWTI1002 Input table       " accumulates into 1002
    Example: an employee with birthday 01.01.1977 in IT0002
    Payrroll in january 08
    wagetype 1002 before rule 9BIR:
    3 1002 Salario Bas01                           30,33  30,00              909,90
    Rule 9BIR
    NUM=FG C   Set; NUM= 372
    NUM/12        ; 372/12= 31 rest=00
    AMT=1002      ; AMT= 909,90
    AMT/TKDIVI    ; 909,90/31= 29,35
    ADDWTI1002    ; 909,90 + 29,35= 939,25
    wagetype 1002 before rule 9BIR:
    3 1002 Salario Bas01                           30,33  30,00              939,25
    Hope this helps. Manuel

  • How to write a cursor for mutiple columns in forms urgent required.........

    i created one table rk with 8 columns and that i designed in forms.
    but i have another table grk with 4 columns.
    this grk contains data.
    this grk 4 columns data i have to retrive in rk table in froms by multiple records.
    the both column names are same in the both tables.
    because by seeing this 4 columns data i will insert remaining 4 column by entering in rk table in form.
    i known that i have to write cursor to retrive the 4 columns data for multiple record from grk table and in trigger i have to produce to rk table.
    i have worked but it is not working.
    can any body help me out how to write a cursor for 4 column to retrive multple records in form

    Hi,
    Try,
    DECLARE
            CURSOR Cur_Test IS SELECT <field_1>, <field_2>, <field_3>, ... <field_n> FROM <table_name> WHERE <condition>;
    BEGIN
            OPEN Cur_Test;
            LOOP
                    FETCH Cur_Test INTO <items_or_variables>;
                    EXIT WHEN Cur_Test%NOTFOUND;
            END LOOP;
            CLOSE Cur_Test;
    END;Regards,
    Manu.

  • How to write the logic for extending Idocs...

    Hi,
          Can anybody pls explain how to write the logic for extending IDOCs with an example...
          Good suggestions can be appreciated..
    Regards,
    Ram

    Hi Ram,
    Generally the IDoc user exit is called at the following places:
      1) When the control record is read.
      2) After each and every segment in the data record
      3) At the end of the data segment processing.
    The IDoc user exit interface generally imports IDOC_DATA (data record internal table) table. Now the data records in the internal table should appear in the same order as maintained while defining IDoc structure (WE30 transaction). For SAP standard segment SAP code will take care of this. For extended segment you will have to take care of this aspect by appending the Z-segment in the IDOC_DATA table.
    You can do this by:
             looping at IDOC_DATA table:
                 - Do a case-endcase fo IDOC_DATA-SEGNAM (This stores the segment 
                   structure as per the hierarchy).
                 - Within the case for "Z-segment" you can write the logic for appending
                   the Z-segment to IDOC_DATA-SDATA.
    Hope this gives some clue.
    Regards,
    Gajendra.

  • How to write conversion routine for key figure?

    Our customer has this requirment:
    we need to know the last time of some TV program in BEx report, If a TV program last 500 seconds, we need show the key figure like this:  00:08:20, If a TV program last 100000 seconds, we need show the key figure like 27:46:40 (27 hours and 46 minitues and 27 seconds), If we define a key figure as time,  BW system will report a error that say it is not acceptable time.  If we want to define a integer, but we need display it like hhmmss format.  We know we can write conversion routine for char.  but I don't how to write conversion routine for key figure.   Please give me any hint if any other solutions?
    Edited by: SY DONG on Dec 2, 2010 3:36 AM

    If you want to do in Transformation Layer :
    You can use routine ...break up the seconds into minute hour and seconds
    you will have to handle few cases in this:
    let say your variable lv_seconds holds the number of seconds you want to convert to hour min and seconds
    DATA: lv_seconds type i,
               lv_hrs  type  i,
              lv_sec type i,
              lv_min type i.
    lv_hrs = lv_seconds / 3600
    if lv_hrs >= 1.
    lv_min = (lv_hrs - trunc(lv_hrs))*60
    here again handle seconds if min >60.
    else.
    lv_hrs = '00'.
    lv_min = lv_hrs*60
    It is just hint ..how you can manipulate the seconds to get it...you will have to think about the complete algorithm
    Regards,
    RK

  • How to execute a loop for every 15 minutes

    how to execute a loop for every 15 minutes or 30 minutes constantly...

    I need to insert a number into an array for every 15mins continuously..and the array need to hold all datas for example in 0th position i insert a value 10 by 10.00am, after that at 1st position i need to insert 11 by 10.15am, next at 2nd position i need to insert 12 by 10.30am and so on...how this can be done

  • How to download apple loops for Garageband 10.0.1 ?

    How to download apple loops for Garageband 10.0.1 ?

    If iDVD was not preinstalled on your Mac you'll have to obtain it by purchasing a copy of the iLife 09 disk from a 3rd party retailier like Amazon.com: ilife 09: Software or eBay.com.  Why, because iDVD (and iWeb) was discontinued by Apple over a year ago. 
    Why iLife 09 instead of 11?
    If you have to purchase an iLife disc in order to obtain the iDVD application remember that the iLife 11 disc only provides  themes from iDVD 5-7.  The Software Update no longer installs the earlier themes when starting from the iLIfe 11 disk nor do any of the iDVD 7 updaters available from the Apple Downloads website contain them. 
    Currently the only sure fire way to get all themes is to start with the iLife 09 disc:
    This shows the iDVD contents in the iLife 09 disc via Pacifist:
    You then can upgrade from iDVD 7.0.3 to iDVD 7.1.2 via the updaters at the Apple Downloads webpage.
    Export the slideshow out of iPhoto as a QT movie file via the Export button in the lower toolbar.  Select Size = Medium or Large.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    And yes, iDVD 7.1.2 will work with Mavericks.
    Happy New Year

  • How to write sql query for counting pairs from below table??

    Below is my SQL table structure.
    user_id | Name | join_side | left_leg | right_leg | Parent_id
    100001 Tinku Left 100002 100003 0
    100002 Harish Left 100004 100005 100001
    100003 Gorav Right 100006 100007 100001
    100004 Prince Left 100008 NULL 100002
    100005 Ajay Right NULL NULL 100002
    100006 Simran Left NULL NULL 100003
    100007 Raman Right NULL NULL 100003
    100008 Vijay Left NULL NULL 100004
    It is a binary table structure.. Every user has to add two per id under him, one is left_leg and second is right_leg... Parent_id is under which user current user is added.. Hope you will be understand..
    I have to write sql query for counting pairs under id "100001". i know there will be important role of parent_id for counting pairs. * what is pair( suppose if any user contains  both left_leg and right_leg id, then it is called pair.)
    I know there are three pairs under id "100001" :-
    1.  100002 and 100003
    2.  100004 and 100005
    3.  100006 and 100007
        100008 will not be counted as pair because it does not have right leg..
     But i dont know how to write sql query for this... Any help will be appreciated... This is my college project... And tommorow is the last date of submission.... Hope anyone will help me...
    Suppose i have to count pair for id '100002'. Then there is only one pair under id '100002'. i.e 100004 and 100005

    Sounds like this to me
    DECLARE @ID int
    SET @ID = 100001--your passed value
    SELECT left_leg,right_leg
    FROM table
    WHERE (user_id = @ID
    OR parent_id = @ID)
    AND left_leg IS NOT NULL
    AND right_leg IS NOT NULL
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Can any one please tell me how to write labview program for data logging in electric motor bike.

    Can any one please tell me how to write labview program for data logging in electric motor bike. I am going to use CompactRIO for getting wide range of data from various sensors in bike. I need to write labview program for data logging of temperature, voltage and speed of the bike. Can any one help me?

    Yes, we can.   
    I think the best place for you to start for this is the NI Developer Zone.  I recommend beginning with these tutorials I found by searching on "data log rio".  There were more than just these few that might be relevant to your project but I'll leave that for you to decide.
    NI Compact RIO Setup and Services ->  http://zone.ni.com/devzone/cda/tut/p/id/11394
    Getting Started with CompactRIO - Logging Data to Disk  ->  http://zone.ni.com/devzone/cda/tut/p/id/11198
    Getting Started with CompactRIO - Performing Basic Control ->  http://zone.ni.com/devzone/cda/tut/p/id/11197
    These will probably give you links to more topics/tutorials/examples that can help you design and implement your target system.
    Jason
    Wire Warrior
    Behold the power of LabVIEW as my army of Roomba minions streaks across the floor!

  • How to write Error message for select options?

    Hi
    i have this select option statement
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    how to write error message for this?
    Regards
    Smitha

    Error messages are displayed for Select-options mostly on two conditions:
    1) You needs to check wether a value is entered or not its done by:
    a)
    Select-options:SELECT-OPTIONS: s_fevor FOR afko-fevor Obligatory.
       In this case error message is automatically throwed by system.
    b) You can do this in Selection Screen events.
    Ex:
    AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
    IF S_FEVOR-LOW IS INITIAL.
    MESSAGE 'XXXXX' TYPE 'E'.
    ENDIF.
    2) You need to Validate the entered value:
    You can do this in Selection Screen events.
    Ex:
    AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
    SELECT FEVOR
                 FROM AFKO
                 INTO AFKO-FEVOR
                 UP TO 1 ROWS
    ENDSELECT.        
    IF SY-SUBRC NE 0.
    MESSAGE 'XXXXX' TYPE 'E'.
    ENDIF.
    Regards,
    Gurpreet

  • How to write a code for  open new txt file in swing

    hai all,
    now i do one project in java.that project's GUI is Swing. But i don't known swing (basic).So how to write a code for open new txt file and "Open window " in menu item on swing.that means when i click the "New" on menu that time open a new txt file. open also like that type.
    plz give me that code ! very urgent
    Advance Thanks !
    RSK

    Swing Tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/index.html
    Since you don't know the basic of swing read the tutorial, it is for your own good because it is useless if we provide you with a code you don't even understand and how it works.
    If you want a menu read the tutorial about using menus and for opening a file read using JFileChooser.
    note: don't use the word urgent because it implies that your problem is more important than others.

  • How to write professional documentation for java

    Hi, I have few application I need to write documentation for. Im ok with the user and serwer technical stuff. But how to write proper documentation for source code? Any tutorial or howto?
    Best regards.

    Phenom7 wrote:
    Hi, I have few application I need to write documentation for. Im ok with the user and serwer technical stuff. But how to write proper documentation for source code? Any tutorial or howto?A pointer: be explicit and specific when writing Javadocs. If your method never returns null, make sure you say so. If it can't accept null as a parameter, be sure to say what the consequence will be if it happens (but it's OK to say the result is undefined!). A well-written method Javadoc will make users of any API you make a lot more happy, rather than keeping them guessing or making them inspect your source code.
    It's expected that while the implementation of a method will change, its pre and post-conditions will not. Therefore, having a good method-level Javadoc is critical to both the people counting on your code and the people maintaining your code.

  • How to write a code for cumulative values..

    Hi
    Can any one proivde the Sudo code for Customer exit at Reports.
    I need to write a code for when ever user input Calaender month then querry calucalate the cumulative values also.
    How to write a code for cumulative values..
    Example:
    Customer -Sales.Quantity(CalMonth)---   Sales.quantity(Cumulative Month)  
    1000--223--
    2200
    Regards
    mannev.

    hi mannev,
    to get an idea, search in SDN
    for example
    customer exit code
    with hopes,
    Raja Singh

Maybe you are looking for

  • Kobo and library books

    Now that I've downloaded a book from the library, How do I get it on to the Kobo?  It's really frustrating.

  • ITunes Purchases no longer play on Authorised MacBook Pro

    This is on my MacBook Pro 15, with iLife 08 and Leopard - ALL BANG UP-TO-DATE Some of my Purchases (Not the most recent, nor the oldest) have stopped playing. I get the Apple User Authorise banner, asking for my password. I put the password in - it m

  • Twitter Widget Updates in iWeb Site

    Hello all I've come across some web pages created with iWeb (I believed) and it has a small section/square with the creator's *Twitter updates*. Is there such a widget readily made in iWeb, or I have to created with some perhaps, complicated script o

  • Why submit a new radio station in itunes?

    Hello everybody It's possible to add a new radio station in itunes? Is there an email or a contact at itunes? Thank you very much

  • Image capture 10.4 worse than 10.3

    As a professional photographer I'm a heavy user of Image Capture. It really is a god send. but since 10.4 it has become a real pain to use. (almost like a windoze program!) First it never remembers my window size and thumbnail size settings as it did