Where do I find LzApplication.as

View: New views
4 Messages — Rating Filter:   Alert me  

Where do I find LzApplication.as

by Neil Mix :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi folks,

I'm attempting to port a very oooold Laszlo project to 4.6.1, swf9  
runtime.  The project is compiling successfully, but when I run the  
app it fails early on during startup.  No errors are showing up in the  
debug window, but the handy debug Flash is logging the following stack  
trace:

TypeError: Error #1006: value is not a function.
        at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST++++TI/-
Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/SavageBeast/
Engineering/projects/radio/src/flash/TMP_ANT/pandora/build/tuner/
LzApplication.as:16907]
        at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST++++TI/-
Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/SavageBeast/
Engineering/projects/radio/src/flash/TMP_ANT/pandora/build/tuner/
LzApplication.as:17223]
        at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST++++TI/-
Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/SavageBeast/
Engineering/projects/radio/src/flash/TMP_ANT/pandora/build/tuner/
LzApplication.as:17324]
        at LzScript()[/tmp/lzswf9/lzgen24517/LzScript.as:8]
        at LzNode/makeChild()[/tmp/lzswf9/lzgen24517/LzNode.as:866]
        at LzInstantiatorService/makeSomeViews()[/tmp/lzswf9/lzgen24517/
LzInstantiatorService.as:221]
        at LzInstantiatorService/checkQ()[/tmp/lzswf9/lzgen24517/
LzInstantiatorService.as:171]
        at Function/http://adobe.com/AS3/2006/builtin::call()
        at LzEvent/sendEvent()[/tmp/lzswf9/lzgen24517/LzEvent.as:89]
        at LzIdleKernel$/__update()[/tmp/lzswf9/lzgen24517/LzIdleKernel.as:19]

Now I recognize that Flex is the compiler underneath and this is an  
intermediate auto-generated file.  Finding the file and the source of  
the bug is not very hard.  But this is almost certainly the first of  
many such errors I need to fix.  It would be great if I could  
automatically tie this back to the original source file/line.  Is it  
normal for errors like this not to show up in the Debug window?  Is  
there anything I'm doing wrong that prevents me from seeing the  
original source file/line?

A couple facts about my setup that could influence things:
- I'm compiling from the command-line
- As you can probably see, the app is pretty dang big

Thanks for any advice,
   -Neil

Re: Where do I find LzApplication.as

by P T Withington :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Neil, hi!

Hopefully you have already seen:  http://wiki.openlaszlo.org/SWF9_Conversion

You might want to read the latest copy of "OpenLaszlo <view>":  http://openlaszlo.org/misc/OpenLaszloView103109.pdf

We've spiffed up our debugger in the latest trunk build so that it  
_should_ be more helpful than what is available in 4.6.1.  So, you  
might want to try a nightly build (from http://download.openlaszlo.org/nightly/trunk/ 
).

Alternatively, you can try using the flex debugger, fdb.  Henry (cc-
ed) can fill you in on the details of that.  If you lzc --debug there  
should also be annotations in the intermediate files that should point  
you back to your original source.

Finally, you can set compiler.catcherrors=true in WEB-INF/lps/config/
lps.properties (it's commented out in the distribution by default),  
and this will make swf9 act a bit more like swf8 by catching and  
ignoring any errors.  Not recommended, but sometimes needed as a last  
resort.  (In the nightlies, essentially a debug compile catches all  
errors and reports them in a way that you can relate back to your LZX  
source).

Let us know how it goes.  We need more 'big' swf9 projects, and always  
glad to help out Pandora.  :)

On 2009-10-28, at 18:14, Neil Mix wrote:

> Hi folks,
>
> I'm attempting to port a very oooold Laszlo project to 4.6.1, swf9  
> runtime.  The project is compiling successfully, but when I run the  
> app it fails early on during startup.  No errors are showing up in  
> the debug window, but the handy debug Flash is logging the following  
> stack trace:
>
> TypeError: Error #1006: value is not a function.
> at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST+++
> +TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/
> SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/
> build/tuner/LzApplication.as:16907]
> at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST+++
> +TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/
> SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/
> build/tuner/LzApplication.as:17223]
> at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST+++
> +TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/
> SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/
> build/tuner/LzApplication.as:17324]
> at LzScript()[/tmp/lzswf9/lzgen24517/LzScript.as:8]
> at LzNode/makeChild()[/tmp/lzswf9/lzgen24517/LzNode.as:866]
> at LzInstantiatorService/makeSomeViews()[/tmp/lzswf9/lzgen24517/
> LzInstantiatorService.as:221]
> at LzInstantiatorService/checkQ()[/tmp/lzswf9/lzgen24517/
> LzInstantiatorService.as:171]
> at Function/http://adobe.com/AS3/2006/builtin::call()
> at LzEvent/sendEvent()[/tmp/lzswf9/lzgen24517/LzEvent.as:89]
> at LzIdleKernel$/__update()[/tmp/lzswf9/lzgen24517/LzIdleKernel.as:
> 19]
>
> Now I recognize that Flex is the compiler underneath and this is an  
> intermediate auto-generated file.  Finding the file and the source  
> of the bug is not very hard.  But this is almost certainly the first  
> of many such errors I need to fix.  It would be great if I could  
> automatically tie this back to the original source file/line.  Is it  
> normal for errors like this not to show up in the Debug window?  Is  
> there anything I'm doing wrong that prevents me from seeing the  
> original source file/line?
>
> A couple facts about my setup that could influence things:
> - I'm compiling from the command-line
> - As you can probably see, the app is pretty dang big
>
> Thanks for any advice,
>  -Neil


