Flash CS3 indexOf – method of Array class

25Apr08

Greetings to all!
In the tutorials of Actionscript 3.0, we saw what are Arrays and how much they can be important using Flash CS3.
Also, we saw in details the use of the method splice of the Array class.
Why would I want to remind you all of the above?
Everything seen first will be useful to explain how to create a grid of squares with Flash with every single square being selection able and not.
Basically, on click of the mouse on one of the square in the grid, the square itself, if not already selected, will be added to an Array. Otherwise, if already selected, it will be removed from the Array.
To do this, we will need the method indexOf of the Array class of Actionscript 3.0.
Let us look at a concrete example

Author and source



No Responses Yet to “Flash CS3 indexOf – method of Array class”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.