Mobile development with FDT5 – a disastrous start

March 5th, 2012 by Slav

Don’t get me wrong. I LOVE FDT 5. I think it’s the best AS3 development IDE period. (The second best being intelijIDEA, if you must know.)

Especially with the new refactoring enhancements, improved mobile workflow, haxe support, build in Joa’s apparat / stripper / reducer abc optimisation tools and my two belowed magic shortcuts ctrl+1 and ctrl+shift+o that fix just everything you could wish for in the code. Having freshly upgraded from the version 4 Max to FDT 5 Max I was excited to try the new Air 3.2 gpu accelerated molehill capbilities on the iOS and android devices , perhaps revisit my Augmented Reality Demo so I can compare the performance now.

I have installed the latest official stable SDK from Adobe (4.6.0) and merged it with latest AIR 3.2 SDK from labs.

Made the simple hello world project, got all the appropriate certificates and provisioning profiles from our Apple Dev center, all the icons sizes, changed the app xml descriptor to say air 3.2 in the namespace, and hit the run button.

Instead of nicely compiled swf/ipa file I got this error message : An internal error occurred during “Compile”

Now, if this was an actionscript error, you could follow it up to stack, see where it originated, what caused it and hopefully know how to fix it. Unfortunately this is INTERNAL error of FDT threw in Java, so all I could try was to blindly try to change some settings, tweak some launch parameters. To no avail. Luckily after some time spent googling I was able to find this issue being added to FDT’s bug tracker. It was caused by using the SDK 4.6.0 ! And solution ? You can still use the latest sdk, just have to go to the SDK xml descriptor file and manually rename it’s version tag to 4.5.0.

Once I found the ‘solution’ for the SDK problem, I thought I was on my merry way to the land of mobile development. Unfortunately, that wasn’t the case.

Although swf now compiled fine, instead of getting ipa file, I got message : application descriptor not found

Although there clearly WAS an application descriptor file! To cut the long story short, there was again an entry for this in the bug tracker.

The issue is missing stringAttribute key=”ADL_DESCRIPTOR_FILE in the launch file. Once I added line

<stringAttribute key=”ADL_DESCRIPTOR_FILE” value=”bin/Air32Demo-app.xml”/>

to my .settings/launch/Air32Demo.launch file the ipa file has compiled correctly.

So at the end it all ended well. Right ?

Here’s my problem though..

Both of these problems were marked as “Solved” in the bugtracker. To me they are not solutions. These are “hacks” in the best case.

They’re both completely non transparent bugs, without any intuitive solutions. I think that for a $600 software, these ARE showstopper bugs, and should be dealt with immediately by releasing correction patch!

Posted in AIR, AS3, FDT | 7 Comments »

HTML 5 Particle Demo

September 16th, 2011 by Slav

This is my first HTML 5 demo

It was build using Canvas so should work on most of modern browsers that support HTML5.

Just a simple particle wall, with randomly coloured particles of red-ish hue, reacting to mouse movement (or ‘wind effect’ if you will) also if you press and hold the mouse, they will change in intensity.

I’ve started building this demo as a part of the “playtime” during the HTML 5 workshop called “Intro to creative Javascript and HTML 5 Canvas” with Seb Lee-Delisle at FOTB conference in Brighton, finished it today, (added a background and a dynamic resizing based on the window dimensions).

The positive thing about working with HTML 5 is that it made me very thankful for Flash plugin. No hacking around for unsuported features, no shims, no version degradation fallbacks… Just works in every browser. Haven’t really appreciated this until I’ve experienced html 5. Another thing that I become to appreciate is ActionScript as a language. OOP features that creates supports for encapsulation such as strong typing, private / protected variables, supports for real classes.

