Be careful what you loadmovie… 2

After being involved with AS3 and Flex for so long, I think I am now at a point where I have a really good understanding of the Flex framework. So when I was asked to build this online app, I immediately started it with Flex and before long had most of it working. However, the application was supposed to be a subcomponent of a larger AS2 project and was supposed to be loadmovie-ed. I didn’t realize till too late that AS2 swfs actually cannot loadmovie AS3 swfs (well Flex for sure, not sure about AS3 but doubt that too). This definitely left me feeling very ‘d-uh’. We ended up working around this by creating an AS3 base swf that loads the AS2 swf and then when the sub-app was supposed to be loaded, the AS2 swf told the base movie to do so via LocalConnection. This is definitely a hack but I couldn’t think of any other way to get this to work.

If anyone is aware of this or has successfully managed to load an as3 swf into an as2 swf via loadmovie, do drop me a comment. For others, be careful what you loadmovie ;) .

It aint about the tech… 1

I usually keep personal observations on my blog to a minimum, keeping it more about the code and apps. But off late I have been feeling this a lot and so I feel I must speak at least once if only for cathartic release ;) .

There has been a lot of new activity in the UI world: Apollo, Silverlight, JavaFX, WPF and now Ted Patrick’s sneak peeks on the new features of Flex 3, and a lot of people have very strong sentiments about it. However it seems like we have all set camps around technologies rather than what they mean for the end user.

Silverlight was the perfect example of course. While blogs on mxna screamed how it was utter crap, people I know who attended the Microsoft MIX conference proclaimed it to be the undoubted Flash killer. As a UI developer who moved from Java to Flash to Flex to now-eyeing-the-3D-capabilities-of-WPF, I couldnt care less about what I write my code in. If there is something in Silverlight that I cant do in Flash (and my target audience has the plugin), I will code in it.

But the Silverlight conversation is over so lets continue…

The latest thing is the Flex 3 sneak peeks. I have read quite a few blogs about the lack of any earth-shattering new component in the framework. I am not surprised. Now that I have been with Flex for about a year, I am truly loving it. I dont care about the List, Datagrid or the Tree component, heck I could them all easily in Flash. Flex gave me a framework to work within. When I work with another developer or look through a component’s source code, I KNOW what I am dealing with: I know the measure function is where the measurement is happening, and updateDisplaylist is where the component is drawing itself out, etc. Now its up to ME to code my cool app. I will write a component to suit my application’s need rather than look at the new component set and try to fit those into an application. Adobe cannot write a component set for every app out there. Flex 3 gives me exactly what I want: A better way to write code (Refactoting, Code assist, etc), a way to make sure I am not killing a user’s computer (with the profiler stuff) and a better way to deploy it (using the flash player’s caching mechanism): after that I almost want it to leave me alone and let me build my app to work the way I want it to.

I dont want to sound harsh. Heck I would love to have some cool components that I may use once in a while, but its not something I expect to get from the SDK. For that I look at the broader community out there.

Lets make cool things….

List paddingTop/paddingBottom controls the vertical distance between the itemRenderers ??? 0

Another one of the Flex gotchas…I spent way too much time on this only to have an adobe engineer himself answer this on the flexcoders mailing list:
I had created custom renderers for my list and it looked great. But there was a 2 pixel gap between the renderers that was driving me insane. After my own efforts went nowhere I asked the question on the flexcoders mailing list. The answer, use paddingTop and paddingBottom = 0 in your style. The Flex documentation on the 2 styles says “Number of pixels between the container’s {…} border and the {…} edge of its content area”. This is definitely not something I would read and use that property to manage my item renderers in a list. Ah well, now I know better :) .

This tip is going straight to flextips.corank.com, a site dedicated to these weird gotchas and helpful hints. Do check it out and post your own tips there.

New site for flex developers: Flextips 2

One thing that amazes me is that there isnt a site that aggregates tips on flex that developers find in the course of developing applications. With that in mind, I have just completed some work on my new site: flextips.corank.com. Running on the corank platform, the site essentially works like Digg (actually corank is a platform for creating Digg type sites). The idea is, if you find a good tip, link to it on flextips. I typically find a lot of value in people posting really simple tips that save me hours of investigative work.

Anyway so here is the model for the site:

If you find a cool tip on a website or post a cool tip on your blog, link to it on flextips.corank.com. Put it under one of the categories mentioned there (if anyone feels we need more categories, let me know). Tag it appropriately as well. For tags, use the name of the flex component or class this will affect.

When you come to flextips at other times (usually more than once a day ;) ), give various tips a thumbs up or down. That way, the more important tips start surfacing above the trivial ones.

Please leave me some feedback on the project.

Cheers.

Philadelphia Flash Users Group: Thanks for coming… 2

I just wanted to thank everyone who showed up for the Philadelphia Flash Platform Adobe User Group session this Thursday. It was a lot of fun for me and meeting so many Flash/Flex developers in the area was really cool. I was hoping to show a lot more code but the session seemed packed enough with just the overview of the Flex internals. CIM did record the whole session though and I’ll post a link to the video once we have it online. In the meanwhile, feel free to download the presentation here (pdf)

Special thanks to Rob for making this thing happen.

I am really excited about the new Flex User Group. I hope we can meet more often as a group. I am sure that we all have a truckload of questions about Flex and Apollo that we can help each other through.

Keep your eyes on CimLabs as we get ready to release Fan 4 beta and for more Flash and Flex goodness in the coming months.