Tutorials

As I learn new things I often think that others may benefit from my discoveries. Here you may find information and tutorials about various technical things that I learn about. They may also prove to be useful to you.

Getting Started with ActionScript 3

roland's picture

If you are already experienced with programming and are wondering how you get started with ActionScript, I'll show you a few steps to get you coding.

There are two ways to use action script. Embedded scripting or external classes.

Method 1: Embedded Scripts

First, create a flash file:

Create a flash file

Now create a new layer.

Create a layer

Select on the first frame of the the new layer (Layer 2) and click on the Actions tab. If you don't see the Actions tab, go to Window->Actions or just press F9.

Adding actions

You can type something simple like trace("hello world");

To compile the source code press Ctrl+Enter.

Method 2: External Classes

With the arrival of AS3 the way flash handles scripting has gotten better. The language is better too. So, how do you tie your current stage to a class? Well, it's not too difficult.

Create an empty file and save it as test.fla as shown above

Now create an action script file. Name it with a camelized name such as MyTest and save it as MyTest.as in the same directory as the fla file you created above.

Enter the following code in the file.

import flash.display.MovieClip;
public class MyTest extends MovieClip {
	public function MyTest() {
		trace("hello world");
	}
}

Go to the Properties tab and in the Document class field enter MyTest

Compile the code with Ctrl+Enter.

Creating a Collage Poster from other pictures

roland's picture

Once I saw a poster that was composed of various pictures which werre used collaged into a larger picture.

I started wondering if it would really be easy to build such a function. I was going to use RMagick but ended up using PHP and GD.

The idea:

Use smaller sized thumbnails of existing employee pictures from our intranet to compose a new picture of a donkey I got from a search engine.

Theory:

Select the picture of a cute donkey:

001: iPhone SDK - Inputs and Buttons

roland's picture

This tutorial is meant to be a begginners guide to using the iPhone SDK. First off, you will need an Intel based Mac 0S 10.5, and the iPhone SDK.

1. Open XCode which is under HD -> Developer -> Applications.

2. Click on File -> New Project -> select iPhone OS - Application on the left -> View Based Application -> Choose -> Name project "Fields and Buttons"

3. Open "Fields_and_ButtonsViewController.h" and make it look like below: