You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Sumudu Chinthaka <cs...@gmail.com> on 2013/08/29 08:48:15 UTC

Entry Point

Hi

i have a very basic question that i have search the web and could not find
an answer

what is the entry point to an flex application

what method does AIR run time invokes when we run the application


Thanks
Sumudu

Re: Entry Point

Posted by Cosma Colanicchia <co...@gmail.com>.
For a browser app, you may take a look at this useful link:
http://technobytz.com/flex-preinitialize.html

For a desktop app, the same events should apply but they are only called
once - you should look at the InvokeEvent.INVOKE dispatched by the
WindowedApplication: it will be dispatched after the first startup, and on
every try to launch the application if it is already running (e.g. by its
icon, or by file association), because the same AIR app cannot be launched
in multiple processes at the same time.





2013/8/29 Tom Chiverton <tc...@extravision.com>

> If you mean at the user level - nothing.
> Unless you define an event listener, for something like creationComplete,
> then nothing will happen.
>
> At the framework level, there's a whole component lifecycle that every
> component you added to your app will go through : http://goo.gl/iHsHW <
> http://www.google.com/url?sa=**t&rct=j&q=&esrc=s&source=web&**
> cd=1&sqi=2&ved=0CDIQygQwAA&**url=http%3A%2F%2Fhelp.adobe.**
> com%2Fen_US%2Fflex%2Fusing%**2FWS460ee381960520ad-**
> 2811830c121e9107ecb-7fff.html%**23WS460ee381960520ad-**
> 2811830c121e9107ecb-7ffc&ei=**1f8eUtHAPKvy0gX_qoHgAg&usg=**
> AFQjCNE5N9vOcGFO-DZmMTGczjd-**hUPhPg&sig2=CwtRpSIohWrs-**
> OTkAlx_LA&bvm=bv.51495398,d.**d2k<http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&sqi=2&ved=0CDIQygQwAA&url=http%3A%2F%2Fhelp.adobe.com%2Fen_US%2Fflex%2Fusing%2FWS460ee381960520ad-2811830c121e9107ecb-7fff.html%23WS460ee381960520ad-2811830c121e9107ecb-7ffc&ei=1f8eUtHAPKvy0gX_qoHgAg&usg=AFQjCNE5N9vOcGFO-DZmMTGczjd-hUPhPg&sig2=CwtRpSIohWrs-OTkAlx_LA&bvm=bv.51495398,d.d2k>
> >
>
> Tom
>
>
> On 29/08/2013 07:48, Sumudu Chinthaka wrote:
>
>> Hi
>>
>> i have a very basic question that i have search the web and could not find
>> an answer
>>
>> what is the entry point to an flex application
>>
>> what method does AIR run time invokes when we run the application
>>
>>
>> Thanks
>> Sumudu
>>
>>
>> ______________________________**______________________________**
>> __________
>> This email has been scanned by the Symantec Email Security.cloud service.
>> For more information please visit http://www.symanteccloud.com
>> ______________________________**______________________________**
>> __________
>>
>
>

Re: Entry Point