Re: Where do I find LzApplication.as

by Henry Minsky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Neil,

It looks like the bug you're seeing from that stacktrace is somewhere inside of a <script> block (based on it being in the middle of instantiating an LzScript node). Stuff inside of <script> blocks is a little more delicate in swf9 than it was in swf8, given what  the code inside of a  <script> block actually compiles to (swf9 is a somewhat less dynamic of a runtime environment, and there are issues with how the code inside of a <script> block gets compiled into a closure to
defer it's execution).



Just a couple of notes about the intermediate .as files that the LZX compiler produces:

As you  noticed, the app is compiled down to some intermediate .as files for flex, and those are written to a tmp directory. The app is linked with the LFC  swf9 (or swf10) library, which is in flex .swc library file format (e.g., lps/includes/lfc/LFC9.swc or LFC9-debug.swc)

You can run an application under the control of the flex command line debugger. This can sometimes let you catch some errors right where they happen that it's hard for the Laszlo debugger to catch (although this usually is needed when debugging the 'kernel' , i.e., the
swf9-specific code in the LFC library).

The fdb debugger can be invoked like this to run the app inside of the browser and then connect to it:
fdb "http://127.0.0.1:8080/lps4/myapp.lzx?lzr=swf9"

or in your case if it's a solo app that you compiled to a swf file from the command line , I think you could say

fdb "http://127.0.0.1:8080/lps4/myapp.swf9.swf"


That will launch the app in the browser and then the fdb command line debugger will wait for you to set a breakpoint if you want to. Just type 'c' to continue and it will execute. The flex debugger will print out a pathname of where it is, but that will be the name of the tmp file that was generated. Unfortunately, sometimes  you may  just need to open that file in an editor and see what line of code it's referring to, there will be comments in the file that point back to the source code location in the original LZX file.


[Note there's currently a bug with the OpenLaszlo debugger when running an app like this which has a '.swf' suffix instead of a '.lzx' suffix,  if you try to eval anything but a simple foo.bar.baz type of expression, it won't be able to handle it because it sends the expression to be evaluated to the wrong URL on the LPS server]







 


On Wed, Oct 28, 2009 at 6:14 PM, Neil Mix <nmix@...> wrote:
Hi folks,

I'm attempting to port a very oooold Laszlo project to 4.6.1, swf9 runtime.  The project is compiling successfully, but when I run the app it fails early on during startup.  No errors are showing up in the debug window, but the handy debug Flash is logging the following stack trace:

TypeError: Error #1006: value is not a function.
       at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST++++TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/build/tuner/LzApplication.as:16907]
       at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST++++TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/build/tuner/LzApplication.as:17223]
       at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST++++TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/build/tuner/LzApplication.as:17324]
       at LzScript()[/tmp/lzswf9/lzgen24517/LzScript.as:8]
       at LzNode/makeChild()[/tmp/lzswf9/lzgen24517/LzNode.as:866]
       at LzInstantiatorService/makeSomeViews()[/tmp/lzswf9/lzgen24517/LzInstantiatorService.as:221]
       at LzInstantiatorService/checkQ()[/tmp/lzswf9/lzgen24517/LzInstantiatorService.as:171]
       at Function/http://adobe.com/AS3/2006/builtin::call()
       at LzEvent/sendEvent()[/tmp/lzswf9/lzgen24517/LzEvent.as:89]
       at LzIdleKernel$/__update()[/tmp/lzswf9/lzgen24517/LzIdleKernel.as:19]

Now I recognize that Flex is the compiler underneath and this is an intermediate auto-generated file.  Finding the file and the source of the bug is not very hard.  But this is almost certainly the first of many such errors I need to fix.  It would be great if I could automatically tie this back to the original source file/line.  Is it normal for errors like this not to show up in the Debug window?  Is there anything I'm doing wrong that prevents me from seeing the original source file/line?

