![]() | Here we go again with another extension. This is a simple calculator that can come in handy when you’re trying to figure out positions and values and don’t want to leave the Flash IDE. I downloaded the calculator SWF fromActionscript.org and did a re-skinning job on it before packaging it as an extension. The original was coded in AS 1 by H.G. Arunkumar. I considered porting it to AS 3 but half way through it I realized that it would be a complete waste of my time. Flash 5 SWF files still run great in Flash 9. Follow the steps below to try it out:
Let me know if you find any bugs with it. You can also leave a comment here if you think you have an idea how to make it better. Thanks, |
The Flash Learn Blog
Friday, February 4, 2011
New Calculator Extension for Flash CS3
Flash is Not a Stepping Stone!
I’ve wanted to write this post for a while now, and since my meeting just got rescheduled, now is as good a time as any. The main gist of it is to try to dispel the myth that people who use the timeline in Flash and even use it to code are somehow not as advanced as people using Flex or other RIA technologies. Many Flash designers are buying into this and are starting to feel that they are lacking an important skill set in order to further their careers. This is true in some circumstances, but definitely not all. Let’s take a look at some of the reasons for this confusion.

RIA Terminology Misuse
Guess what? The vast majority of sites that show up on the FWA are not RIAs. So if you are targeting your career towards doing those kinds of experiences, don’t get caught up in the RIA hype. Rich Internet Applications, in my humble opinion, are things that look and behave more like desktop applications. This means that they make heavy use of component frameworks like Flex and they do so to the great benefit of their end users. Applications like Buzzword and Phoenix are pushing the envelope of what was traditionally thought possible in the browser, as well as on the desktop thanks to AIR. But these are applications and they should not be confused with the type of content that is put out by agencies like Big Spaceship and Red Interactive, where graphics, video, and animation take center stage. These are two different worlds, although there is of course some overlap.
Isn’t Everyone Using Flex?
Well that is kind of a loaded question. There is a big difference between using Flex Builder and using the Flex framework. Many top interactive agencies are using Flex Builder as their coding environment for Flash, but this should not be confused as them using the Flex framework. A lot of this unfortunately is the result of the lackluster coding environment inside of Flash, but I think I’ve talked that one to death. I also need to mention the other leading tools for AS3 development, which are currently FlashDevelop and FDT. Just so were clear here, the Flex framework is awesome for building RIAs, but it is not what you would want to use when building lightweight, animation and media-heavy Flash experiences. So don’t assume that learning Flex is something you will have to do in order to reach the top of your game.
Timeline Scripting is Not for Amateurs
This is one that is particularly troubling to me. While large OOP Flash projects that only use Flash for the library are impressive and are the right thing to do in many situations, it does not mean that if you code on the timeline you are in some way inferior. For high-end Flash experiences it is often absolutely necessary to use the timeline for some things. One thing that comes to mind is for animated buttons. While technically everything can be done in code, you would be a damn fool to write a mountain of code to do something that could be easily done on the timeline. Personally I like to have a library containing MovieClips that may or not have internal timeline animations and either attach them using ActionScript or lay them out on the main timeline. On the other hand, I am a big proponent of organizing your ActionScript on it’s own layer and in not ever attaching code directly to symbols. Luckily with AS3 this isn’t an issue anymore.
Many Things are Over-Architected
Over the years I’ve had the opportunity to look at quite a bit of ActionScript code from a wide variety of sources and I have seen quite a bit of this phenomenon. OOP has proven itself to be the best approach for serious software development but it is not always the smartest approach to every situation. Many developers love to be organized, sometimes to the point of being over-organized. In this fast, deadline-driven industry, it isn’t always possible to have every coding job be a masterpiece that utilizes the latest design patterns. Sometimes quick and nasty IDE coding is not only faster to write, but is also faster running and much smaller in file size. Definitely try to become the best programmer you can be, but don’t be ashamed of building something that runs great and makes your clients happy.
Ok now for some damage control. I love Flex and I think it is a great framework for building RIAs. OOP is a great skill to have and makes code organization and reuse possible. Thanks for listening
ActionScript 3 QuickTip #5: The Graphics API
In Flash 8 there were a bunch of properties and methods of the MovieClip class that allowed us to dynamically draw things at runtime. In ActionScript 3, we have these same capabilities along with some handy new ones. The drawCircle() and drawRoundRect() methods are two which will definitely save Flash devlopers quite a bit of time. The biggest difference in the AS 3 drawing API is that it is now its own class called Graphics and is attached to display objects such as MovieClip, Sprite, and Shape. You access the methods by writing something such as myClip.graphics.lineStyle(). The example below draws a line with a random color wherever your mouse moves. You can click the movie to clear the accumulated graphics. The AS 3 code is listed below that.
- clip.addEventListener(MouseEvent.MOUSE_MOVE, drawLine);
- clip.addEventListener(MouseEvent.CLICK, clearIt);
- function drawLine(args:MouseEvent)
- {
- clip.graphics.lineStyle(15, Math.random()*0xBBD9F7);
- clip.graphics.lineTo(args.localX, args.localY);
- }
- function clearIt(args:MouseEvent)
- {
- clip.graphics.clear();
- }
Thursday, February 3, 2011
Flash Inspiration Video!
I recently made a video that showcases some of the best places online to get inspired about using Flash. The video lasts about 2 and 1/2 minutes and features music by VAST.