Posted by Marcus Wilkinson <wi...@gmail.com>.
You might want to take a look at the Preloader class if dealing with AIR
(I'm not sure about flash player in the browser). I found a video from the
creators of mixing
loom<http://www.jamesward.com/2011/04/26/introducing-mixing-loom-runtime-actionscript-bytecode-modification/>
some
time ago but can't find it anymore where they talk about the virtual
machine and how they load their custom code before flex is loaded to
achieve steps towards Aspect Oriented Programming in Flex. Interesting
stuff!

I have made my own preloader which extends the default preloader
(mx.preloaders.SparkDownloadProgressBar) and this is where I load all of my
dirty monkey patches.


On 29 August 2013 09:23, Sumudu Chinthaka <cs...@gmail.com> wrote:

> if you get java console application we know that main() method is the one
> that run buy the JVM
>
> what im confuse is that, what method get calls by the AIR runtime when you
> execute mobile or desktop application
>
> Sumudu
>
>
> On Thu, Aug 29, 2013 at 1:32 PM, Tom Chiverton <tc...@extravision.com> wrote:
>
> > If you mean at the user level - nothing.
> > Unless you define an event listener, for something like creationComplete,
> > then nothing will happen.
> >
> > At the framework level, there's a whole component lifecycle that every
> > component you added to your app will go through : http://goo.gl/iHsHW <
> > http://www.google.com/url?sa=**t&rct=j&q=&esrc=s&source=web&**
> > cd=1&sqi=2&ved=0CDIQygQwAA&**url=http%3A%2F%2Fhelp.adobe.**
> > com%2Fen_US%2Fflex%2Fusing%**2FWS460ee381960520ad-**
> > 2811830c121e9107ecb-7fff.html%**23WS460ee381960520ad-**
> > 2811830c121e9107ecb-7ffc&ei=**1f8eUtHAPKvy0gX_qoHgAg&usg=**
> > AFQjCNE5N9vOcGFO-DZmMTGczjd-**hUPhPg&sig2=CwtRpSIohWrs-**
> > OTkAlx_LA&bvm=bv.51495398,d.**d2k<
> http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&sqi=2&ved=0CDIQygQwAA&url=http%3A%2F%2Fhelp.adobe.com%2Fen_US%2Fflex%2Fusing%2FWS460ee381960520ad-2811830c121e9107ecb-7fff.html%23WS460ee381960520ad-2811830c121e9107ecb-7ffc&ei=1f8eUtHAPKvy0gX_qoHgAg&usg=AFQjCNE5N9vOcGFO-DZmMTGczjd-hUPhPg&sig2=CwtRpSIohWrs-OTkAlx_LA&bvm=bv.51495398,d.d2k
> >
> > >
> >
> > Tom
> >
> >
> > On 29/08/2013 07:48, Sumudu Chinthaka wrote:
> >
> >> Hi
> >>
> >> i have a very basic question that i have search the web and could not
> find
> >> an answer
> >>
> >> what is the entry point to an flex application
> >>
> >> what method does AIR run time invokes when we run the application
> >>
> >>
> >> Thanks
> >> Sumudu
> >>
> >>
> >> ______________________________**______________________________**
> >> __________
> >> This email has been scanned by the Symantec Email Security.cloud
> service.
> >> For more information please visit http://www.symanteccloud.com
> >> ______________________________**______________________________**
> >> __________
> >>
> >
> >
>

Re: Entry Point

Posted by Arne Broedel <ar...@googlemail.com>.
when the swf gets loaded, the Application starts and is firing events in a
typical order like "preinitialize","initialize","creationComplete"....
You can listen for any of those events to trigger your own "main" method



2013/8/29 Tom Chiverton <tc...@extravision.com>

> On 29/08/2013 09:23, Sumudu Chinthaka wrote:
>
>> what im confuse is that, what method get calls by the AIR runtime when you
>> execute mobile or desktop application
>>
> There isn't a hard coded main() like in Java or C, it's event driven.
>
> Tom
>

Re: Entry Point

Posted by Sumudu Chinthaka <cs...@gmail.com>.
Hi all

SystemManager's  constructor comment resolve my problem

 /**
     *  Constructor.
     *
     *  <p>This is the starting point for all Flex applications.
     *  This class is set to be the root class of a Flex SWF file.
         *  Flash Player instantiates an instance of this class,
     *  causing this constructor to be called.</p>
     *
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */

sumudu


On Thu, Aug 29, 2013 at 3:24 PM, Sumudu Chinthaka <cs...@gmail.com> wrote:

> Thanks tom
>
> I just want to understand how this works, i have being working on a flex
> mobile project and my flex knowledge was enough to develop it. but now time
> has come for me to optimize the app and get the full performance out of it.
> so i needed to dig deep and see how things work here
>
> anyway i manage to find a copy of programming flex 2 where they enplane
> nicely about flex framework life cycle
>
> thanks everybody for sharing their thoughts and guided me to the correct
> place
>
> Regards
> Sumudu
>
>
> On Thu, Aug 29, 2013 at 3:16 PM, Tom Chiverton <tc...@extravision.com> wrote:
>
>> On 29/08/2013 10:30, Sumudu Chinthaka wrote:
>>
>>> what my concern is who is dispatching those events and who is responsible
>>> for loading the swf?
>>>
>> Ahh, OK, so you don't care about how a Flex application itself gets
>> going, more about the underlying gubbins.
>>
>> The AIR runtime itself (nor Flash Player) isn't open source, so the exact
>> mechanism it uses to load up a .swf as a local application isn't available,
>> and it defers by platform so for iOS for instance everything is cross
>> compiled as native code, but on desktops it actually still contains the .swf
>>
>> Are you trying to understand or build anything in particular?
>>
>> Tom
>>
>
>

Re: Entry Point

Posted by Sumudu Chinthaka <cs...@gmail.com>.
thanks for the tip tom
ill try them 2night

Sumudu


On Thu, Aug 29, 2013 at 4:18 PM, Tom Chiverton <tc...@extravision.com> wrote:

> On 29/08/2013 10:54, Sumudu Chinthaka wrote:
>
>> Thanks tom
>>
>> I just want to understand how this works, i have being working on a flex
>> mobile project and my flex knowledge was enough to develop it. but now
>> time
>> has come for me to optimize the app and get the full performance out of
>> it.
>> so i needed to dig deep and see how things work here
>>
> You are unlikely to be able to optimise anything that deeply :-)
> I'd suggest getting a copy of something like MonsterDebugger or Adobe's
> Scout and using that to find bottle necks
>
> Tom
>

