INCLUDE_DATA

AS3 Code Snippets

Flash 9/10: AS3 SNIPPETS!


Snippets are a great way to save time and store valuable pieces of code that you often use. Not only are they great to grab just with copy/paste when needed, but there are a variety of panels out there for Flash that let you access these snippets of code directly from within Flash. I use Snippets Panel, which I found at Lee Brimlow’s TheFlashBlog.

I started a page where I will be adding various Snippets, both in normal copy/paste style and in the Snippets format so if you do use the Panel you can just paste them directly in. The Snippets are from my own collection, along with many others I have found through out the years around the Internet and have proven useful, so enjoy them, as they save a lot of time!


View the Snippets Page ~>

Advanced LightBox w/SlideShow

Flash 9 : Tutorial


In this tutorial we will be creating an Advanced LightBox for viewing our images, along with the ability to play an array of your pictures in a SlideShow! This tutorial was written with images from the Library as not to complicate the focus of our tutorial, but it can easily be adapted to a Dynamic XML Database Gallery. Our LightBox has the ability to go to both the Next and Previous Images in our gallery, along with playing all the images of our gallery in a SlideShow. An example of what you can do with this can be seen here at my Ana Banana XML Gallery


This is the result of our Advanced LightBox w/SlideShow:
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)
View a more advanced version Gallery based off this tutorial at my Ana Banana XML Gallery


View the Full Tutorial ~>

Loading External swf’s

Flash 9 : Tutorial


In this tutorial we will take a look at loading external swf’s, such as images and movies, into Flash. You can use such a method for loading swf’s within other swf’s, creating a movie gallery, or from a dynamic XML file (as we use in the Dynamic XML Gallery Tutorial).


This is the result of our Loading Movies and Images Tutorial
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)


View the Full Tutorial ~>

Print in Flash

Flash 9 : Tutorial


In this Tutorial, we will create a simple Print Job with which you can print your stage from Flash. This is great to add to Galleries, Research Information, or even projects like our Drawing App Tutorial.


This is the result of our Print Tutorial, click the Print button to print the image!
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)


View the Full Tutorial ~>

Creating a Dynamic XML Gallery and LightBox

Flash 9 : Tutorial


In this tutorial we will be creating a Dynamic XML Gallery along with a simple LightBox. You will learn how to handle simple XML and its attributes/values, along with learning the methods to display your gallery images and to present them in a styled light box with a description.


This is the result of our Dynamic XML Gallery and LightBox
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)


View the Full Tutorial ~>

Tweener Class Tutorial

Flash 9 : Tutorial


In this Tutorial, we will look at the Tweener Class and it’s different parameters. We will start by getting the Tweener Class and setting up a MovieClip to be tweened, then we will get to tweening the MovieClip in a variety of ways.

Methods to check out:
- Tweener Class Documents: These are the documents for the Tweener Class.
- for(var i = 0; i < num; i++): The for each statement allows you to quickly loop an action/method/function many times over.


This is the result of our Tutorial on Tweener Class
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)


View the Full Tutorial ~>

Making a Drawing Application (part 2)

Flash 9 : Tutorial (Part 2 of 2)


This is part 2 of the Drawing Application Tutorial. In the 1st tutorial you created the base code to draw onto your stage using your mouse, along with setting up a reset button. In this portion, we will create dynamic properties so the user can change the color, alpha, and lin thickness of their drawing, and also how to change out the mouse pointer with something more appropriate.

Methods to check out:
- clear(): Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
- lineStyle(): Specifies a line style that Flash uses for subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object. In other words, it set the styles for the line you will be drawing.
- lineTo(): Draws a line using the current line style from the current drawing position to (x, y); the current drawing position is then set to (x, y).
- moveTo(): Moves the current drawing position to (x, y).


This is the result of part 2 of our Tutorial, draw within the box by holding down your LEFT-MOUSE BUTTON
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)


View the Full Tutorial ~>

Make a Drawing Application (Part 1)

Flash 9 : Tutorial (Part 1 of 2)


In this tutorial we will create a line drawing application using the Flash Drawing API. This is great for making your own drawing pad or adding trail functionality to your site. This is part 1, in which we will create the drawing components and get the Drawing Application up and working. In part 2, we will add to the base and add in Dynamic properties that can be changed, such as line thickness, alpha, and color.

Methods to check out:
- clear(): Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
- lineStyle(): Specifies a line style that Flash uses for subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object. In other words, it set the styles for the line you will be drawing.
- lineTo(): Draws a line using the current line style from the current drawing position to (x, y); the current drawing position is then set to (x, y).
- moveTo(): Moves the current drawing position to (x, y).


Lets see what we are making, draw within the box by holding down your LEFT-MOUSE BUTTON
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)


View the Full Tutorial ~>