A new version of FlashDevelop has been released and among the updates are some tweaks to the autocomplete feature. It’s worth pointing out that this 3.0.0 version of FlashDevelop is starting to include some integration with the Flex debugger (currently only trace statements are supported), something which I feel will really make the tool a viable alternative to Flex Builder. Java 1.6 is required for Actionscript 3 development so grab that as well if you want to test out all the features of the latest build.

FlashDevelop 3.0.0 Beta 4

Java 1.6 (Java 6)

If you try out FlashDevelop and like using it, don’t forget to support the project by donating!

Recently I wanted to find out how to compile SWC libraries which could be used in Flash CS3 since I knew it was possible to go the other way using the Flex Component Kit for Flash CS3. As of Flex 2.01, support was added so that Flash and Flex authored SWC’s were compatible (previously I believe the SWC format differed between them). The focus of the update however was on getting Flash authored components into Flex and only in passing was the reversed case mentioned as being supported.

I figured the best starting point would be a normal Flex library project in Flex Builder. After adding a class and compiling a SWC, I dropped it into the Components folder under Flash CS3 to see if it would show up. This folder is usually found here:

C:\Documents and Settings\{username}\Local Settings\Application Data\Adobe\Flash CS3\en\Configuration\Components\

This is the folder where MXP’s typically put component SWC’s so that they show up in the Components panel in the Flash IDE. Anyway, after dropping the SWC in and refreshing the Components palette I didn’t see anything new. So I was back to drawing board.

After re-reading the quick start guide regarding the deployment of custom Flex components I thought I’d try the recommendation given regarding the creation of a manifest.xml file. I had never done this before because it’s mentioned as an “optional” step and we’ve never done this for any of our libraries at work. Usually if my library project compiles a SWC, I’m happy. From the article:

Manifest files map a component namespace to class names. They define the package names that the components used before being compiled into a SWC file. They are not required when compiling SWC files, but they can help keep your source files organized.

Well it turns out that this was the missing piece. I created a manifest.xml file which listed my component and then updated the compiler settings to point at this file.

Flex compiler settings

manifest.xml

Notice the key part where a namespace is specified as well as the path to the manifest.

After dropping the newly built SWC into Flash’s Components folder, the new component showed up and I was able to drop it into my library!