Re: Entry Point

Posted by Tom Chiverton <tc...@extravision.com>.
On 29/08/2013 10:54, Sumudu Chinthaka wrote:
> Thanks tom
>
> I just want to understand how this works, i have being working on a flex
> mobile project and my flex knowledge was enough to develop it. but now time
> has come for me to optimize the app and get the full performance out of it.
> so i needed to dig deep and see how things work here
You are unlikely to be able to optimise anything that deeply :-)
I'd suggest getting a copy of something like MonsterDebugger or Adobe's 
Scout and using that to find bottle necks

Tom

Re: Entry Point

Posted by Sumudu Chinthaka <cs...@gmail.com>.
Thanks tom

I just want to understand how this works, i have being working on a flex
mobile project and my flex knowledge was enough to develop it. but now time
has come for me to optimize the app and get the full performance out of it.
so i needed to dig deep and see how things work here

anyway i manage to find a copy of programming flex 2 where they enplane
nicely about flex framework life cycle

thanks everybody for sharing their thoughts and guided me to the correct
place

Regards
Sumudu


On Thu, Aug 29, 2013 at 3:16 PM, Tom Chiverton <tc...@extravision.com> wrote:

> On 29/08/2013 10:30, Sumudu Chinthaka wrote:
>
>> what my concern is who is dispatching those events and who is responsible
>> for loading the swf?
>>
> Ahh, OK, so you don't care about how a Flex application itself gets going,
> more about the underlying gubbins.
>
> The AIR runtime itself (nor Flash Player) isn't open source, so the exact
> mechanism it uses to load up a .swf as a local application isn't available,
> and it defers by platform so for iOS for instance everything is cross
> compiled as native code, but on desktops it actually still contains the .swf
>
> Are you trying to understand or build anything in particular?
>
> Tom
>

Re: Entry Point

Posted by Tom Chiverton <tc...@extravision.com>.
On 29/08/2013 10:30, Sumudu Chinthaka wrote:
> what my concern is who is dispatching those events and who is responsible
> for loading the swf?
Ahh, OK, so you don't care about how a Flex application itself gets 
going, more about the underlying gubbins.

The AIR runtime itself (nor Flash Player) isn't open source, so the 
exact mechanism it uses to load up a .swf as a local application isn't 
available, and it defers by platform so for iOS for instance everything 
is cross compiled as native code, but on desktops it actually still 
contains the .swf

Are you trying to understand or build anything in particular?

Tom

Re: Entry Point

Posted by Sumudu Chinthaka <cs...@gmail.com>.
Thanks everybody

