Do..while Statement - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Usage 4: The following example shows the behavior of
var ref1:Object = new Object();
ref1.name = "Jody";
// copy the reference variable into a new variable
// and delete ref1
ref2 = ref1;
delete ref1;
trace("ref1.name "+ref1.name); //output: ref1.name undefined
trace("ref2.name "+ref2.name); //output: ref2.name Jody
If
had not been copied into
ref1
deleted because there would be no references to it. If you delete
to the object; it will be destroyed, and the memory it used becomes available.
See also
var statement

do..while statement

do { statement(s) } while (condition)
Similar to a
loop, except that the statements are executed once before the initial
while
evaluation of the condition. Subsequently, the statements are executed only if the condition
evaluates to
.
true
A
loop ensures that the code inside the loop executes at least once. Although this
do..while
can also be done with a
the
loop begins, many programmers believe that
while
If the condition always evaluates to
infinite loop, you encounter problems with Flash Player and eventually get a warning message
or crash the player. Whenever possible, you should use a
times you want to loop. Although
loops in all circumstances.
do..while
Availability: ActionScript 1.0; Flash Lite 1.0
Parameters
condition:Boolean
code will execute as long as the
, the object would have been deleted when
ref2
loop by placing a copy of the statements to be executed before
while
, the
true
loops are easy to read and debug, they cannot replace
for
- The condition to evaluate. The
condition
on object references:
delete
ref2
do..while
loop is infinite. If you enter an
do..while
loop if you know the number of
for
statement(s)
parameter evaluates to
ref1
, there are no references
loops are easier to read.
within the
block of
do
.
true
Statements
was
189

Advertisement

Table of Contents
loading

Table of Contents