PDA

View Full Version : Embedding FLEX components in openlaszlo


piccarre
02-17-2009, 08:12 AM
Dear developers,
I'm trying to integrate a couple of AS3 components (canvas derived)
in an openlaszlo application.
The components are pure AS3, no MXML.
I made a component library, and then tried to embed the components,
mimicking the googlemap integration procedure.
Unfortunately I see nothing on the screen.
I tried embedding a simple mx.controls.Label and... nothing again.
Can anyone help?

Thanks in advance,
Luca.

rajubitter
02-17-2009, 02:20 PM
This might help you to get a better idea of how to do that:

1) run the LZX app through the OpenLaszlo compiler
2) look up the generated AS3 code in the Java temp folder
3) try to add your own code to the AS3 app as you'd do in FlexBuilder or whatever tool you use for AS3 development

You'll find the temp folder and the Flex compiler command used in the catalina.out log file or Tomcat console. Here's an example output from the Calendar demo compiled to SWF9 on my machine:

Executing compiler: (cd /usr/local/laszlo-webtop-1.5.1/tomcat/temp/lzswf9/lzgen63002; /usr/local/laszlo-webtop-1.5.1/tom
cat/webapps/trunk/WEB-INF/bin/mxmlc -load-config=/usr/local/laszlo-webtop-1.5.1/tomcat/webapps/trunk/WEB-INF/frameworks/
flex-config.xml -compiler.show-actionscript-warnings=false -compiler.source-path+=/usr/local/laszlo-webtop-1.5.1/tomcat/
temp/lzswf9/lzgen63002 -compiler.headless-server=true -compiler.fonts.advanced-anti-aliasing=true -output /usr/local/las
zlo-webtop-1.5.1/tomcat/temp/lzswf9/lzgen63002/app.swf -default-size 835 600 -compiler.library-path+=/usr/local/laszlo-w
ebtop-1.5.1/tomcat/webapps/trunk/lps/includes/lfc/LFC9.swc -compiler.library-path+=/usr/local/laszlo-webtop-1.5.1/tomcat
/webapps/trunk/WEB-INF/flexlib -includes \$debug \$profile \$backtrace \$runtime \$swf7 \$swf8 \$as2 \$swf9 \$swf10 \$as
3 \$dhtml \$j2me \$svg \$js1 -frame two LzSpriteApplication -file-specs=/usr/local/laszlo-webtop-1.5.1/tomcat/temp/lzswf
9/lzgen63002/LzPreloader.as)
compiler output is Loading configuration file /usr/local/laszlo-webtop-1.5.1/tomcat/webapps/trunk/WEB-INF/frameworks/fle
x-config.xml

Have fun,
Raju

rajubitter
02-17-2009, 02:23 PM
Once that works, try to back-port the specific code to integrate your components into LZX.

One more thing: as far as I know Flex SWCs don't work with OpenLaszlo, only AS3 SWCs.

- Raju

piccarre
02-19-2009, 12:09 AM
Once that works, try to back-port the specific code to integrate your components into LZX.

One more thing: as far as I know Flex SWCs don't work with OpenLaszlo, only AS3 SWCs.

- Raju

This last one might be the problem,
thanks for answering

Luca

rajubitter
02-19-2009, 12:24 AM
There has been a long discussion if it's possible to use Flex components in AS3 applications, many years ago in Mike Chambers blog.

http://www.mikechambers.com/blog/2005/11/29/using-flex-components-in-actionscript-projects/

Looks like people haven't managed to get examples running again...

- Raju