Monday, September 06, 2010

Adobe Flex For The OI Guy – Part 3 – Conditionals

Adobe Flex Icon                  OpenInsight Icon

In this edition of "Adobe Flex for the OI Guy", we will discuss Actionsscript conditionals and how they compare to OpenInsight's conditionals.  First I will give you some links for you to review Actionscript conditionals, then I will go into detail on how it differs from OpenInsight Basic +.

For you to review Actionscript conditionals, visit here. This will give you a good overview of what conditionals are all about.

Actionscript your OI

The if statement

In OpenInsight:

In Actionscript:

Notice the parenthesis around the condition in Actionscript. Also, instead of the "then" keyword in Basic +, Actionscript uses the "{" and "}" curley braces.

Using Boolean Operators

As shown in an earlier post on Operators, the below code shows boolean operators in your conditional statement.

In OpenInsight:

In Actionscript:

Case Statements

In OpenInsight, Case statements are utilized for conditional branching.  In actionscript, it is not called a Case statement, it is known as a Switch statement.

In OpenInsight:

In Actionscript:

"Default" is basically an "otherwise" statement.

Next week — Loops!


Leave a Reply