It felt like traveling back in time , to a time of flash plugin version 5/6 and AS2, when its scripting capabilities were quite limited, and flash multimedia / display capabilities were quite crude, compared to it’s current capabilities.
Fortunately , there seem to be a solution! It’s strongly typed modern language / platform called haXe (similar to C# or Java) which can output to several target platforms / languages, one of them being JavaScript. Good news is that my programing IDE of choice (FDT) will support this in the next version which is comming very soon!

Posted in FDT, html5, particles, Personal | 39 Comments »

How to get FDT to ignore some “erroneous” code

December 19th, 2009 by Slav

Have been using FDT for about 3 and a half years now, on many occasions I came across a code that , although perfectly compilable (both by mxmlc and flash IDE), FDT thought it contained errors.

For example when code contained some “clever” trinary operator arguments, or a javascript code segments wrapped in CDATA …

Anyway, I came across a simple way to make FDT to ignore such code.

If you place the problematic code inside a /*FDT_IGNORE*/ …. /*FDT_IGNORE*/ comments, FDT will not parse such code and therefore will not mark it as code containing syntactic error. Goodbye red marks !

However .. on the other side, if such code contains a functions or variables that other classes refer to, FDT will not be able to find those references in the “ignored” sections.

So use it with caution !

Posted in AS3, FDT, flash | 3 Comments »

AttachMovie in AS3 ? Now possible! (also attachBitmapData ;)

November 2nd, 2009 by Slav

I code in AS3 for quite a while now, and don’t get me wrong, I do love it and I NEVER want to go back to as2.

However; there are some things I wish remained in AS3 that were possible to do in AS2.

Things like “eval” and “attachMovie” comes to mind…

Why attachMovie ? Isn’t it perfectly possible to do addChild(new WhatewerClass()) ?

Yes and no. The problem is if you don’t develop in Flash IDE, but in more sophisticated code editors like FDT, FlashDevelop or Flex.

Let’s say you have a graphical asset sitting in your library, it needs no interactivity so you don’t create any class for it. It simply extends MovieClip and has a linkage name “Asset1” assign to it.

Now the moment , in your code you decide to attach it to your display container via addChild(new Asset1())none of the code editors I mentioned above will know about Asset1 as that Asset1 is a class created by flash IDE only when the fla is being compiled and therefore is only available during runtime. So they will mark it as erroneous class reference. Of course , swf will compile just fine, but that’s not the point :) You don’t want to have your project covered in errors of some of which are not really error and need to remember which ones are not real.. !

There are several solutions to this of course.

One I used, is to compile swc from the fla, so the every linked library assets are available to FDT/flash develop/flex for reference. The trouble with this solution is you have to keep the swc file updated which isn’t always straightforward.. For example flex sometimes doesn’t pick up that swc have been changed, you have to delete swc and then re-publish it to force it to recognise change. Similar situation happens with FDT sometimes. As well as you can into a situation where you get into a sort of a recursive error cycle , where swf doesn’t compile correctly because compiling that swf requires some assets from swc that aren’t there yet because project’s swc doesn’t have that assets yet because it can’t be compiled before the project doesn’t have those errors..  

The solution I devised instead is much simpler and mimic the old as2 “attachMovie” functionality.

Taking advantage of built in “getDefinitionByName” command from flash.utils package we can turn the asset into a class by giving it it’s linkage ID . As that class is compiled into swf it will be available during runtime – so that will work fine.

During authoring time it won’t flag up as error as well as it’s typed correctly to MovieClip (so sprite will work as well).

So I wrote a wrapper utility class that has 2 functions :

attachMovie - expect a linkage name and returns a MovieClip instance
attachBitmapData - expect a linkage name and returns BitmapData

this is a code for attaching the library assets used in the demo bellow :

  private function attachAsset1():void
  {
   var asset1:Sprite = MCUtils.attachMovie("Asset1");
   asset1.x = 10;
   asset1.y = 8;
   this.addChild(asset1);
  }
 
  private function attachGirl():void
  {
   var girlBmp:BitmapData = MCUtils.attachBitmapData("Girl");
   var girlBitmap:Bitmap = new Bitmap(girlBmp);
   girlBitmap.x = 10;
   girlBitmap.y = 85;
   this.addChild(girlBitmap);
  }

Demo :

Attach Movie Zip

Posted in AS3, FDT, flash, Flex | 10 Comments »

Refactoring in FDT 1.5

October 29th, 2007 by Slav

While only FTD3 has fully featured refactoring a simple file operations based refactoring can be found in FTD 1.5 or perhaps even earlier versions.

For some reason it is unchecked by default, but can be found here :

Eclipse > Window > Preferences > FDT > Refactoring > Flash Explorer File Operations Read the rest of this entry »

Posted in FDT, flash | Comments Off on Refactoring in FDT 1.5

FDT Code Templates

April 8th, 2007 by Slav

This is my AS2 code template document for FDT. It contains code snippets, all can be activated by starting to type the name for the snippet and then pressing ctrl+Space.

For example to get all the code needed to implement EventDispatcher for your class you need to first import this template xml (in FDT 1.5 this is done via Window > Preferences > FDT > Editor > Templates > Import) then type “ed” and press Ctrl+Space. Read the rest of this entry »

Posted in AS2, FDT | 6 Comments »