Thursday, June 17, 2010

Using FLASH BUILDER 4 Debugger to Debug Flash Professional Projects

In my previous two posts (Create Flash Professional Project in Builder- Part 1 and Part 2) I talked about how to create a Flash Professional Project in Adobe Flash Builder 4, which opened the door for Adobe Flash Professional CS5 to use the Adobe Flash Builder 4 debugger and profiler.
Once a user create a Flash Professional Project in Flash Builder a debug SWF will be generated by Flash Professional CS5 in the bin-debug folder of the project location. This SWF will get updated every time actionscript code in the project changes and is saved in Flash Builder. If you need to rebuild after tweaking assets in Flash Professional, you would need to trigger the debug SWF generation manually in Flash Builder just by modifying an actionscript file in the Flash Professional Project in Flash Builder, then saving.
1. Adobe Flash Builder 4 debugger can only debug external actionscript classes. NO debugging for frame script.
2. When creating your Flash Professional Project, a default application class gets created automatically that has the same name as the project name. If you delete this file, the debugger will not work since it’s looking for an application file to start the debugging process.
In the below tutorial, I am going to demonstrate how to debug a Fla file that has a document class using Flash Builder 4 debugger.
1. Launch Adobe Flash Professional CS5.
2. File > New (ActionScript 3.0) Fla file.
3. File > Save the Fla file inside a folder on your machine. In my case, I am going to save it as (FBDebugger.Fla).
4. Window > Properties to open the Properties panel if it is not already.
5. Under Publish category in the PI. Add document class name. In my case, I am going to call it “DocClass” as follows :

6. Click on “Edit class definition” button .

7. Select Flash Builder when prompted with the following dialog :

8. Click OK which should launch Flash Builder if it is not launched already.
9. In Flash Builder, click “Finish” when prompted with the following dialog :

10. Since the document class did not exist, Flash Builder will prompt you to create one as follows :

11. Click “Finish” button.
12. Now let’s look at the Flash Professional Project structure that got created.
a. Project Name: The project name is always the same as the Fla file name.
b. Default Application File: This file is not used by the Flash Professional Project at all, BUT it is very important to have for the Flash Builder debugger to work. PLEASE DON’T DELETE THIS FILE SO THE DEBUGGER/PROFILER WORKS. In our case the default application file for the project is which is again not being used at all, but it is since Flash Builder requires that file to exist.
c. FBDebugger.swf (Debug swf) and FBDebugger.html inside the bin-debug folder. This swf is going to be used by the Flash Builder debugger to debug your project.
d. Reference Libraries: This has all the links to your libraries and classes.

13. Open in Flash Builder and add a break point for the document class constructor as follows :

14. Run > Debug FBDebugger as follows:

15. Click Yes when prompted with the following dialog :

16. Flash Builder Debugger session should get started as follows :

 In future posts I am going to demonstrate how to use Flash Builder 4 profiler for Flash Professional Project.

Tuesday, June 8, 2010

Create a Flash Professional Project in Flash Builder - Part 2

In my previous post "Create a Flash Professional Project In Flash Builder Part 1" I talked about creating a Flash Professional Project starting from Flash Builder 4. In this post I am going to cover creating Flash Professional Project starting from Flash Professional CS5. Let me first go over the new "ActionScript 3.0 Class" and  "ActionScript 3.0 Interface" templates that got added to Adobe Flash Professional CS5.Do the following to create a new ActionScript 3.0 Class template:
  1. Launch Adobe Flash CS5.
  2. File > New and select "ActionScript 3.0 Class item as follows :

  3. Click OK.
  4. Since I have Adobe Flash Builder 4.0 installed on my machine, I got promoted with the following dialog that ask me to choose which product (Flash Professional or Flash Builder) to use to create my class.

  1. Enter a class name and select Flash Professional to create my class.
  2. Click OK.
  3. As you see below,a new ActionScript file gets created with a bare bone class code. 
  4. File > Save. Notice that the save dialog was automatically populated with the name of the class, in our case it is "MyClass" And notice it is going to automatically save it next to the Fla file by default unless user choose a different location.

Enough Talking about the class template and let's jump into creating a Flash Professional Project from Flash. Entry points to create FPP(Flash Professional Project) are :
  1.  Document Class edit class definition button : 
  2. Symbol (Movie Clip, Button, Bitmap, Font, Sound) class.