A couple facts about my setup that could influence things:
- I'm compiling from the command-line
- As you can probably see, the app is pretty dang big

Thanks for any advice,
 -Neil



--
Henry Minsky
Software Architect
hminsky@...



Re: Where do I find LzApplication.as

by Neil Mix :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Henry and PT,

Thanks for all the great pointers.  I'm sure this is going to be more  
than enough to keep me going for a bit, I'll poke around and let you  
know how things go.  To be clear we're scoping out possibilities right  
now, there's lots of hurdles to get through before we can even think  
of deploying Flash 9, so don't expect any changes soon.  Fingers  
crossed, though.  I guesstimated 2 weeks work, I'm about 2 days in,  
which puts me well ahead of schedule. :)

Thanks,
   -Neil

On Oct 28, 2009, at 5:41 PM, P T Withington wrote:

> Hey Neil, hi!
>
> Hopefully you have already seen:  http://wiki.openlaszlo.org/SWF9_Conversion
>
> You might want to read the latest copy of "OpenLaszlo <view>":  http://openlaszlo.org/misc/OpenLaszloView103109.pdf
>
> We've spiffed up our debugger in the latest trunk build so that it  
> _should_ be more helpful than what is available in 4.6.1.  So, you  
> might want to try a nightly build (from http://download.openlaszlo.org/nightly/trunk/)
> .
>
> Alternatively, you can try using the flex debugger, fdb.  Henry (cc-
> ed) can fill you in on the details of that.  If you lzc --debug  
> there should also be annotations in the intermediate files that  
> should point you back to your original source.
>
> Finally, you can set compiler.catcherrors=true in WEB-INF/lps/config/
> lps.properties (it's commented out in the distribution by default),  
> and this will make swf9 act a bit more like swf8 by catching and  
> ignoring any errors.  Not recommended, but sometimes needed as a  
> last resort.  (In the nightlies, essentially a debug compile catches  
> all errors and reports them in a way that you can relate back to  
> your LZX source).
>
> Let us know how it goes.  We need more 'big' swf9 projects, and  
> always glad to help out Pandora.  :)
>
> On 2009-10-28, at 18:14, Neil Mix wrote:
>
>> Hi folks,
>>
>> I'm attempting to port a very oooold Laszlo project to 4.6.1, swf9  
>> runtime.  The project is compiling successfully, but when I run the  
>> app it fails early on during startup.  No errors are showing up in  
>> the debug window, but the handy debug Flash is logging the  
>> following stack trace:
>>
>> TypeError: Error #1006: value is not a function.
>> at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST+++
>> +TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/
>> SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/
>> build/tuner/LzApplication.as:16907]
>> at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST+++
>> +TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/
>> SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/
>> build/tuner/LzApplication.as:17223]
>> at <anonymous>()[/private/var/folders/Af/AfhEQDevFwaKcP77YUvST+++
>> +TI/-Tmp-/lzswf9/Users/nmix/sbwork/neil-8.9-flash-upgrade/
>> SavageBeast/Engineering/projects/radio/src/flash/TMP_ANT/pandora/
>> build/tuner/LzApplication.as:17324]
>> at LzScript()[/tmp/lzswf9/lzgen24517/LzScript.as:8]
>> at LzNode/makeChild()[/tmp/lzswf9/lzgen24517/LzNode.as:866]
>> at LzInstantiatorService/makeSomeViews()[/tmp/lzswf9/lzgen24517/
>> LzInstantiatorService.as:221]
>> at LzInstantiatorService/checkQ()[/tmp/lzswf9/lzgen24517/
>> LzInstantiatorService.as:171]
>> at Function/http://adobe.com/AS3/2006/builtin::call()
>> at LzEvent/sendEvent()[/tmp/lzswf9/lzgen24517/LzEvent.as:89]
>> at LzIdleKernel$/__update()[/tmp/lzswf9/lzgen24517/LzIdleKernel.as:
>> 19]
>>
>> Now I recognize that Flex is the compiler underneath and this is an  
>> intermediate auto-generated file.  Finding the file and the source  
>> of the bug is not very hard.  But this is almost certainly the  
>> first of many such errors I need to fix.  It would be great if I  
>> could automatically tie this back to the original source file/
>> line.  Is it normal for errors like this not to show up in the  
>> Debug window?  Is there anything I'm doing wrong that prevents me  
>> from seeing the original source file/line?
>>
>> A couple facts about my setup that could influence things:
>> - I'm compiling from the command-line
>> - As you can probably see, the app is pretty dang big
>>
>> Thanks for any advice,
>> -Neil
>