Identifying a debug or release SWF file at runtime

Identifying a debug or release SWF file at runtime example screenshot

It may be interesting to know at runtime whether an application is running from a debug or release SWF file. It allows the application to automatically execute debug specific code when the file is a debug SWF file and ignore this code when it is published as a release file.

I can't find any property that indicates whether an application is running from a debug or release SWF file in the Flash Player API reference while searching for it the other day. I hope this solution will help.

There's probably another way to achieve this, but I like this one because it can be written in one line only :

isDebug = new Error().getStackTrace().search(/:[0-9]+\]$/m) > -1;

Continue reading Identifying a debug or release SWF file at runtime

Flex modules with PureMVC pipes simple demo

Flex Modules and pipes demo screenshot

I worked on this project earlier this year, and I never found time to publish it. But since a month or two, I see that many questions arise on blogs and forums about PureMVC Pipes utility. I think that we need more examples of simple implementation of this utility. That is why I have added an example to the list for those whom wish to have a good start with this utility.

I've made this project for myself to understand the basic of Pipes. My needs were primarily to allow some modules to communicate among them, something that none of the examples I tested show.

You can view a live demo of the project, it has been published with ViewSource activated (on right-click menu).

Continue reading Flex modules with PureMVC pipes simple demo