Let's create a Flash Professional Project using the document class "Edit class definition" button :

  • Launch Adobe Flash Professional CS5.
  • File > New and select "ActionScript 3.0" Fla file.
  • Click OK.
  • File > Save and save the Fla file inside a folder on your desktop.
  • Window > Properties to show the PI if it is not already there.
  • Enter a class name in the class name text field in the PI. Let's assume you enter "MyClass" as a document class.
  • Click on "Edit class definition". The first time you click on the document class "Edit class definition", you should get the following dialog :

  • Check on "Don't show again." and click OK.
  • Click on "Edit class definition" button again. You should get promoted with the following dialog :

  • Select "Flash Builder" and click OK.
  • Flash Builder is going to get launched if it is not already and you should get promoted with the Project creation dialog as follows :

Notice the following : 
  1. Target file is the Fla file where you triggered the project creation from.
  2. Default location is where your project is going to get created,Which is by default is the Flash Builder workspace. You can always change the location and point to a different location.
  • Click Finish.
  • Flash Builder is going to prompt you with a dialog to create your document class since it does not exist yet as follows :

  • Click Finish.
Results : 
  1. Flash Professional Project named after the Fla file name.
  2. Document Class "".
  3. Flash Professional Test Movie, Debug, Publish icons gets enabled.
  4. ActionScript class file named after the Fla file name. Flash Professional Project does not use this ActionScript file at all. It is just a Flash Builder project dependency and it has to be created.
See the below screenshot :
From here you can code in Flash Builder all you want and utilize all the good code editor features and Test Movie, Debug Or publish from within Flash Builder.

Thursday, June 3, 2010

Adobe Flash Pro CS5 Update 11.0.1 is Live


This update includes AIR 2.0 support in Flash Pro, Packager for iPhone enhancements, and other bug fixes. To run the updater do the following :

  1. Launch Adobe Flash Pro CS5.
  2. Help > Updates...
  3. Quit Adobe Flash Pro CS5
  4. Click UPDATE.
  5. Quit when the updater is finished and launch Adobe Flash Pro CS5.
To confirm the result :
  1. File > New.
  2. Then select "IPhone OS".
  3. Click OK.
  4. From the Properties panel click on the iPhone OS Settings Edit button.
  5. Click on "Icons" tab and you should see 2 new icons for iPad

Click here Adobe Flash Pro CS5 Update 11.0.1 to learn more.

Tuesday, June 1, 2010

Flash Professional Does Not Show Code Hints

Code hints sometimes does not show or work correctly due to cache corruption. To solve this issue you only need to delete your user config folder and that should do it for you.
Please make sure to quit Flash Professional before deleting your user config folder.

Mac :
Macintosh HD/Users//Library/Application Support/Adobe/Flash CS5/

Windows XP:

boot drive\Documents and Settings\\Local Settings\Application Data\Adobe\Flash CS5\

Windows Vista:

boot drive\Users\\Local Settings\Application Data\Adobe\Flash CS5\

Windows 7 :
boot drive\Users\\AppData\Local\Adobe\Flash CS5

The other issue is that when you don't get code hints for controls. for example, no code hints when you do the following


and you are expecting fl.controls.

To solve this issue drag a component to your library (checkbox,DataGrid,etc..). and try again.


Flash Builder Data Centric - Flash Builder - PHP

I have been using the new Data Centric feature in Flash Builder 4 For the past 2 weeks or so and it was an awesome experience from beginning to end until I hit an error where I got stuck for almost a day or so.I Could not solve the problem on my own so I asked around and I got the answer from the Flash Builder team. My project was Flash builder,PHP and mysql database.

Problem Description : Every time I try to delete a record, I get the following error :

ArgumentError: Attempt to use managed delete method with an item that is not managed on this client.

Root cause of the problem : I had enabled Data management for an entity and delete method is part entity’s data service operations

Solution :
If data management is enabled, we can only modify data that is managed/returned by the server. So you can only delete a record if it is returned by the server.

Depending on your application’s logic, you may either want to remove delete operation from Data Management or delete the record after getting a record from the server.
To remove delete operation from entity’s managed operations, Context click on the entity->Enable Data Management ->Click Next-> Set the delete item operation to None.