Converting AS3 projects to Apollo

April 11th, 2007

Yesterday I received a comment from Ian Stokes. He was asking for the easiest way to convert an existing AS3 project into Apollo Application, this is indeed something a lot of people are missing in Apollo examples so I wrote this short step-by-step tutorial that should clear things out.

Using Flex Builder 2:

  • File > New > Apollo Project
  • Select “Basic”, click “Next”
  • Enter project name (and location if needed), click “Finish”
  • Using the navigator panel (Window > Project Navigator) delete the “[your_apollo_name].mxml” and “[your_apollo_name]-app.xml” file from the newly created Apollo project.
  • Using the navigator panel select the contents of an existing AS3 project and select copy from the right click menu, and paste them into Apollo project folder
  • Confirm any overwrites in the popup dialog.
  • Right click on the “[your_application_name].as” file that was pasted into Apollo project folder, and select “Set as Default Application”.
  • In the popup window – enter the requested meta information, and click “Finish”. A new file “[your_aplication_name]-app.xml” has been created.
  • Run the Apollo application

That’s it, hope it made things a bit more clear! And if you have any interesting questions, feel free to shoot them into the comments section anywhere in the site.

Digg this if you found it useful.

17 Responses to “Converting AS3 projects to Apollo”

  1. AS3 to Apollo at Mars Spider Says:

    [...] Read More Support PSP Flash Development Learn more… [...]

  2. Ian Stokes Says:

    Thanks a lot for writing this article.

    Cheers

    Ian

  3. trace(chris.foster) » Uza’s Blog & More » Blog Archive » Converting AS3 projects to Apollo Says:

    [...] read more… [...]

  4. Rahul Says:

    Hi,
    I was finding something similar like this.
    I have a flex project completely built and I want to convert the same into Apollo.
    Do I follow the same procedure as for action script project or is there something more that I have to do in order to make my flex project running in Apollo.
    Thanks in advance.

  5. Paulius Uza Says:

    Rahul,

    You would have to follow the same procedure as for AS project, the only difference is that you have to set your main *.mxml file (and not *.as) as a default application file.

    Hope that helps, If you will have any further issues post them here.

    Cheers
    Paulius Uza

  6. Rahul Says:

    Thanks a lot Uza, You made by day. Apollo indeed is pretty cool.

  7. Rahul Says:

    Hi Uza,
    Yesterdays after yesterdays tip , I got into another issue.I have 4 flex projects,which run independently.Now, I have one more project, which is the main menu and uses swf loader to load the corresponding 4 projects.
    Now I have to convert all of this into apollo. Any idea how I can go thru with this?

  8. Paulius Uza Says:

    Hey Rahul,

    All you have to do is to convert the loader menu into Apollo application, and copy the 4 projects you are loading into the Apollo application dir.

    /
    - /PR1
    - /PR2
    - /PR3
    - /PR4
    - Loader Application.as

    When exporting to deployable *.air file, include the PR folders into your project by selecting them in the popup window.

    After installation your PR1 folder will be accessible under app-resource:/PR1 .

    app-resource:/ points to root directory of the installed application (the directory that contains the application.xml file for the installed application)

    Hope that will help you!
    Cheers

  9. Rahul Says:

    Thanks Uza. I will check it out and let you know.

  10. Rahul Says:

    Hi Uza,
    Was trying to implement your tips, and a very funny error evoked.My application gives a call to a webservice which populates the data. Now, as soon as the service is fired, I get the following error:

    Error: Could not find resource bundle formatters
    at mx.resources::ResourceBundle$/getResourceBundle()
    at mx.formatters::DateBase$cinit()
    at global$init()
    at mx.formatters::DateFormatter/format()
    at VM_proj_ver10/gridFormatDT()
    at mx.controls.dataGridClasses::DataGridColumn/itemToLabel()
    at mx.controls.dataGridClasses::DataGridBase/mx.controls.dataGridClasses:DataGridBase::makeListData()
    at mx.controls.dataGridClasses::DataGridBase/mx.controls.dataGridClasses:DataGridBase::makeRowsAndColumns()
    at mx.controls::DataGrid/mx.controls:DataGrid::makeRowsAndColumns()
    at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::updateDisplayList()
    at mx.controls::DataGrid/mx.controls:DataGrid::updateDisplayList()
    at mx.core::UIComponent/validateDisplayList()
    at mx.managers::LayoutManager/::validateDisplayList()
    at mx.managers::LayoutManager/::doPhasedInstantiation()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/::callLaterDispatcher2()
    at mx.core::UIComponent/::callLaterDispatcher()

    I tried to import the following
    mx.resources.ResourceBundle;
    mx.formatters.DateBase;
    But still the result is same.
    One more fact I want to share is that I am using Date Formatter in my application, which my suspect is the problem area.

    If I run the same application without using swfLoader, then it works absolutely fine.
    Any idea about this??
    Thanks in advance.

  11. Natiupiru Says:

    Rahul,

    I have been having the same problem, and I just figured out a way around it. The problem occurred when I tried to use the DateFormatter within a SWF file that was loaded through the SWFLoader. My solution involves cross-scripting, which isn’t a problem if the loading SWF file and the loaded SWF file are on the same domain. What I did was I instantiated an instance of the DateFormatter class in the top level/loading SWF file. Then, from the loaded/child SWF file I used the already instantiated DateFormatter by calling Application.application.date_formatter (where date_formatter is the name of the variable that contains the DateFormatter instantiation). This solved the problem for me.

    Hopefully this will help someone else out as well, as I have spent hours trying to figure this out.

  12. Paulius Uza Says:

    Thanks for your comment Natiupiru, I hope it will be useful to other readers.

  13. Paulius Uza Says:

    Yonas I’m afraid you misunderstood something here. We are talking about Adobe AIR (former codename Apollo) in this blog post.

  14. Yonas Beyene Says:

    Apologies, I am out here.

  15. Converting AS3 project to Apollo « Programming News Says:

    [...] read more | digg story [...]

  16. Idetrorce Says:

    very interesting, but I don’t agree with you
    Idetrorce

  17. decadron Says:

    http://all-decadron.info/index.html decadron

Leave a Reply