Unfortunately, FB does not call our code in a useful fashion during a
"clean".  That's something that may also be a limitation of FB.  We'll see
if I find time to dig into FB more and find a workaround.  The workaround
may be to always clean the bin folder when running in FB.

-Alex

On 11/7/17, 5:58 AM, "Harbs" <[email protected]> wrote:

>FB should probably delete the bin folder when performing  clean, but it
>could be that it only removes the swf bin-debug folder and not the js bin
>folder.
>
>> On Nov 7, 2017, at 3:56 PM, Harbs <[email protected]> wrote:
>> 
>> Glad you figured it out!
>> 
>> “It’s a feature — not a bug”. ;-)
>> 
>> The compiler does not replace files from swcs when doing subsequent
>>compiles. This has two advantages:
>> 
>> 1. Subsequent compiles are faster.
>> 2. It allows you to manually change the js files included in swcs and
>>recompile your apps. I’ve used this while trying to track down bugs.
>> 
>> Our ant script has a clean before compile. When I use asconfigc to
>>compile I just delete the entire bin folder when the contents of one of
>>the swcs I’m using has changed.
>> 
>> We should probably document this somewhere before we forget…
>> 
>> HTH,
>> Harbs
>> 
>>> On Nov 7, 2017, at 3:31 PM, Idylog - Nicolas Granon
>>><[email protected]> wrote:
>>> 
>>> I have finally fixed the instantiation issue.
>>> 
>>> It turns out that the compiler (when invoked from FB) does *not*
>>> systematically replace "lib" files (js dependencies in the
>>>org.apache...
>>> subfolders) even if performing a "clean build". For some unknown
>>>reason the
>>> CurrencyFormatter js file was empty and was never replaced by a "good"
>>> one...
>>> 
>>> I'm not sure why... maybe there is some "lock" problem between FB and
>>>the
>>> compiler, maybe the compiler assumes that if a file is already there
>>>it must
>>> not be replaced...
>>> I don't know for sure. It's not what is expected from a clean build,
>>> anyway...
>>> 
>>> I also noted that the compiler does not remove unused dependencies in
>>>the
>>> output dir (even after a clean build).
>>> 
>>> But the fact is, I closed FB, manually cleaned the output dir,
>>>relaunched FB
>>> and rebuilt and *then* the problem disappeared.
>>> 
>>> Nicolas Granon
>>> 
>>> 
>>> 
>>> 
>>>> -----Message d'origine-----
>>>> De : Harbs [mailto:[email protected]]
>>>> Envoyé : lundi 6 novembre 2017 16:24
>>>> À : [email protected]; [email protected]
>>>> Objet : Re: Currency formatter instanciation issue (was RE:
>>>> ApplicationComplete event not firing)
>>>> 
>>>> Can you post your console output from compiling the app and the
>>>> contents of the index.html file?
>>>> 
>>>>> On Nov 6, 2017, at 5:18 PM, Idylog - Nicolas Granon
>>>> <[email protected]> wrote:
>>>>> 
>>>>> FlashBuilder 4.7, Win7, Apache Royale 0.9 binaries : file name :
>>>>> apache.royale-jsonly-0.9.0-bin.zip downloaded on 10/25/2017.
>>>>> 
>>>>> Nicolas Granon
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> -----Message d'origine-----
>>>>>> De : Harbs [mailto:[email protected]] Envoyé : lundi 6 novembre
>>>>>> 2017 16:10 À : [email protected] Objet : Re: Currency formatter
>>>>>> instanciation issue (was RE:
>>>>>> ApplicationComplete event not firing)
>>>>>> 
>>>>>> Related:
>>>>>> 
>>>>>> What are you using to build your app?
>>>>>> 
>>>>>>> On Nov 6, 2017, at 5:01 PM, Yishay Weiss <[email protected]>
>>>>>> wrote:
>>>>>>> 
>>>>>>> Does
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> %ROYALE_HOME%/frameworks/libs/Formatters.swc exist?
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> ________________________________
>>>>>>> From: Idylog - Nicolas Granon <[email protected]>
>>>>>>> Sent: Monday, November 6, 2017 4:27:22 PM
>>>>>>> To: [email protected]
>>>>>>> Subject: Currency formatter instanciation issue (was RE:
>>>>>>> ApplicationComplete event not firing)
>>>>>>> 
>>>>>>> No, declaring the formatter in a <fx:declaration/> tag doesn't work
>>>>>>> either...
>>>>>>> 
>>>>>>> Execution is stopped after preinitialize event fires.
>>>>>>> Initialize and applicationComplete events never fire. (I presume
>>>>>>> that a declaration tag is processed at initialize step ?).
>>>>>>> 
>>>>>>> (Thank you for the link to the examples repo !)
>>>>>>> 
>>>>>>> Nicolas Granon
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> -----Message d'origine-----
>>>>>>>> De : Yishay Weiss [mailto:[email protected]] Envoyé : lundi 6
>>>>>>>> novembre 2017 14:53 À : [email protected]; [email protected]
>>>>>>>> Objet : RE: ApplicationComplete event not firing
>>>>>>>> 
>>>>>>>> Can’t see anything wrong with what you’ve given us. Does this [1]
>>>>>> run
>>>>>>>> for you?
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> BTW, feel free to post examples of problems (or successful runs)
>>>> on
>>>>>>>> that [1] repo.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> [1]
>>>>>>>> 
>>>>>> 
>>>> 
>>>>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub
>>>>.com%2Fyishayw%2FExamples%2Fblob%2FCurrencyFormatter%2FExamples.m&data=
>>>>02%7C01%7C%7Cb6776b33f1954997f61008d525e79a61%7Cfa7b1b5a7b34438794aed2c
>>>>178decee1%7C0%7C0%7C636456599011814830&sdata=TPosroiXbXs9s4QqNa0lgmQvUR
>>>>RL9XEdGN6Wu8fA3qQ%3D&reserved=0
>>>>>>>> xm
>>>>>>>> l
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> ________________________________
>>>>>>>> From: Idylog - Nicolas Granon <[email protected]>
>>>>>>>> Sent: Monday, November 6, 2017 2:35:28 PM
>>>>>>>> To: 'Harbs'; [email protected]
>>>>>>>> Subject: RE: ApplicationComplete event not firing
>>>>>>>> 
>>>>>>>> You are right ! It does fire...unless some "silent" error happens
>>>>>>>> while building the initial view !
>>>>>>>> 
>>>>>>>> We found that there was an error in the listener for the inner
>>>> view
>>>>>>>> "initComplete" event.
>>>>>>>> This "inner error" prevents the applicationComplete to fire.
>>>>>>>> 
>>>>>>>> But we do not understand why this error happens :
>>>>>>>> 
>>>>>>>> The "inner view" initComplete listener error is caused by the
>>>>>>>> following statements :
>>>>>>>>     var cf:CurrencyFormatter;
>>>>>>>>     cf=new CurrencyFormatter();
>>>>>>>> 
>>>>>>>> It is the instantiation of the currency formatter which causes
>>>> some
>>>>>>>> problem (???).
>>>>>>>> 
>>>>>>>> After adding a try/catch block, we get this message from the error
>>>>>>>> object :
>>>>>>>>     org.apache.royale.html.accessories is undefined
>>>>>>>> 
>>>>>>>> although, of course, we import it like this (import is generated
>>>> by
>>>>>>>> code assist) :
>>>>>>>>     import org.apache.royale.html.accessories.CurrencyFormatter;
>>>>>>>> 
>>>>>>>> What are we doing wrong ?
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Nicolas Granon
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>>> -----Message d'origine-----
>>>>>>>>> De : Harbs [mailto:[email protected]] Envoyé : lundi 6
>>>>>>>>> novembre
>>>>>>>>> 2017 12:53 À : [email protected]; [email protected] Objet :
>>>>>> Re:
>>>>>>>>> ApplicationComplete event not firing
>>>>>>>>> 
>>>>>>>>> We are using applicationComplete and it definitely fires.
>>>>>>>>> 
>>>>>>>>> If you post some code maybe I’d have some input.
>>>>>>>>> 
>>>>>>>>> The event type for most events in Royale is Event. Some events
>>>>>>>>> have a payload and they have a different event type (such as
>>>>>> ValueEvent),
>>>>>>>> but
>>>>>>>>> events in Royale are much more generalized than Flex.
>>>>>>>>> 
>>>>>>>>> HTH,
>>>>>>>>> Harbs
>>>>>>>>> 
>>>>>>>>>> On Nov 6, 2017, at 12:01 PM, Idylog - Nicolas Granon
>>>>>>>>> <[email protected]> wrote:
>>>>>>>>>> 
>>>>>>>>>> (maybe this is not the right place for this kind of message ?
>>>> let
>>>>>>>> me
>>>>>>>>>> know)
>>>>>>>>>> 
>>>>>>>>>> When running our (almost) Hello world application (JS target) it
>>>>>>>>> seems
>>>>>>>>>> that "applicationComplete" event does not fire.
>>>>>>>>>> 
>>>>>>>>>> "preinitialize" and "initialize" events both fire.
>>>>>>>>>> 
>>>>>>>>>> The application "viewChanged" event does not fire on initial
>>>>>>>>>> load,
>>>>>>>>> but
>>>>>>>>>> maybe it fires only when the is a view *change*, not when the
>>>>>> first
>>>>>>>>>> view in "initial view" loads ?
>>>>>>>>>> 
>>>>>>>>>> Also, what is the class of these events ? Code assist shows the
>>>>>>>>>> event name, but not its class (???). For now, I declare them as
>>>>>>>>>> "Event" but I like to correctly type my arguments...
>>>>>>>>>> 
>>>>>>>>>> Nicolas Granon
>>>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>> 
>>>>> 
>>> 
>>> 
>> 
>

Reply via email to