Re: [flexcoders] Re: AIR from a Flex ActionScript Project? SOLVED

2009-10-06 Thread John McCormack
Much appreciated!
John

reflexactions wrote:
> Developing Adobe AIR 1.5 Applications with Flex:
> See section "Creating your first AIR application with the Flex SDK" 
>
> See the para "Write the application code"
>
> "Note: SWF-based AIR applications can use a main class defined either with 
> MXML or with Adobe® ActionScript® 3.0. This example uses an MXML file to 
> define its main class. The process for creating an AIR application with a 
> main ActionScript class is similar. Instead of compiling an MXML file into 
> the SWF, you compile the ActionScript class file. When using ActionScript, 
> the main class must extend flash.display.Sprite."
>
> Also see "Create the AIR application descriptor file"
>
> --- In flexcoders@yahoogroups.com, John McCormack  wrote:
>   
>> reflexactions wrote:
>> 
>>> FYI The Adobe docs do describe how to create a pure AS (i.e. not using 
>>> MXML) AIR application.
>>>   
>>>   
>> I haven't found that, although I have found lots of other references.
>> Unfortunately the Adobe PDF help files overlap and they have no dates, 
>> so things are hard to find.
>>
>> Some of my problems were because I was using various properties of the 
>> main Class and when it because an AIR application it wasn't the main 
>> class any more.
>>
>> If possible, please point me to the particular document it's in.
>>
>> Thanks
>>
>> John
>>
>> 
>
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>
>   




Re: [flexcoders] Re: AIR from a Flex ActionScript Project? SOLVED

2009-10-06 Thread John McCormack
reflexactions wrote:
> FYI The Adobe docs do describe how to create a pure AS (i.e. not using MXML) 
> AIR application.
>   

I haven't found that, although I have found lots of other references.
Unfortunately the Adobe PDF help files overlap and they have no dates, 
so things are hard to find.

Some of my problems were because I was using various properties of the 
main Class and when it because an AIR application it wasn't the main 
class any more.

If possible, please point me to the particular document it's in.

Thanks

John





Re: [flexcoders] Re: AIR from a Flex ActionScript Project? SOLVED

2009-10-06 Thread John McCormack
Michael,

I had problems getting the ActionScript project code into the AIR 
application.

The original Document Class from OriginalProgram.AS would not run 
because it was no longer automatically on the display list and so its 
stage variable was null.

I emptied the code from the constructor into a new function called main, 
added an instance to the stage, see below, and completed the 
construction via main().
It could then proceed since stage was no longer null.

My background colour has changed and the aligment isn't working but it 
looks very promising.

Thanks again.

John



 http://www.adobe.com/2006/mxml"; 
layout="absolute" creationComplete="start();">
  
   
 
 




Michael wrote:
> John,
>
> Though your code is in ActionScript, you should just be able to use the MXML 
> WindowedApplication tag just at the very top-level, and initialize your main 
> ActionScript UI within an  tag.
>
> Something like:
>
> http://www.adobe.com/2006/mxml"; 
>   applicationComplete="init();">
>   
>   
>   
> 
>
>
> Finally, I left out a step (4) in my previous message.  Steps 1-3 are 
> sufficient to run your AIR app in the debugger, but to distribute your AIR 
> application you typically need to generate and sign a .air file.  Flex 
> Builder can do that; from the raw SDK, you should check out the adt tool.
>
> Hope this helps,
> Michael Portuesi
>
>
> --- In flexcoders@yahoogroups.com, John McCormack  wrote:
>   
>> Thanks Michael,
>>
>> I will give this a try.
>>
>> Currently, within FB3 I can create an AIR project and it does these 
>> things for me but the output is structured similarly to a Flex project 
>> but my projects are ActionScript projects built within FB3 and so the 
>> conversion isn't quite the same.
>>
>> Perhaps I should be looking to convert from AcitionScript to Flex as an 
>> intermediate step: by minimizing the mxml and calling my main Document 
>> Class from the main mxml class and then modify that for AIR.
>>
>> It's annoying because from within Flash Prof. I can publish as AIR, but 
>> that's a conversion step backwards.
>>
>> John
>>
>>
>> Michael wrote:
>> 
>>> John,
>>>
>>> You can convert your Flex project to an AIR application pretty easily.  
>>> There's three basic steps involved:
>>>
>>> 1) Your application should be declared as inheriting from 
>>> WindowedApplication, rather than Application in your main myapp.mxml file.
>>>
>>> http://www.adobe.com/2006/mxml"; xmlns="*">
>>>
>>> 
>>>
>>> 
>>>
>>> 2) Create an AIR app descriptor file. Here's an example.  Name it 
>>> myapp-app.xml and place in the same folder as your main myapp.mxml file. 
>>>
>>> 
>>> http://ns.adobe.com/air/application/1.5.1";>
>>> com.myapp.tester
>>> 0.1
>>> tester
>>> FlexUnit Test Runner
>>> 
>>> tester.swf
>>> true
>>> standard
>>> false
>>> 1024
>>> 768
>>> 
>>> 
>>>
>>> There is detailed documentation on the AIR app descriptor format on the 
>>> Adobe site:
>>>
>>> http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff1.html
>>>
>>> 3) Use the AIR MXML compiler (amxmlc rather than mxmlc) in your build 
>>> scripts.  If you're using Flex Builder, you can add an AIR Project Builder 
>>> to your in the Project Properties > Builders pane.
>>>
>>> That should be enough to get you started.  Good luck.
>>>
>>> Michael Portuesi
>>>
>>>
>>> --- In flexcoders@yahoogroups.com, John McCormack  wrote:
>>>   
>>>   
 Is there any easy way to publish a Flex ActionScript Project as an AIR 
 file.
 This project, by its nature, has no mxml tags.

 John

 
 
>>>
>>>
>>> 
>>>
>>> --
>>> Flexcoders Mailing List
>>> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>>> Alternative FAQ location: 
>>> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
>>> Search Archives: 
>>> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>   
>
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>
>