A while statement can be used even when the number of times is unknown. : While : Statement Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Statement » While »

 

A while statement can be used even when the number of times is unknown.


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var nIndex:Number = 0;
        var aValues:Array = [1,2,3];
        
        while(aValues[nIndex!= null && nIndex < aValues.length) {
          trace(aValues[nIndex]);
          nIndex++;
        
        for(var i:Number = 0; i < aValues.length; i++) {
          if(aValues[i== null) {
            break;
          }
          trace(aValues[i]);
        }
        

    }
  }
}
1
2
3
1
2
3

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Statement
» While