Oct 16 2008

Using Flex Builder and Flash together…

Published by at 11:31 am under AS 3.0,Flex

Anyone who has written code using Flex Builder Plugin for Eclipse or just the Flex Builder by itself will agree with me completely that writing code using Flash IDE is not fun anymore. 

 

So when i had to write something in pure AS3 i decided to use FB for writing all the classes and Flash only for compiling the FLA. It is a bit of hassle but the efficient provided by FB far exceeds that hassle. Also in my case the project is integration of Flex and Flash, the pure AS3 swf is going to be loaded into a Flex project so i have to launch the project through FB. 

 

Some tips/suggestions from my experience of using this methodology,

  • For debugging the code in FB you have to select permit debugging check box in the Fla options.
I always run my projects in debug mode, it helps me to see what exceptions are being thrown if any and i love to use break points to debug the code. It has made my life lot easier. So for that flash only swf to connect to flex debugger we need to check this option otherwise it won’t work.
  • Some of the advantage of using FB is lost because the child instances of movieclips have to be declared as movieclips even if they have some class attached to it.
Let me explain this further, lets say in your AS3 document class you have a movieclip with instance name sample which has a class Sample.as attached to it. 

 

 

public var sample:Movieclip; this is how you would declare it or this is another way 

public var sample:Sample; Flash doesn’t like this declaration and it freaked out on me. 

you won’t get any compile errors but when you run the movie it won’t be as you expected. So because of this it has to be a movieclip and therefore the FB autocompletion is not much of use there.

  • Major annoyance is that every time you change the code and have to test out the swf, you have to compile it and then copy paste is into the bin-debug folder of your flex project. Cleaning the project takes long time.
Because of the earlier problem, FB doesn’t compile any classes which are assigned to the movieclips and there any errors are discovered only when you compile the fla. After compilation of the swf, you have to copy it in the bin-debug folder so that the most recent changes are reflected when you run the project.
So far it has been the above things, if i encounter something new then i will add to this post.

No responses yet

Trackback URI | Comments RSS

Leave a Reply