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’ve been working on a Flex 2 component which exposes the Yahoo! Maps API similar to the official Flex 1.5 version. There seems to be a lot of interest in getting an official, updated version of the maps API and in the meantime several people have blogged about ways of communicating to a Flash 8 SWF which contains the Yahoo! Maps Flash component.

I played around with this a while back going with the ExternalInterface approach. I’ve since dumped that approach in favor of using LocalConnection. I’ve encapsulated all the communication into a Flex 2 component which you can just drop into your Flex application. I’m going to be finishing up a few things on it this weekend after which I’ll release the component, along with source. I’m posting a preview of it now to see how much interest there is in the project. The first release of the component will only expose the most common API elements and then I’ll plan out a roadmap for adding more of the Flex 1.5 API.

You can view the demo here:
http://timwalling.com/sandbox/flexmap/preview/

The code for the demo:

XML
<view:YahooMap id="map"
    width="500" height="400"
    source="flash/map.swf"
    mapViewType="{com.timwalling.maps.MapViews.MAP}"
    zoomLevel="6"
    latitude="37.77159"
    longitude="-122.451714"
    mapInitialize="onInit(event)"
/>

Since all of the communication is taken care of by the component, you should be able to use the component just like the Flex 1.5 version using all of the standard map events and map methods.

Update:
I’m open to project name ideas. For obvious reasons, I won’t be keeping the component name “YahooMap”.

Flex 2 Yahoo Maps updated

December 12th, 2006

I’ve updated my Yahoo Maps application to use the latest version of FlashInterface. Robert re-worked the API a bit so it’s even easier to use and requires less coding. I’ll try to post the source tonight. See my earlier post for more details on what this Flex 2 / Flash 8 Yahoo Maps application is all about.

One downfall to this approach of using Yahoo Maps in a Flex 2 app is the fact that you have to code a Flash 8 SWF which exposes all of the functionality of the Yahoo Maps component. Now that Robert has released SWFAdapter, I’d like to see if it’s possible to use the same SWF that the Yahoo Javascript-Flash API uses. After a little digging around in the javascript I noticed that a SWF is loaded and then talked to via a javascript API. By looking through all of the code I’m guessing one could use SWFAdapter to make all of the same calls on that SWF. I’m not sure if this goes against anything in the Yahoo Maps terms of use so I’ll have to read that over some more before I release anything for distribution.