dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [help] for....in

  1. #1
    doItLikeThis
    Join Date
    Jan 2004
    Location
    :noitacoL
    Posts
    1,080

    [help] for....in

    I was just playing around with my old .fla's and was thinking, how is for...in used, which I still can't get. I know i can use it to some how check multiple bullets on multiple enemies....but Iam not able to get the for...in , please can any one explain?
    -Aditya

  2. #2
    Feeling adventurous? T1ger's Avatar
    Join Date
    Mar 2004
    Posts
    850
    That exactly the reason why MM included help-files with flash.

  3. #3
    Run for your life! Phlook's Avatar
    Join Date
    Jul 2003
    Location
    Vancouver, Canada
    Posts
    679
    Personally, ive only used it as an array checker, to check differences in arrays / variables etc.

    code:

    places = ["here", "there", "everywhere"];
    position = "there";
    for(i in places){
    if(places[i] == position){
    trace("Yay, i'm somewhere");
    }
    }



    Maybe theres other better uses for it though..

  4. #4
    ->-<-
    Join Date
    Sep 2004
    Location
    Just Livin' Life
    Posts
    190

    -Edit - Opps click the smiley on first line

  5. #5
    doItLikeThis
    Join Date
    Jan 2004
    Location
    :noitacoL
    Posts
    1,080
    This is why I wanna understand for..in loop:-
    http://www.kirupaforum.com/forums/ar...p/t-56861.html

    T1ger: Thanks for reminding and that was the first place I tried to understand, but I need a little more easier example to understand.

    Phlook: Yeah, I wanna know how the check is done.

    JBS103: Thanks anyway dude
    Last edited by adit_ya_sharma; 11-09-2004 at 02:05 AM.
    -Aditya

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center