Building BlackBerry PlayBook Apps with Flash Professional CS5

Posted on November 11, 2010 | 14 comments

Note: At some point BlackBerry will come out with support Flash Professional CS5. This article is meant to help those brave developers wanting to build playbook apps with Flash CS5 now.

First thing is to note that BlackBerry Tablet OS SDK for AIR comes from BlackBerry and has some API’s that do not work on AIR on the Desktop. If you end up using some of the PlayBook specific API’s you will have to test your applications on the simulator (or device) itself. I assume in this article that you have downloaded the BlackBerry Tablet OS SDK and have it installed on your computer. I will be using the default install path of c:\Program Files\Adobe\Adobe Flash Builder 4\sdks\blackberry-tablet-sdk-0.9.0 (Windows) and /Application/Adobe Flash Builder 4/sdks/blackberry-tablet-sdk-0.9.0 (Mac) in this article but just swap the path to the sdk with your local computer specific location.

Next step is to make sure you have the Flash Professional CS5 Extension for AIR 2.5 installed on your computer.

Create your new Flash CS5 project with the Adobe AIR settings, specifically targeting AIR 2.5.

In the properties panel click on the Edit button to the right of Adobe AIR 2.5 Settings. On the General tab, deselect all the Profiles expect the “Mobile Device” profile. On the same General tab also provide a value for the Copyright field. Now switch to the Signature tab and select the “Prepare an AIR Intermediate (AIRI) file that will be signed later” option. Click OK.

Now for the setting up the BlackBerry Tablet OS SDK libraries in the class path. In the properties panel click on the Edit button to the right of ActionScript Settings. With the Library path tab select remove the default $(AppConfig)/ActionScript 3.0/libs and textLayout.swc references. Then proceed to add 3 new swc paths.

Steps to add paths:
Click on Add New Path button.
Select the new path and click on Browse To Path.
Select the correct path and click Open.

Follow the previous steps for the following 3 paths:
/Applications/Adobe Flash Builder 4/sdks/blackberry-tablet-sdk-0.9.0/frameworks/libs/blackberry
/Applications/Adobe Flash Builder 4/sdks/blackberry-tablet-sdk-0.9.0/frameworks/libs/qnx-screen
/Applications/Adobe Flash Builder 4/sdks/blackberry-tablet-sdk-0.9.0/frameworks/libs/air

For the first two the default setting of Merged into code is what we want. But for the path to the frameworks/libs/air you need to expand the path icon and double click on the linking option and change it to External. You should end up with something like this:

Now you code up your application.

When you want to test it you first Publish (File -> Publish). Then on the command line navigate to your application’s publish location. Using BlackBerry Tablet OS SDK’s package and deploy scripts it will look something like this:

sh-3.2# /Applications/Adobe\ Flash\ Builder\ 4/sdks/blackberry-tablet-sdk-0.9.0/bin/blackberry-airpackager -package FlashCS5RIM.bar -installApp -launchApp FlashCS5RIM-app.xml FlashCS5RIM.swf -device 192.168.115.135

That’s all it takes to us Flash Professional CS5 to build PlayBook applications.