This brings me to the point that I imagine one may be wondering, why would you even want to do this? Well in my case I was working on creating a MovieClip based component that was aware of some interfaces we use in our framework. This is similar in spirit to the UIMovieClip class that is included with the Flex Component Kit. I could probably create this component using Flash, then point the FLA to the library where our interfaces might live, but I wanted to see if I could do it from within Flex Builder. I think there are a few other reasons someone might want to do this:

  • developer prefers to work in Flex Builder (better code completion, familiar environment, etc
  • SWC creation could be part of an automated build process via ANT
  • easily create a SWC based on other Flex libraries

I think the last point might not apply because I’m pretty sure if you put Flex authored (2.01) SWC’s in the classpath for an FLA, it will be able to see them. I still think it’s nicer to use Flex Builder for this though.

There’s one caveat I should point out. I’ve only been able to create base classes or utility classes so far using this method. If you want to create a view component, let’s say a new video player component, there’s a trick that dates back a few versions of Flash where one has to put something in the first frame of the component MovieClip before exporting it as a SWC from within Flash. This still seems to be the case and if you try to create a component using the method above, add the SWC to the Components folder, then drag it onto the stage, nothing will show up. You will have added the component to the FLA’s library though and this is useful for getting classes into the FLA. Maybe there’s a way around this and I just haven’t explored enough.

Another thing to note. I’ve been told (courtesy of Peter Watson from Adobe) that if you’re using Flex 3, then you need to add the following compiler option in order to create a SWC that works with this method I’ve outlined above.

compute-digest=false

Apparently this prevents the compiler from creating a newer format SWC which is compatible with the new RSL caching mechanism. I had noticed that the SWC’s I created in Flex Builder 3 weren’t working in Flash CS3, so this should help fix that (haven’t tried it yet).

I know some more screenshots or a video would be useful in explaining this so feel free post comments and ask questions. I wanted to post something as soon as I could because I’ve seen this topic brought up a few times in the comments on other blogs. This use case of creating SWC’s which are used in Flash doesn’t seem to be highlighted anywhere in the documentation and I think it could be useful for certain projects.

A project I worked on in the fall went live not too long ago. I’ve been meaning to post something about it and I plan to follow this up with another post regarding my use of the CASA Framework within the project. Gravis Brand Timeline

Gravis Footwear went through a redesign of their site and I worked on a small timeline piece which was built in Actionscript 2. It was a fun, little project which gave me a chance to do some Flash/AS2 work which I’ve been doing a lot less of since joining Allurent and working on Flex full-time.

After working with Actionscript 3 and Flex 2 for about a year now, I have to say I found the CASA Framework for Actionscript 2 extremely helpful. I always find it interesting when you leave a technology for a while, then come back with a fresh point of view. At my current job I’ve had the opportunity to gain a lot of experience in the area of application design and implementation and bringing that knowledge back to something like Flash and the timeline forces me to revisit my old habits and techniques for building applications in Actionscript 2. I noticed this same thing when I started playing around with FlashLite and had to revisit the Flash 4/Actionscript 1 language. I found that I had a fresh perspective on how I might have done things back in the day versus how I ended up doing them now in the same language.

I’ll post a follow-up regarding the parts of the CASA Framework I used soon. If you missed the link above, here’s a link to the Gravis Footwear timeline.

http://gravisfootwear.com/community/brandhistory.aspx

I knew I ran the risk of releasing something that would be replaced soon enough. I think less than 24 hours might be a record though.

The Yahoo! team released a set of AS3 API Libraries and they addressed the need for a map solution with the Yahoo! Maps AS3 Communication Kit. One of my blog commentors pointed out that these AS3 libraries would be released today and I responded by my willingness to bet that they wouldn’t release an updated map component for Flex 2. Technically I think we both were right. The communication kit that was released follows the same basic approach of loading a Flash 8 SWF which contains the Yahoo! Flash map component, only it uses a nice ExternalInterface service, not to mention the API is much more complete than what I had whipped up so far.

The great thing about the libraries is that, at least for the moment, they’re distributed as source code. Personally I always like to get the source and its nice to see the trend of releasing source code continue with big companies like Yahoo!

FlexMap, it was fun while it lasted. Am I bummed? No! I’m happy that Yahoo! has released a sweet AS3 library and addressed the need for a Flex 2 map API. Yahoo! continues to provide the Flash community with tools to make interesting web applications.

I’m still happy I followed through with it for a few reasons:

1. You never know when the official solution for something will actually come out. You can either suck it up and just write it or just keep delaying until it finally comes out.

2. It was an interesting problem to address. I like hacking, so coming up with a solution that worked was rewarding.

3. I followed through with something, which isn’t something I’m always good at when it comes to personal projects (ie. projects that don’t pay the rent).

4. I setup a project site on code.google.com (which is a really great service) and actually “released” something which in my mind means packaging something up with some basic documentation and release notes. Usually I just slap my code up as is and say have fun.

I have some other ideas for things that I’d like to work on but maybe this time I’ll try to stick to something that’s a little more unique and has less risk of being defunct after a few hours.

I packaged up the first release of FlexMap over the weekend. The source code is being hosted by Google Code but I’ll maintain a page for the project here as well. As soon as Yahoo! releases an updated maps API, this will obviously become defunct, but I wanted to follow through with it anyway. It was an interesting challenge to create a Flex 2 component which exposed much of the same API as the Flex 1.5 version, while doing all of the communication via LocalConnection to a Flash 8 SWF.

I plan on adding some more features so I’ve dubbed this the 0.4 release (I’m guessing I’m about 40% done). Hopefully this is useful for anyone looking to quickly get started with the maps API in Flex 2.

Project home and documentation:
http://www.timwalling.com/flexmap/

Source code:
http://code.google.com/p/flexmap/

My sample application has been updated and the source code is available along with the component source. Some more things might need to be documented, especially my MapEvent addition but hopefully it’s apparent in the sample app.

FlexMap Example