A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Do . . . While and Trying to Get Your Attention

  1. #1
    Member
    Join Date
    Jul 2001
    Posts
    70
    What is Do . . . While? I've done BASIC programming, but in ActionScript, it nearly locks up my Flash presentation.

    Any help?

  2. #2
    Senior Member
    Join Date
    Mar 2000
    Location
    London
    Posts
    961
    Do.. While is the same as 'Loop' and 'For'.

    It DOES something WHILE something else is true. It differs from For and Loop as it will DO something once before checking whether something is true.

    The below examples illustrates the differences.



    DO... WHILE

    Example:
    i = 0;
    do {
    i = ++i;
    trace (i);
    } while (i < 5);

    Output :
    1 2 3 4 5



    FOR

    Example
    for (i = 0; i < 5; ++i) {
    trace (i);
    }

    Output:
    0 1 2 3 4


    [Edited by Little Ben on 08-06-2001 at 09:47 AM]

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