Groups | Blog | Home
all groups > flash actionscript > june 2004 >

flash actionscript : Working with conditions


Simon Jakobsson
6/22/2004 11:36:10 PM
Can someone here explain just basic, how to work with statements, i'm having an
idea when i want a condition to be set, then another action is going to read if
the condition is set, if so, it should move to the page who has set the
condition. Working fine, but how to set them, and how to check them.
I thought i would contruct it like this but its some specific sentences i dont
know how to write. (i'll mark them with a * and write what i like to tell flash
in my own words)

example:

on (release) {
if
* "My_condition" is set *
gotoAndStop("another_page")
else if
* "My_condition2" is set*
gotoAndStop("another_page2")
}

and so on...

Then i want to know how to set the conditions:

example:
on(release) {
set "my_condition"
}

So i need some help with how to type in ActionScript 2.0 to check and set
conditions.
Any help appriciated.//simon
Timothée_Groleau
6/23/2004 9:29:54 AM
Sorry but with a question like this I can only encourage you to get a
book and/or to check out the documentation and/or check out the tons of
flash forums around for sample code. The language syntax is what you
should at least have learned before posting a question here. To just
learn the syntax, even a javascript book would do because the syntax is
the same. So you really do have a lot of choices.

In any case, here is a quick example on conditional syntax:

// setting a variable
myVariable = 72

// equality with number
if (myVariable == 45) {
gotoAndStop("a_page");
} else {
gotoAndStop("another_page");
}

and some extra conditional operators to start with:
[quoted text, click to view]


Tim


[quoted text, click to view]
AddThis Social Bookmark Button