ActionScript: A Global Utilities Class

Actionscript, Flash

I created a global utilities class as part of my gpAS3Library. This ActionScript class is essentially a Singleton class that can be used throughout my Flash application without being instantiated.

Continue reading

Checkout My New Site - T-shirts For Geeks

ActionScript: Extending Custom Classes

Actionscript, Flash

Extending a custom class with ActionScript is fairly straightforward. As part of my gpAS3Library, I have a button class (gpButton) that extends a shape class (gpShapes). Originally (in my AS2 version), I instantiated the shape class from within the button class and the shape class was always a separate entity. Now that I have created the button class by extending my shape class, interacting with and manipulating the button is much more tidy and easier to maintain.

Continue reading

Checkout My New Site - T-shirts For Geeks

Flash Document Class

Actionscript, Flash

Although, I have been creating Flash Classes for some time, I had never created a class for my main Flash document – it has always been just a bunch of ActionScript functions. This wasn’t the OO way, so I decided to use the Document Class for the current application that I am working on. I was easy to set up.

Continue reading

Checkout My New Site - T-shirts For Geeks

AS3: Access URLRequest Return Data

Actionscript, Flash

I’m creating a new portfolio site using Joomla and Flash. I’ve spent this past weekend creating AS3 class packages (and converting some of my AS2 classes to AS3).

I began loading thumbnails using AS3’s URLRequest and URLLoader in my main application file. I decided to create a package that would request/load the thumbnails, but I needed to return the data from the URLRequest to my main application. I was able to accomplish it using the dispatchEvent method.

Note: This functionality is the basis for my gpUrlLoader class (part of my gpAS3Library).

Continue reading

Checkout My New Site - T-shirts For Geeks

AS3: A URLLoader Class

Actionscript, Flash

I’m working on a Flash/AS3 application where I am loading various types of files (images, xml, etc). After writing the same code over and over again, I decided to create an AS3 class to use with my application. This class will load image, swf, text, xml, html, stylesheet, json, and sound files.

Continue reading

Checkout My New Site - T-shirts For Geeks

E4X: Test If Attribute Exists

Actionscript, Flash

Quick Tip:

When using E4X (AS3) to test whether an attribute exists, if you write:

?View Code ACTIONSCRIPT
var nX:Number = (shape@nY) ? shape@nY : 0;

an exception will be thrown. You should instead write:

?View Code ACTIONSCRIPT
var nX:Number = (shape.attribute('nY').toString()) ? shape@nY : 0;

I had hoped that Flash/Flex/AS3 had an hasAttribute method, but I guess this will do.

Checkout My New Site - T-shirts For Geeks

Flash AS3: Classpath of Package

Actionscript, Flash

I just received a Flash/AS3 error message:

1172: Definition could not be found

After many years of developing websites using Flash/AS2, I abandoned Flash web development for the new world of Ajax development (actually, Flash was the first Ajax/Web 2.0 framework).

I recently began to convert some of my AS2 class packages to AS3. I upgraded to Flash CS3 a couple of years ago, but because I have recently been doing a lot of Ajax development (primarily JQuery, YUI, and Dojo), I have only done minor Flash development, limited to Flash banners and other animation projects.

After a lot of frustration, I figured out why I was receiving errors when converting my flash AS2 classes to AS3 packages.

Continue reading

Checkout My New Site - T-shirts For Geeks

FlashScope – A Marketplace for Flash Components

Flash

I recently stumbled upon the site FlashScope.com. It is a website where flash developers can sell their flash files, components, etc. The site contains a lot of great components such as Image galleries, page templates, and games.

A few weeks ago, I started converting some of my Flash AS2 class packages to AS3. I am creating a few new Flash components/products and updating others that I created a few years ago. One of the Flash products that I am creating, I want to distribute a free version and a version that I can get paid for.

I don’t want to take the time to setup an e-commerce site (and promote it) just to sell a few inexpensive products, so I searched for an existing site that marketed Flash products. Flashscope.com seems to be the perfect site.

One other aspect of Flashscope.com that I like is that most of the products on the site are not expensive. While perusing the site, I don’t think that I saw a product that was over $30 (the average cost is probably $10). So, in the event that I don’t want to take the time to create a particular Flash product, Flashscope seems to have enough of a variety of products that I don’t have to reinvent the wheel – and I won’t have to cut deeply into my profits for a project.

Flashscope.com also has a free flash gallery that you can download. You can demo the gallery here. I think that I will be visiting the site quite often in the future.

Checkout My New Site - T-shirts For Geeks