Flash XML Security Bypass with PHP
For those of you who are trying to load an XML file from another domain into your Flash movie, I’m sure you’ve noticed the security restriction. Files can only be imported from the same domain that your SWF file is in. There is a way to put a special file on another domain but this isn’t practical if you want to load an RSS feed from Yahoo or something. Its doubtful that they will host your security file 

Below is a snippet of PHP code that you can use to retrieve an external XML file. Just make sure this PHP file is in the same domain as your SWF.
[php]< ?PHP
$line=file("http://rss.news.yahoo.com/rss/topstories");
foreach ($line as $line_num => $line) {
echo $line;
}
?>[/php]
Saturday, January 1, 2011
New Snippets Panel Extension for Flash CS3!
![]() | I just polished off my second panel extension for Flash CS3. Thissnippets panel allows you to store code snippets that can easily be copied to the clipboard for easy insertion into the Actions panel. There currently is no editor for the snippets so you are left to edit an XML file in the same folder as the panel. You can click the pencil icon to get the path to the XML file though. I have included some example snippets with the extension. Follow the steps below to try it out:
Let me know if you find any bugs with it. You can also leave a comment here if you think you have an idea how to make it better. Thanks, |
What is Happening to Flash?
The other day a blog post written by Corban Baxter got the attention of a few of us inside of Adobe. This post voiced concerns about the current and future direction of the Flash authoring tool. I think these concerns are valid and I think many in the Flash community share them. So this post is my attempt at explaining what is happening within Adobe, and how Flash fits into our future. The way I’ll do it is by answering some questions that I hear fairly frequently when I talk to Flash folks.
Is Adobe planning on phasing out the Flash authoring tool?
Absolutely not! The Flash authoring team is hard at work on Flash CS4 and they are adding some amazing new features that will make the Flash community very happy. Trust me on this, Flash is about to change for the better. All of this started with Flash and Adobe is acutely aware of this. Of course there will always be other tools that come along to meet the needs of our ever-expanding community, and often these will grab the headlines, but Flash will not ever take a backseat to any new tool that comes along.
With ActionScript 3, is Adobe trying to focus more on developers?
This is where it gets a bit tricky simply because the Flash community contains such a wide variety of people from different backgrounds and skills. This is what I love about our community. The term devigner has emerged to describe people who are skilled at both design and development and this is exactly the type of person that best flourishes inside of the Flash authoring tool.
The ActionScript language has had to mature in order to allow us to continually push the limits of what’s possible on the web. Learning the new language is not easy and a lot of times it can be somewhat more difficult to do certain things as compared to AS2. But the amazing capabilities and performance of AS3 makes learning the language well worth the effort.
As a side note, I have been trying to focus my tutorials on AS3 as of late to make up for the lack of sufficient training out there. Most Flash classes still teach AS2 so it can be hard to get started. With this being said, you can absolutely still create Flash movies using AS2 as you take the time to transition to the new language.
Will Flash CS4 be focused on designers or developers?
Releases of the Flash authoring tool have always been cyclical when it comes to the target audience. Flash MX 2004 was heavily focused developers with the release of AS2. Flash 8 was focused squarely at the designer crowd and gave us such gems as the bitmap API, runtime filter tools, and a great new video component and codec. Continuing the cycle, Flash CS3 was focused primarily on adding support for AS3 and all that it entails. With this being said, each release has included great features for both designers and developers, regardless of what its main focus was. The way I see it though, is that all these features are geared for devigners, as we work on both sides of the aisle.
Now back to the question. Flash CS4 is clearly aimed at the interactive designer crowd and will contain such things as a completely revamped timeline and a brand new animation engine. All I can say is that auto-keyframing is finally here! Adobe has demoed a lot the new features at conferences such as MAX and FITC so I won’t rehash everything here. But if you are a designer, Flash CS4 will blow your mind.
Will the code editor ever be any better inside of Flash?
All I can say is that if you are holding your breath on this one, please resume breathing normally, as I wouldn’t want you to hurt yourself. This is my biggest gripe with Flash and it has been for a long time. Unfortunately, overhauling the Flash code editor is just not on the roadmap right now. The reasons for this are many. Firstly, the general consensus is that hardcore programmers are using Flex, not Flash. You tell me, is that true? Making these kinds of changes to Flash are also not as easy as you may think. Before coming to Adobe I would say things like “why can’t they just put the Flex editor inside of Flash.” Ha ha, was I ignorant. Things don’t work like that in software development. I don’t want to paint too gloomy a picture here as the editor will get new features when possible, but for those hoping to have something on the level of what is inside of Flex, my response to you for the time being is that you’ll have to use Flex.
Why isn’t there better integration between Flash and Flex?
This is one area where we have really dropped the ball in the past. It often seems like two completely different companies create these tools. Here’s to hoping that things improve soon. Nuff said on this one.
Will there ever be a way for visual designers and video pros to make interactive Flash movies without having to be exposed to ActionScript?
All I can say on this front is that Adobe is very aware that this community exists and that they have been kind of left out of the action in the past. So, yes, there will be a way. Saying what it will be would get me fired so please just be patient on this one. Your day is coming I promise.
Ok that’s it for now. I’ve been writing this on a plane heading to DC and I need to go back to playing Bejeweled. Thanks to Corban for letting us know what’s up.
Subscribe to:
Posts (Atom)