External SWF Module in Flex Module Loader and PopupManager
hi, I have facing difficulty with Mediating an external
Module(swf) into Shell Application,
I have all external modules (swf) mapped in ShellContext as
viewMap.mapType(IModule);
My shell Module (mxml view) has two external swf loaded into ModuleLoader and are mediated correctly , Now i need a module to be a Dialog Window which is also an external module , so i declare it as non- visual element as below:
<fx:Declarations>
<flex:ModuleProgressLoader id="module_fileLoad" width="600" height="550" url="FileLoadModule.swf" />
</fx:Declarations>
So when requested, shellMediator shows this module in a Popup,
PopUpManager.addPopUp(shell.module_fileLoad,contextView,true); //shell=injected ShellView
PopUpManager.centerPopUp(shell.module_fileLoad);
but this fileload module is not mediated , there is no execution
of methods startup(context) and so onRegister(Mediator) of the
FileLoadModule. This module works good if i place in the visual
list of main ShellModule View.
Plz tell me how to solve this problem.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
Support Staff 1 Posted by Ondina D.F. on 17 Dec, 2012 02:32 PM
Hi thexeb,
You need to create the mediator manually.
See here:
http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/how...
hth
Ondina
Support Staff 2 Posted by Ondina D.F. on 17 Dec, 2012 03:10 PM
OK, I was too fast:) The context of your module is not initialized because the module is not added to the stage, but to the SystemManager.
Support Staff 3 Posted by Ondina D.F. on 17 Dec, 2012 03:28 PM
You could set the SystemManager as the contextView, in your main context, like this:
And then there, where you load the module:
PopUpManager.addPopUp(moduleLoader , FlexGlobals.topLevelApplication as DisplayObject);
where moduleLoader is a ModuleLoader ;)
4 Posted by thexeb on 17 Dec, 2012 07:35 PM
Stil not working , I have now main context declared as
and adding popup in ShellMediator as:
but its still not working,, other two external modules (on Shell View Displaylist) are working fine.
5 Posted by thexeb on 18 Dec, 2012 06:11 AM
what is that i m missing , :(
Support Staff 6 Posted by Ondina D.F. on 18 Dec, 2012 11:38 AM
You don’t have access to the system manager in your example.
3 possible solutions:
Or like so:
Where parentContainer is:
and set inside the preinitialize handler:
And in your context just as usual:
super(contextView , true);
and in the context:
super(contextView, true);
Or as in my previous post:
and in the context:
super(contextView.parent , true);
You initialize your context as you wish, inside the declaration tag or in actionscript
Or
and then there, where you create the popup, you pass the parent injector to the module. Of course the class that creates the popup should have access to the injector (set or Inject )
Does this help?
7 Posted by thexeb on 18 Dec, 2012 11:50 AM
great that works , i just modified main context as
and evrything else remain same , its working ,
thanks alot odina :)
Support Staff 8 Posted by Ondina D.F. on 18 Dec, 2012 12:24 PM
That’s good news :) You’re welcome!
Ondina
Ondina D.F. closed this discussion on 18 Dec, 2012 12:24 PM.
thexeb re-opened this discussion on 19 Dec, 2012 05:05 PM
9 Posted by thexeb on 19 Dec, 2012 05:05 PM
hi Odina , one thing happened ,
I was debuging my app on a local server (wamp) with the default flex html wrapper, every thing working fine , then i uploaded to my remote server . I have wordpress install on remote server so i am using a plugin Kimili Flash Embed , for wraping swf. Now the loaded Module again not working,no mediation , with same build on local server working fine , does wrapper matters?what can be the issue?
Support Staff 10 Posted by Ondina D.F. on 19 Dec, 2012 06:18 PM
Hi thexeb,
I have no idea what Kimili Flash Embed does. I went to their site, and there is a FAQ section: http://kimili.com/plugins/kml_flashembed#faqs Maybe you can find an answer there :)
Could it be that you’re not having access to the IModule interface anymore because of that wrapper? Is the wrapper necessary? Can you at least try running the app on the server without the wrapper, to see what happens then?
The ApplicationDomain can’t be the problem, since we’ve already discussed that in another thread, right?
Ondina
11 Posted by thexeb on 19 Dec, 2012 06:33 PM
i have wordpress installled on my site ,this plugin suits well with it, i have already running app built with RL Modular .
http://thexaib.com/cat_mini_apps/photo-spark-studio/
this was pure AS3.0 app ,with two external modules,
i am currently upgrading GUI of it, ie building in FLEX,
the same wrapper should work ? but its not working, i don't know its about wrapper or something else. i have tried to open swf in my browser (without the wrapper) , still not working.
http://thexaib.com/apps/xps/ShellModule.swf
when Open File Button is clicked , an other external module is loaded.,but its not working, not mediated ,otherwise the close button would work.
12 Posted by thexeb on 19 Dec, 2012 06:38 PM
Kimili Flash Embed provide swfObject like wrapper in wordpress, its simple i think :( as my pure AS3.0 is working fine with it
Support Staff 13 Posted by Ondina D.F. on 19 Dec, 2012 06:40 PM
I’m sorry, but we’ll have to continue our discussion tomorrow. I’m about to go out for dinner.
14 Posted by thexeb on 19 Dec, 2012 06:44 PM
no problem ,thanks for your time , :)
15 Posted by thexeb on 20 Dec, 2012 06:48 AM
Now i uploaded Debug files,(Not Release Build) and its working, weird
Support Staff 16 Posted by Ondina D.F. on 20 Dec, 2012 07:53 AM
Good morning :)
It sounds like the metadata has been stripped out. Take a look at this:
https://github.com/robotlegs/robotlegs-framework/wiki/Common-Proble...
If you’re using FlashBuilder, add these compiler arguments:
-keep-as3-metadata+=Inject
-keep-as3-metadata+=PostConstruct
Support Staff 17 Posted by Ondina D.F. on 20 Dec, 2012 08:42 AM
In the title of this discussion you mentioned that the module was external. Does that mean you compiled it in another application and then added it to the current application?
If the answer is yes, then, if you’re using FlashBuilder, add the compiler arguments (keep metadata…) mentioned previously to the application that is creating the module, and when you create the module, choose “do not optimize (module can be loaded by multiple applications)” under Properties-Flex Modules
In the application loading the external module choose library linkage: “runtime shared library (RSL), under Properties-Flex Build Path and also add the compiler arguments for metadata.
Try it out and tell me how it goes.
18 Posted by thexeb on 20 Dec, 2012 10:13 AM
No same FlashBuilder is compiling multiple modules,it worked when i choose Donot Optimize . :)
thanks Odina , u being very helpfull and kind
thexeb closed this discussion on 20 Dec, 2012 10:13 AM.