A user on our forums recently noticed an odd problem when running a Flex 4 application created in Amethyst. The Alert dialog didn’t seem to be behaving itself.
In short, when it appeared, its button showed this...
...whereas what he’d been expecting was this:
Where did the "OK" go to? And where did the "null" come from?
It was a mystery to us too. Amethyst certainly doesn’t mess around with Alert dialogs and the "null" doesn’t come from us. So how does one account for it?
We decided the only way to solve this problem was to track it down using Amethyst. We created a simple program with a button that fired up an Alert. Then we used the Amethyst ’Cylon’ debugger plus a few other handy tools such as its ability to Go to Definition, Find All References and debug into the depths of the Flex 4 SDK. And within a matter of a few minutes, we’d found the solution. It wasn’t what we’d expected.
Read the full story in a new development ’case study’ that we’ve just put online.
Our latest video tutorial explains how to create or import custom library (SWC) projects into your Flex applications. Once a library is imported, you have full access to its source code so you can find all references to identifiers, go to definition or debug from your application into the library code, setting breakpoints, drilling down into variables and so on.
The video also explains how to add the Flex SDK (3 or 4) to have full access to the code for IntelliSense and debugging. Most of the features shown in this video will work in the current edge release of Amethyst Professional. There are a few features, however, which will be added in our first release candidate, which will be available soon.
I’ve written an article for this month’s Flash & Flex Developers’ Magazine (July 2010) which may be of interest if you are migrating from Flex 3 to Flex 4 or using a mix of MX and Spark components in Flex 4 applications.
The problem is that Flex 4 redefines the parent/child relationships of components. In Flex 3, when you put an MX component inside an MX Container, the Container was the parent of the component and the component was a child of the Container.
In Flex 4, things don’t work that way. A Spark Container may have several levels of objects intervening between it and any controls which it contains. Moreover, its contents are not (strictly speaking) its children but its elements.
To manipulate the components inside Spark containers you need to use a different set of methods than when manipulating components inside MX containers. Things get even more complicated if your applications contain a mix of both Spark and MX controls. If you use the wrong methods or try to access the incorrect parent, your program may not work as intended. This is a problem we’ve had to grapple with ourselves in order to allow the Amethyst Designer (our drag-and-drop Flex design environment) to work with both MX and Spark controls. In this article (the first of two) I explain some simple techniques that can help you to avoid some knotty problems.
Flash & Flex Developers’ Magazine is a free PDF magazine which can be downloaded here: http://ffdmag.com/magazine/1257-protecting-licensing-and-selling-adobe-flex-air-apps. If you are a serious Flash or Flex developer you should bookmark the site and download every issue as it is an invaluable source of information on a broad variety of development topics.
This video explains how to share a Flash IDE (CS3/4/5) project with Amethyst so that one or more developers can use both IDEs on the same codebase...
Amethyst Professional can convert Flash IDE or Flex projects ’in place’ to share them with other IDEs (such as Flash Builder, Flash CS4 etc.). If, on the other hand, you want to import Flash Movies created in the Flash IDE for use in a separate Flash or Flex project in Amethyst, see this tutorial.
Just a brief overview of a few of the core features of Amethyst Professional...
New debugging tutorial...
This covers the basics of debugging ActionScript programs (Flash/Flex/AIR) using the Amethyst ’Cylon’ debugger. We’ll post another tutorial on advanced debugging features later. For more tutorials, see the Amethyst Tutorial Index.
I’ve just been converting some old Flex 3 projects to run with the Flex 4 SDK.
Mostly this is pretty simple to do. I use the Amethyst Conversion and Importer Wizard, select ‘Convert project in original location’, and, in the configuration page, select the Flex 4 option. The Wizard creates a new project from all the original source files and it adds the appropriate Flex 4 libraries to the ‘References’ node of the Solution Explorer.
Flex 4 has its own ‘Spark’ controls which, in many cases, are alternatives to the MX controls of Flex 3 - but you are not obliged to use these. You may even continue to use an mx:Application as the main container of your user interface defined in MXML (instead of Spark’s s:Application) and the program will still compile and run.
But there are exceptions to that rule. I found that when certain MX-specific attributes are included in the MXML tags, the compiler complains. One of my converted Flex 3 applications, for example, has styles such as backgroundGradientColors and dropShadowEnabled set on the Application and components. When I tried to compile this, the following messages appeared in the Amethyst Error List and the compiler refused to build my project.
I could, of course, decide to rewrite the use interface using all Spark components. But that isn’t really necessary. The simple solution is to compile using Flex 3 Compatibility mode. To do this, go to the Project/Properties/Compiler page and check off this item...
Rebuild and run. Now, even though I’ve built using the Flex 4 SDK, my application looks and works like a Flex 3 program and my Flex 3 styles no longer cause any problem.
Amethyst Professional provides a similar range of refactorings to those provided as standard for C#.
Extract a block of code into a new method
Encapsulate a field (auto-generate getters/setters)
Extract an interface from a class
Promote a local variable to a parameter
Move a class into a new package
Refactoring takes care of rewriting code that calls the refactored elements - so, for example, if you move a class to a new package, the required directories on disk be automatically created and code that refers to the class will be rewritten to refer to the new package.
I’ve just uploaded a video to show the main refactoring options. View it below or (in higher definition) view it on YouTube.
We now have a number of video tutorials to Amethyst, ActionScript and Ruby. For the full list, go to The SapphireSteel Software Video Tutorial Index.
We’ve just updated the Amethyst Feature List to show a comparative table of features in both the Professional and the Personal editions of Amethyst.
The Personal Edition will be released as a free product. It will have the essential editing, project management and debugging features including extensive code coloring, IntelliSense, breakpoints and drill-down debugging.
The Professional Edition will also have code refactoring, customizable code formatting, a drag and drop visual Designer for Flex, the ability to share code with the Flash IDE for editing and debugging, enhanced IntelliSense and the full features of the Amethyst ‘Cylon’ debugger including conditional breakpoints, break-on-hitcount and the ability to debug multiple SWFs simultaneously.
For more detailed information see the Amethyst feature List.
If you are interested in Flash, Flex or ActionScript development, you really should read the Flash & Flex Developer’s (FFD) Magazine. This is a professional-quality monthly which is available as a free PDF download.
This month’s issue (June 2010) includes articles on Flash Player 10.1 for Android, using the Zend framework with Flash Builder plus a range of technical articles and product reviews. Oh, and there is also an article by me giving the lowdown on Amethyst, our Flash Platform IDE.
Download a copy from: http://ffdmag.com
More Blog Posts...... | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 110 | 120 |...