August 25, 2008Making Anonymous Functions and Closures Work in ActionScript 2.0

One of the most powerful idioms available in JavaScript is the anonymous function closure: e.g. (function(){})();. If you are unfamiliar with this, it simply creates an anonymous scope bubble that can be used to prevent automatic global variables, or trick JavaScript into allowing private variables. Unfortunately, this idiom isnt available in ActionScript 2.0. It simply doesnt work. (As of ActionScript 3.0, it works perfectly.)

This means that, on the surface, the only way to prevent time line variables from being constantly created is an init function of sorts. (ActionScript 2.0 has a pseudo global object which is the main time line of a movie level, and a totally global object named _global.) This also means that private variables are restricted to the creation of object classes. I personally get annoyed at times with classes in ActionScript. One of the things that has always bugged me with ActionScript 2.0 and the introduction of classes is that they are hard to make portable. (I work on no less than 3 computers in a single week, and 4-5 when on business trips, so portability is paramount to my work.) Rather than being able to simply include the classes in the same folder as the flash working file (*.fla), you must specify where on the computer the includes are. This is just annoying if you work on the file on several different computers. There are a couple of ways to avoid naming the class include folder on each computer, but they are as much of a pain as the default method. Fortunately, there is a solution.

Read Full Article...

AddThis Social Bookmark Button Posted by Greg Ferrell at 09:35 PM. Filed under: Flash-ActionScript • (0) CommentsPermalink
January 09, 2008Parsing a nested or name spaced object from a string in ECMAScript

Often times when I am making dynamic scripts in Flash or JavaScript, I want to call an object method using a string. It may be a situation where I am stuck using fscommand (due to a customer request of a Flash version <8) or just writing script with script.

The function is executed somewhat simply by splitting the string at the dots and adding them as subscripts to one another in order. However, there are some other pieces to it that make it a little more friendly to mistakes and general usage.

Read Full Article...

AddThis Social Bookmark Button Posted by Greg Ferrell at 09:37 PM. Filed under: JavaScript • (0) CommentsPermalink
August 22, 2007Create Right Click Menus to Test AIR Files (Win/Mac)

At the beginning of this year, when I first heard about A.I.R. I was excited to learn more about it and see what I could do with it. What really jumpstarted my interest was a trip to Cincinnati, OH to the Adobe onAIR Bus Tour. At this point I am full steam excited about working with AIR.

I work on a Windows machine at work and Mac at home, so I am also excited to see cross platform development. One thing that is a little wonky about AIR is the way that you test your applications. Since AIR is built with an SDK instead of a builder application, such as Flash, you have you use the terminal to launch the SDK. So I came up with methods for OS X and Windows XP to use right-click contextual menus to test AIR applications. I will first note that you can use Aptana, Flex 3, Flash CS3, and Dreamweaver CS3 to test your AIR apps, but i thought i would make something for the hardcore coders. Though, I personally use all the aforementioned for AIR.

Read Full Article...

AddThis Social Bookmark Button Posted by Greg Ferrell at 01:18 AM. Filed under: AIR • (1) CommentsPermalink
June 19, 2007Expression engine 1.6 Preview and Rick Ellis Birthday Contest

So Expression Engine is previewing version 1.6 (filled with LOADS of new features) and it is also EE CEO Rick Ellis' Birthday. To celebrate this and some new software, they are having a photoshop contest that ends noon Tuesday June 19th, 2007. Check out the forums here for the other submissions. Here is the original blog post.

Without further adieu here are my entries.

Read Full Article...

AddThis Social Bookmark Button Posted by Greg Ferrell at 12:14 AM. Filed under: ExpressionEngine • (4) CommentsPermalink
May 23, 2007Import classes and Multiple ActionScript layers in Flash

At work I am making a new Flash interface for a project, and my goal this time around was to make as many global functions out of repetitive ones as possible so we could save development time.

As I began writing and testing Prototype class extensions and global functions, I noticed something I had not run into before with flash. If Import classes on one ActionScript layer, and call it on another Actions layer, or even the next frame, it produces an ActionScript error.

Read Full Article...

AddThis Social Bookmark Button Posted by Greg Ferrell at 10:11 PM. Filed under: Flash-ActionScript • (6) CommentsPermalink
May 20, 2007Dreamweaver Mass Find Replace Extension

At work I work with a lot of local files, and repetitive file groups. Meaning, I might have 30 folders all with the same CSS file or JavaScript file. The trouble I run into with using a lot of the same files is changing them, then having to copy/paste the file a gillion times. It gets really old. (To answer your immediate question as to why I don't just use one file outside of all the folders; I have to send each folder as a separate package to the client because the server they go on handles them as single entities. This however is beside the point of today's post, because you can use this in many situations.)

I work on a corporate network, so i can only install approved programs on my work computer. This keeps me from using my preferred win32 text editor. However, since I work with Flash a lot, I also have DreamWeaver, which is an acceptable text editor in a pinch (as long as you never EVER use the WYSIWYG window).

Read Full Article...

AddThis Social Bookmark Button Posted by Greg Ferrell at 11:46 PM. Filed under: Extensions • (0) CommentsPermalink

Page 1 of 3 pages  1 2 3 >