Currently Browsing: Actionscript

AS3 Code Snippets

The code snippet repository is my contribution to the community. These are functions that I tend to re-use and could easily be made into static functions and placed into a utility class, but I’ll leave that up to you. Check back often, for I while keep updating this posting when I have time between gigs. Remove Children from a display list /* Method: removeAllChildren Parameters: inDsp:DisplayObject Returns:...

AS3 Simple MVC

Here’s my idea of a simple MVC with the designer in mind. I originally wrote it in 2007 in AS2 with the help from a good friend Pete Rice. I revised it a bit and re-wrote it in AS3. Like I said it’s simple! It focuses on what designers know best, the timeline/MovieClip. It’s perfect for micro-sites or small RIA’s, its also ideal for single developers. It accomplishes what an MVC sets...

AS 3 Simple Video Player

On my last freelance gig, I created a simple Flash video player for a landing page. I took the existing code and extended it to create a SimpleVideo class that could be useful for Flash newbies or designers. I added the ability to pass in a MovieClip where a designer could create a stylish interface and load the video player into it. The first example below, loads up an flv and starts playing it. I added the...

Back In The Game

So, I took the plunge and decided to take a contract with an advertising agency (Euro RSCG) to create flash pieces for a pitch. At first, I was wondering why I would do such a thing knowing that the work would be a bunch of banner ads and micro-site landing pages. The bane of my existence, I’m used to building RIA’s with Flash not the annoying things that people complain about Flash. Nevertheless,...

MVC the Model-View-Controller Pattern

The time has come, I’m in need of a new portfolio website. I have started the planning stages of my interactive application architecture. I have chosen to use the MVC pattern vs the MVP (Model-View-Presenter) or the PAC(Presentation-Abstraction-Control). I have been using the MVC for the past 3 years and I have acquired a great admiration for it. Well what is a MVC pattern? In a nutshell the MVC pattern...

AS 3.0 blur filter using the Tween classes.

Here’s another AS 3.0 test I scripted up just for fun. As you know the Tween engine in flash will only allow you to tween properties of a MovieClip. I on the other hand have been using the tween classes to tween filters and just recently transform color. It’s just another way to create an animation with out an OnEnterFrame Event or using the Timer Event. The example below loads up an image in a...

AS 3.0 Color Transform Animation.

As I start to test out ideas for my new portfolio site, I scripted up an example of how to change color on shapes or MovieClips in AS 3.0. Well, it first started out as a basic Color Transform but then it evolved into a sort of color pusher, (if you will). I scoured the internet to make sure I was not re-inventing the wheel. I found some code snippets from Senocular which helped out a lot. The result is a square...

A simple image grid in AS 3.0

As I’m starting to code up my new AS 3 portfolio website, I have started posting articles on simple things I used to do in AS 2.0. Here’s an example of a simple image grid. One thing you will need to produce on your own is a 75X75 pixel image named image0.jpg. Open up your favorite text editor and just type away : package { import flash.display.*; import flash.events.*; import flash.net.URLRequest; public...

Loading an image into a Movieclip linked to a class in AS 3.0

This article will pick up where we last left off with ‘How do you load an image into a movieclip in AS 3.0?’ If you have not read the previous article, please do so. I will not be covering the creation of the image pod asset in this article. The following example will introduce you to the concept of associating classes with MovieClips. We will be using a main class that will add the image pod to...

How do you load an image into a Movieclip in AS 3.0?

How do you load a bitmap image (jpeg, gif,png) or SWF into a movieclip in AS 3.0? In the following example we will create a movieclip which resembles an AS 2 designers asset. We will add the asset to the stage ala attach movie, the AS 3 way and we will load an image into an empty movieclip that has been masked. Example – designer mc with a mask Lets start from scratch. Fire up Flash CS3 and Save it Select...
Page 3 of 41234
Coding Color | 2009 All Rights Reserved.