Some other posts that you might find helpful on the subject:
Using Flash Professional to create Apps for the BlackBerry Playbook
Adding the BlackBerry Playbook class files to Flash Pro

  • Ivan

    thanks for this tutorial Renaun… I’d like to just ask you some more infos about the next support for CS5 Pro… you said “at some point” that sounds a bit too generic, are we sure that will happen?
    You know, actually it’s great to dev for android, starting quickly from the template in the CS5 menu, and will be useful do to the same also for the PlayBook, isn’t it?

    • http://www.renaun.com Renaun Erickson

      That is definitely the direction and ideal workflow. Just hard to give time lines on future features.

  • http://gregoire.org/ Paul Gregoire

    Awesome! Thanks for leg-work on this Renaun :)
    Now is the time for me to work on my app, so that I can get my hands on one of those playbooks.

  • Pingback: Adding the BlackBerry Playbook class files to Flash Pro «

  • Pingback: Using Flash Professional to create Apps for the BlackBerry Playbook «

  • Pingback: Tweets that mention @renaun posts: Building BlackBerry PlayBook Apps with Flash Professional CS5 -- Topsy.com

  • http://www.twitter.com/derekobrien Derek O’Brien

    Thanks Renaun,

    Always nice to have the option to drop into Flash Pro for more visual work on some projects.

    BTW: Your live Blackberry presentation was great, loving the series even though a lot of it is still covering basics, it good to have a source to find out what actually works or not in the beta.

    • http://www.renaun.com Renaun Erickson

      Thanks, we will be cover more details as finish the last 3 webinars.

  • Pingback: Flash Tutorial: How to Build BlackBerry PlayBook Apps with Flash Professional CS5 | Adobe Flash Lite

  • Pascal

    For me, removing $(AppConfig)/ActionScript 3.0/libs from the paths, caused fl.transitions.TweenEvent not to be found, so I had to add it back in.

    Other than that, everything works fine.

    Note: on Windows, the packaging command would look like this:

    “C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\blackberry-tablet-sdk-0.9.0\bin\blackberry-airpackager.bat” -package MyApp.bar -installApp -launchApp MyApp-app.xml MyApp.swf AppIconsForPublish\MyApp_icon_16.png AppIconsForPublish\MyApp_icon_32.png AppIconsForPublish\MyApp_icon_48.png AppIconsForPublish\MyApp_icon_128.png -device 192.168.115.135

    Obviously, the playbook simulator needs to be in dev mode, and running in the background.

    • http://www.renaun.com Renaun Erickson

      Yes, you don’t have to remove the Flash AS3 lib if you are using those classes. Thanks for the windows example of the command line call

  • http://none Nick

    Hey Renaun, great post, also saw your webcasts on the blackberry site. I’ve build an air app and successfully ran it in the playbook simulator, however as soon as I try to use a playbook specific method, like showing an alert, I get errors like “VerifyError: Error #1079: Native methods are not allowed in loaded code.” and “ReferenceError: Error #1065: Variable Button is not defined.”….”ReferenceError: Error #1065: Variable Rebound_Banner is not defined.” Can you explain this? Thanks.

    • http://www.renaun.com Renaun Erickson

      Are you talking about seeing these errors in the PlayBook simulator or on the desktop? If its the simulator can you post some code that I try.

  • Nick

    Sorry it wasn’t letting me post for some reason, maybe there is a char limit or something, or it thinks what i’m posting is spam? Uploaded it here. http://cl.ly/3mqq

    • Nick

      Well I narrowed it down to using methods, like “alert.show()” in Flash Pro CS5 that are causing the error, I am able to use qnx ui elements like buttons, lists, scroll-panes without a problem. I understand using the method on the desktop wont work because its mean for the simulator/device, so how do I compile a swf without those errors to test those functions in the simulator?

  • Pingback: designupdate.com » Archive » Using BlackBerry PlayBook Class Files in Flash Professional

  • Pingback: designupdate.com » Archive » Use Flash CS5 to Publish Apps for the BlackBerry Playbook

  • http://www.26oclock.com Scott Rapson

    Hi Renaun,

    Thanks for the great guide, but it’s not working for me at all…

    I have been able to successfully build and run from flash builder burrito, but I can’t seem to be able to work with fb4 on anything larger than small tests…

    I have the eventual goal to port my flash iphone game to the playbook, it has no device specific code and would run well… if i could get it running

    I’ve been trying these and many other guides and tuts, and compiling from the command line can get my application installed, but when it looks like it finishes loading, it quits back to the main menu. Eg, my apps only ever show the loading screen and nothing more.

    Is this a known issue/ any ideas on how to fix or workaround it?

    Thanks in advance

    Scott

    • http://www.renaun.com Renaun Erickson

      Its very possible that its a bug with the current PlayBook SDK/Tablet OS. I don’t know of any fixes per say, can you narrow down which code is causing the error?

      • http://www.26oclock.com Scott Rapson

        I found the solution with the help of someone on the blackberry forum

        when compiling from the command line,

        -C LOCATION OF WORKING FOLDER needs to go after -launchApp

        So my command now reads as follows (using an example directory of /)

        /blackberry-airpackager -package app.bar -installApp -C / /something-app.xml /something.swf -device 0.0.0.0 -password ******

        This now works flawlessly for me, and since figuring out that, I am nearly at submission stage, i just need to solve a error with setting the app category to core.games