1.- I'm using SWFLoader instead of Loader since it's more usable when you want to load Applications and interact with the Apps loaded.
2.- The Debug problem was discused on the list. When FB2 extracts the SWC it does with -debug=false, this could be fixed if FB2 let developers to configure the debug option (maybe a check in order to allow extraction with or without debug. If you don't want debug, you need to extract it yourself. I think it 's a bug because if you run your app in normal mode you don't have to get that debug dialog
3.- I think a better approach is to create a diferent project for your Module4 (one proyect for module).
Best,
C.
Hi All,
I've been spinning in circles trying to implement a modular dynamic
loading architecture for our client app. I've been studying this
thread and a few others and I think it's starting to sink in but I'm
not there yet. I've tried a very simple sample with a Shell that
dynamically loads a Module and displays a component from the Module.
I would like to get this working in FlexBuilder with a minimum of
helper scripts so here is a description of what I did and a few
questions ...
Currently I have a Flex Project called Shell3 and a Flex Library
called Module4.
Shell3 has the following it is library path
1) playerglobal.swc (Link Type: External)
2) flex.swc (Link Type: Merged into code)
3) {local} (Link Type: Merged into code)
4) Module4 (Link Type: External)
5) framework.swc (Link Type: RSL)
Module4 has the following it is library path
1) playerglobal.swc (Link Type: External)
3) {local} (Link Type: Merged into code)
5) framework.swc (Link Type: External)
The Module has a simple action script class and a component that
extends canvas MainView in the com.abc.library package.
The Shell app looks like this
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.containers.Canvas;
import com.abc.library.*;
[Bindable] private var coname:String;
private function loadLib():void
{
var context: LoaderContext = new
LoaderContext(false,ApplicationDomain.currentDomain);
var request: URLRequest = new URLRequest("Module4.swf");
var loader: Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT,this.handleLibInitialized);
loader.load(request, context);
}
private function handleLibInitialized(event: Event): void
{
trace(Constants.COMPANY_NAME);
this.coname = Constants.COMPANY_NAME;
var newView:Canvas = new MainView();
newView.percentHeight = 25;
newView.percentWidth = 25;
this.addChild(newView);
}
]]>
</mx:Script>
<mx:Button label="load" click="loadLib();" x="514" y="10"/>
<mx:Text top="40" text="{coname}" x="514"/>
</mx:Application>
When the user clicks the load button the loadLib method loads the
Module and is able to access the actionScript class and the canvas.
1st question: Is this a good approach?
2nd question: When I launch not in debug mode I get that "Where is
the Debugger or Profiler Running?" dialog more than once. It looks
like I get it when it loads the framework RSL in Shell3, when it loads
the Module4 and when Module4 loads the framework RSL. What am I
doing wrong?
3rd question: I have to manually extract the Module4.swf from the
Module4.swc is there an easy way to automatically do this in
FlexBuilder or do I need to write an ant script?
Thank you,
-Vito
--
::| Carlos Rovira
::| http://www.carlosrovira.com
::| http://www.madeinflex.com __._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
![]()
SPONSORED LINKS
Software development tool Software development Software development services Home design software Software development company
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
- Re: [flexcoders] Re: Architecting a large, modular Flex appl... Carlos Rovira
Reply via email to