web design template

Page: 1 2

Dear Friend,

Hello, & welcome back to FIREWIRE, your friendly guide to the exciting world of web-design & web-solutions! In the previous newsletter of Flash 5 Tutorial Series we had discussed about Math Objects, Date & String Function. Now let’s Continue with Bitwise Operators, Comparison Operators, Logical Operators, Numeric Operators, String Operators, Operators.


XOR (^)

Using XOR operator, two expressions are converted to 32 bit unsigned integers and return 1 in each bit position where the corresponding bits in expr 1 and expr 2, but not both are one.

Syntax :
expr 1 ^ expr 2

Example :
trace (15 ^ 9);

The output window shows the value 6.
OR (|)

Used to perform a 32 bit unsigned integers.

Syntax :
expr 1 / expr 2

Example :
x = 15;
y = 9 ;
trace (x/y);

The output window shows a value "15".

Note :

In XOR,
Binary value of 15 - 1111
Binary value of 9 - 1001
(1111 ^ 1001 - 0110) (0110 - 6)

In OR,
Binary subtraction takes place as
(1111 / 1001 - 1111)
(1111 - 15)


Bitwise AND ( & )

Using this operator, two expression can be converted to 32 bit unsigned integers and perform a Boolean AND operators.

Syntax :
expression 1 & expression 2

Example :
If (name = = "galaxy" & password = = "layout")
{
trace ("welcome");
}

The example will check for both the condition and show the output as welcome.

flash website templates

Bitwise Not :

Used to convert expressions to 32 bit unsigned integer, then invert the bits.

To simply explain, changes the sign of the number and subtracts one.

Syntax :
(expression)

Example :
trace ( ( 0) );
trace ( ( 1) );

The output will be -1 and -2.

Using the greater than operator, two expressions can be tested for greater ness.

Syntax :
expr 1 > expr 2

Example :
X = 6;
Y = 5;

trace (x > y);

The output window shows "true".

The greater than and equal to is used to compare and greatness of and equality of two expressions.

Syntax :
expr 1 >= expr 2

Example :
X = 5
Y = 5
Trace (x>=y);

flash website templates

The output window will show true. Since it is >= & hence x=y (i.e.5=5)

Less , Less Than and Not Equal Operator(<=, < > or <)

These operators are used to compare two expressions. The less than or equal operator checks for whether any one expression is less or equal to the other.

Syntax :
expression 1 < = expression 2

Example :
on (press)
{
x=5 ; y = 10
trace (number(x) <= number (y) )
}

The output window will show which number is less(i.e. true). It will return only Boolean value.

Inequality ( < >)

This operator checks exactly opposite for equality. If the expressions are not equal, then it will return true.

Syntax :
expression 1 < > expression 2

Example :
a = 2;
b = 3;
trace (a< >b);

The output will show (that a< >b) a Boolean value.

Less than (<)

This operator will check whether expression 1 is less than expression 2

Syntax :
expr 1 < expr 2

Example :
a = 2;
b = 1;
trace (a >b);

The output window shows "false".






© Image Online  2001-2003