what my concern is who is dispatching those events and who is responsible
for loading the swf?

i found this article

http://librairie.immateriel.fr/fr/read_book/9780596526894/ch05s03#book_page_last

and according to that MovieClip class is the one that interact with the
FlashPlayer

i want to learn more about bootstrapping process and any resources would
be highly appreciated

Sumudu


On Thu, Aug 29, 2013 at 2:49 PM, Tom Chiverton <tc...@extravision.com> wrote:

> Those are events. Don't confuse the new guy ;-)
>
> Tom
>
>
> On 29/08/2013 10:11, vijendra sainy wrote:
>
>> preinitialize, initialize, creationComplete are few of the methods which
>> called when any flex app launches.
>> preinitialize is top in the queue.
>>
>>
>> On Thu, Aug 29, 2013 at 2:32 PM, Tom Chiverton <tc...@extravision.com>
>> wrote:
>>
>>  On 29/08/2013 09:23, Sumudu Chinthaka wrote:
>>>
>>>  what im confuse is that, what method get calls by the AIR runtime when
>>>> you
>>>> execute mobile or desktop application
>>>>
>>>>  There isn't a hard coded main() like in Java or C, it's event driven.
>>>
>>> Tom
>>>
>>>
>>
>>
>

Re: Entry Point

Posted by Tom Chiverton <tc...@extravision.com>.
Those are events. Don't confuse the new guy ;-)

Tom

On 29/08/2013 10:11, vijendra sainy wrote:
> preinitialize, initialize, creationComplete are few of the methods which
> called when any flex app launches.
> preinitialize is top in the queue.
>
>
> On Thu, Aug 29, 2013 at 2:32 PM, Tom Chiverton <tc...@extravision.com> wrote:
>
>> On 29/08/2013 09:23, Sumudu Chinthaka wrote:
>>
>>> what im confuse is that, what method get calls by the AIR runtime when you
>>> execute mobile or desktop application
>>>
>> There isn't a hard coded main() like in Java or C, it's event driven.
>>
>> Tom
>>
>
>


Re: Entry Point

Posted by vijendra sainy <vi...@gmail.com>.
preinitialize, initialize, creationComplete are few of the methods which
called when any flex app launches.
preinitialize is top in the queue.


On Thu, Aug 29, 2013 at 2:32 PM, Tom Chiverton <tc...@extravision.com> wrote:

> On 29/08/2013 09:23, Sumudu Chinthaka wrote:
>
>> what im confuse is that, what method get calls by the AIR runtime when you
>> execute mobile or desktop application
>>
> There isn't a hard coded main() like in Java or C, it's event driven.
>
> Tom
>



-- 
Regards,
*Vijendra Sainy*

*http://www.riamagic.blogspot.com/* <http://www.managementvj.blogspot.com/>
*http://www.managementvj.blogspot.com/*
*
*

Re: Entry Point

Posted by Tom Chiverton <tc...@extravision.com>.
On 29/08/2013 09:23, Sumudu Chinthaka wrote:
> what im confuse is that, what method get calls by the AIR runtime when you
> execute mobile or desktop application
There isn't a hard coded main() like in Java or C, it's event driven.

Tom

Re: Entry Point

Posted by Sumudu Chinthaka <cs...@gmail.com>.
if you get java console application we know that main() method is the one
that run buy the JVM

what im confuse is that, what method get calls by the AIR runtime when you
execute mobile or desktop application

Sumudu


On Thu, Aug 29, 2013 at 1:32 PM, Tom Chiverton <tc...@extravision.com> wrote:

