• About Us
  • Classroom Training
  • Online Training
    • Self Paced Courses
      • HTML and CSS For Beginners (with HTML5)!
      • Javascript for Beginners
      • C Programming: iOS Development Starts Here!
      • Objective C For Beginners
      • PHP MySQL For Beginners
      • Web Development Code Camp
    • Live Instructor Courses
      • HTML and CSS with HTML 5 (Live)
      • Javascript for Beginners (Live)
      • C Programming for Beginners (Live)
      • Objective C for Beginners(Live)
      • Android Development Code Camp (Live)
      • iOS Development Code Camp (Live)
      • HTML5 & Advanced Client Side Development (Live)
      • Actionscript for Beginners (Live)
  • Forum
  • Testimonials
  • Contact Us
    • Actionscript
    • Android
    • C/C++/Objective C
    • HTML/CSS
    • iOS
    • Java
    • Javascript
    • PHP
Home > Actionscript > How To Actionscript: Arrays

How To Actionscript: Arrays

Posted by Mark Lassoff on November 17th, 2011 Actionscript, arrays, Flash Builder, Flash Professional, Flex, tutorial, Video
| No Comments

Arrays are an important structure in any programming language. Arrays are designed to allow the programmer to hold multiple pieces of data in a single structure. In this tutorial Mark, demonstrates the basics of arrays using Actionscript and Flash Builder. Mark creates two different arrays and populates them with data. Then he demonstrates several array methods that allow you to add to the array, delete from the array, and manipulate the array in several other ways.

If you are using Actionscript with Flash Professional, Flash Builder or Flex, you will find this tutorial useful.

This “How To Actionscript” series is designed for the developer who wants to learn different Actionscript techniques quickly and easily.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="400" minHeight="500"
			   creationComplete="init()">
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	<fx:Script>
		<![CDATA[
			function init()
			{
				//Formal
				var myFamily:Array = new Array("Brett", "Kerry", "Joan", "Rick", "Kevin", "Conner", "Colleen", "Carol");
				var languages:Array = ["C++", "Objective C", "Actionscript", "Java" , "PHP" , "Assembly"];
 
				//txtResult.text =  myFamily.toString();
				//txtResult.text = myFamily[3];
 
				languages[(languages.length+1)] = "C#.net";
				languages.push("Visual Basic");
				var returnedElement = languages.pop();
 
				for(var x=0; x < languages.length; x++)
				{
					txtResult.text += languages[x] + "\n";
				}
 
				txtResult.text += "Returned Element: " + returnedElement;
 
 
			}
		]]>
	</fx:Script>
	<s:TextArea x="18" y="10" id="txtResult"/>
</s:Application>

Tags: Actionscript, arrays, Flash Builder, Flash Professional, Flex, tutorial, Video

Leave a Reply

Click here to cancel reply.

Join our mailing list

Free video tutorials, course information and more!

* required

Email Address *

First Name

Last Name:

Email Marketing Software by VerticalResponse
Apple Store Facebook Google+ LinkedIn RSS Feed Twitter YouTube
Provided by The Social Links

Like Us!

Live Online Course

Online event registration powered by Eventbrite

Self Paced Course

What is ?

We train software, web and mobile developers. Our classes geared to the way adults learn are available online, or in-person at your office or training center.

New Android Book

Android Programming Code Camp by Mark Lassoff. Coming in 2012. Finally, a true beginners book on Android programming and development. No Experience required.

Email me when the book is available

On Learning

  • Top Languages Used in Web Development
  • How To Learn a Programming Language: 5 Tips
©LearnToProgram.tv 2012 .All rights reserved.