Archive

Posts Tagged ‘Learning’

O’Reilly Code Search

September 10th, 2006 Fraser Crosbie No comments

O’Reilly’s has recently launched a search engine that will scour through nearly 700 of their books, including over 123,000 individual examples, composed of 2.6 million lines of code. I think O’Reilly has published around 21 ActionScript related books at this time.

http://labs.oreilly.com/code/

Categories: Flash Development Tags: ,

Building a Basic Menu in ActionScript 3.0 Tutorial – Part 1 – Array

September 7th, 2006 Fraser Crosbie 25 comments

Today I have decided to build a simple ActionScript 3.0 horizontal menu based on an array. This is a fairly common practice in Flash development as we are often using data provided from a XML file to dynamically update content within our movies. To simplify this tutorial I am going to use an array that is written within my code instead of parsing it from a XML file.

The following example will demonstrate how to loop through an array and draw a button for each item in that array. Each button will have a label, an up state and an over state. I have read that it is good practice to use the SimbleButton object whenever possible, but I am not going to use the it in this tutorial because I am interested in learning more about addChild(), getChildByName(), currentTarget, mouseChildren and other features of ActionScript 3.0 that could be avoided using the SimpleButton.

Read more…

SimpleButton and Events in ActionScript 3.0 Tutorial

August 2nd, 2006 Fraser Crosbie 16 comments

In AS3, one of the most significant changes was to make the EventDispatch class the standard tool for calling events. This is a huge step in ActionScript as code written by different developers will become a lot more similar.

In the following example I will demonstrate how to use addEventListener to add a click event to a button that is built using the new SimpleButton object. The SimpleButton is a light weight alternative to the heavier MovieClip object.

Read more…

Drawing Shapes in ActionScript 3.0 Tutorial

July 28th, 2006 Fraser Crosbie 4 comments

ActionScript 3.0 has some great new functions to simplify drawing shapes. Previously in ActionScript 2.0 you had to specify each point in a shape and draw lines between them. Now, you can use drawCircle, drawEllipse, drawRect & drawRoundRect to speed up the process.

Lets take a look at how it is done:

Read more…

ActionScript 3.0 Document Class Tutorial

July 28th, 2006 Fraser Crosbie 6 comments

Well, it appears that in my previous posts about ActionScript 3.0, I am a bit old school. I have been instantiating my code from the first frame of the timeline using the import statement. After opening up a few of the as3_labs_samples_062706 and realizing that there is no code on the timeline, just a disclaimer, I started to scratch my head. I checked the library of the .fla to see if I could see any linkages. Still, I could not find any reference to the external code. The next place I checked was the Publish Settings (Ctrl-Shift+F12) and lo and behold, I found my answer. If you click on the Flash tab, then on the settings… button you will see the new Document class: field. Using this field you can instantiate your code. This is a much cleaner way of doing things. Finally a Flash Developer’s dream come true, no more code on the timeline.