I have one OpenLaszlo/AS3 App (olapp.lzx) and one Flex App (flexapp.swc). I want to include flexapp.swc in olapp.lzx as follows:
olapp.lzx (AS3):
===============
...
var flexapp:Sprite = new FlexApp();
flexapp.doSomething();
...
The flexapp.swc is compiled from this mxml:
flexapp.mxml:
============
<?xml version="1.0"?>
<!-- intro/FlexApp.mxml -->
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<mx:ComboBox>
<mx:dataProvider>
<s:ArrayList>
<fx:String>AK</fx:String>
<fx:String>AL</fx:String>
<!-- Add all other states. -->
</s:ArrayList>
</mx:dataProvider>
</mx:ComboBox>
</mx:Application>
When I compile flexapp.mxml to swf, it runs nicely, but instantiation from AS3 fails (TypeError: Error #2007). I researched that mxml->as3 integration is not the usual way to go, but for this particular case I need to. I have to admit that I'm not yet too familiar with Flex, only OpenLaszlo. What should be changed in flexapp.mxml? Thanks!