> If you mean at the user level - nothing.
> Unless you define an event listener, for something like creationComplete,
> then nothing will happen.
>
> At the framework level, there's a whole component lifecycle that every
> component you added to your app will go through : http://goo.gl/iHsHW <
> http://www.google.com/url?sa=**t&rct=j&q=&esrc=s&source=web&**
> cd=1&sqi=2&ved=0CDIQygQwAA&**url=http%3A%2F%2Fhelp.adobe.**
> com%2Fen_US%2Fflex%2Fusing%**2FWS460ee381960520ad-**
> 2811830c121e9107ecb-7fff.html%**23WS460ee381960520ad-**
> 2811830c121e9107ecb-7ffc&ei=**1f8eUtHAPKvy0gX_qoHgAg&usg=**
> AFQjCNE5N9vOcGFO-DZmMTGczjd-**hUPhPg&sig2=CwtRpSIohWrs-**
> OTkAlx_LA&bvm=bv.51495398,d.**d2k<http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&sqi=2&ved=0CDIQygQwAA&url=http%3A%2F%2Fhelp.adobe.com%2Fen_US%2Fflex%2Fusing%2FWS460ee381960520ad-2811830c121e9107ecb-7fff.html%23WS460ee381960520ad-2811830c121e9107ecb-7ffc&ei=1f8eUtHAPKvy0gX_qoHgAg&usg=AFQjCNE5N9vOcGFO-DZmMTGczjd-hUPhPg&sig2=CwtRpSIohWrs-OTkAlx_LA&bvm=bv.51495398,d.d2k>
> >
>
> Tom
>
>
> On 29/08/2013 07:48, Sumudu Chinthaka wrote:
>
>> Hi
>>
>> i have a very basic question that i have search the web and could not find
>> an answer
>>
>> what is the entry point to an flex application
>>
>> what method does AIR run time invokes when we run the application
>>
>>
>> Thanks
>> Sumudu
>>
>>
>> ______________________________**______________________________**
>> __________
>> This email has been scanned by the Symantec Email Security.cloud service.
>> For more information please visit http://www.symanteccloud.com
>> ______________________________**______________________________**
>> __________
>>
>
>

Re: Entry Point

Posted by Tom Chiverton <tc...@extravision.com>.
If you mean at the user level - nothing.
Unless you define an event listener, for something like 
creationComplete, then nothing will happen.

At the framework level, there's a whole component lifecycle that every 
component you added to your app will go through : http://goo.gl/iHsHW 
<http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&sqi=2&ved=0CDIQygQwAA&url=http%3A%2F%2Fhelp.adobe.com%2Fen_US%2Fflex%2Fusing%2FWS460ee381960520ad-2811830c121e9107ecb-7fff.html%23WS460ee381960520ad-2811830c121e9107ecb-7ffc&ei=1f8eUtHAPKvy0gX_qoHgAg&usg=AFQjCNE5N9vOcGFO-DZmMTGczjd-hUPhPg&sig2=CwtRpSIohWrs-OTkAlx_LA&bvm=bv.51495398,d.d2k>

Tom

On 29/08/2013 07:48, Sumudu Chinthaka wrote:
> Hi
>
> i have a very basic question that i have search the web and could not find
> an answer
>
> what is the entry point to an flex application
>
> what method does AIR run time invokes when we run the application
>
>
> Thanks
> Sumudu
>
>
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com
> ______________________________________________________________________


Re: Entry Point

Posted by Saleh Abdulawal <sa...@gmail.com>.
Flex Applications can be run in many Difrrent ways, here are some examples:

1- Web Page : as a swf, it will require
2- Desktop App : as a normal application with a desktop shortcut
3- Mobile App: as a noraml mobile app

however, it will require from you to download and install Adobe flash "in
case it is a Web Page", or Air if your trying to open a app in mobile or
desktop, in most cases it happens automatically only once.




On Thu, Aug 29, 2013 at 9:48 AM, Sumudu Chinthaka <cs...@gmail.com> wrote:

> Hi
>
> i have a very basic question that i have search the web and could not find
> an answer
>
> what is the entry point to an flex application
>
> what method does AIR run time invokes when we run the application
>
>
> Thanks
> Sumudu
>



-- 
All the Best,

Saleh A. aziz
Senior Web Application Specialist
Mobile: 00966-56-444-00-98
E-mail: saleh.awal@gmail.com
Web  : http://saleh360.blogspot.com
Li  : http://sa.linkedin.com/in/salehawal
Tw  : https://twitter.com/saleh_awal
Fb  : http://www.facebook.com/saleh.awal