tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/11373-rl2-ios-creating-children-views-that-have-their-own-mediatorRobotlegs: Discussion 2014-07-15T07:15:40Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/335720572014-06-27T15:52:08Z2014-06-27T15:52:09ZRL2, iOS - Creating children views that have their own mediator<div><p>I was using the AcmeWidgetFactory example (<a href=
"http://examples.robotlegs.org/widgetfactory/index.html">http://examples.robotlegs.org/widgetfactory/index.html</a>)
as a basis for my project, but 1) that's using RL1 and 2) using
modules.</p></div>zmaldonadotag:robotlegs.tenderapp.com,2009-10-18:Comment/335720572014-06-28T11:54:25Z2014-06-28T11:54:25ZRL2, iOS - Creating children views that have their own mediator<div><p>Hello,</p>
<p>Regarding swfs for iOS mobile, see if you can find anything
useful in the following articles:</p>
<p>Release Notes | Flash Player® 11.7 AIR® 3.7 - Externally
hosting secondary swf files (iOS):<br>
<a href=
"http://helpx.adobe.com/flash-player/release-note/fp_117_air_37_release_notes.html">
http://helpx.adobe.com/flash-player/release-note/fp_117_air_37_rele...</a></p>
<p>"Starting with AIR 3.7, application developers will be able to
host their secondary SWFs on an external server and load them on
demand as per their application logic." see here: <a href=
"http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air-apps-on-ios/">
http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-...</a></p>
<p>I agree with Alex Harui - see last comment on this thread:<br>
<a href=
"http://apache-flex-development.2333347.n4.nabble.com/Load-external-swf-in-AIR-mobile-application-td31517.html">
http://apache-flex-development.2333347.n4.nabble.com/Load-external-...</a></p>
<p>Other workarounds:<br>
<a href=
"http://blogs.adobe.com/digitalmedia/2011/06/compiling-big-flashair-projects-with-lot-of-swfs-for-ios/">
http://blogs.adobe.com/digitalmedia/2011/06/compiling-big-flashair-...</a></p>
<p><a href=
"http://www.adobe.com/devnet/flash/articles/join-multiple-swf-files.html">
http://www.adobe.com/devnet/flash/articles/join-multiple-swf-files....</a></p>
<p>As a side note: in case you just want to have multiple contexts
inside of an application, assuming that the file size doesn't
matter that much, you can use any display object as a contextView,
not just Flex Modules, to create as many contexts as you need. But,
you probably already knew that:)</p>
<p>If you're asking how to use the Modularity Extension for
robotlegs 2, just let me know, and I'll give you more info about it
or links to examples.</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/335720572014-06-30T14:49:33Z2014-06-30T14:49:33ZRL2, iOS - Creating children views that have their own mediator<div><p>Thanks Ondina for the response!</p>
<p>Seems like secondary SWFs isn't the way to go, as in, they
aren't reliable, they aren't secure, they require loading from an
external server which doesn't really make sense speed wise for what
I need, and they would probably be a headache to implement.</p>
<p>In terms of multiple contexts, yes, that seems more feasible.
Pretty much I need to setup N number of child objects that have
their own mediators, commands, and I guess context.</p>
<p>As for the Modularity Extension (which I've seen your example of
<a href=
"https://github.com/Ondina/robotlegs-bender-modular-air">https://github.com/Ondina/robotlegs-bender-modular-air</a>)
It works great, but once again, it relies on the use of s:Module
and swf loading. Is there any way around this?</p>
<p>Thank you again!</p></div>zmaldonadotag:robotlegs.tenderapp.com,2009-10-18:Comment/335720572014-06-30T15:10:27Z2014-06-30T15:10:27ZRL2, iOS - Creating children views that have their own mediator<div><p>You're welcome!</p>
<p>As I said, you can use any display object instead of a Flex
Module. All you need to do is to add the contextView of each child
context to the stage, in the parent-contextView or in one of its
sub-views. When you remove the child-contextView from stage, its
context will be destroyed. So, in my example, you just need to
replace the Module container with a display object of your choice,
and instead of using module loader or swf loader, you simply add
the view to the stage. The Modularity extension needs a contextView
in order to work, but it doesn't have to be a Flex Module.</p>
<p>Let me know if it works for you. If it doesn't, I'll try to find
some time to modify my example, so it would work without swfs.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/335720572014-06-30T15:22:21Z2014-06-30T15:22:21ZRL2, iOS - Creating children views that have their own mediator<div><p>Oh, I see what you are saying! Sorry about that. Glad you took
the time to explain that. I'll work on this and let you know how it
goes.</p>
<p>-Zack</p></div>zmaldonadotag:robotlegs.tenderapp.com,2009-10-18:Comment/335720572014-06-30T15:41:27Z2014-06-30T15:41:27ZRL2, iOS - Creating children views that have their own mediator<div><p>Ok:)<br>
Yes, let me know how it goes. It might be useful for other iOS
developers, as well.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/335720572014-06-30T20:43:53Z2014-06-30T20:43:53ZRL2, iOS - Creating children views that have their own mediator<div><p>Works great! I found a similar thread to what I was trying to
accomplish <a href=
"http://forum.starling-framework.org/topic/screennavigator-and-mvc-frameworks">
http://forum.starling-framework.org/topic/screennavigator-and-mvc-f...</a>
that deals with the issue in the comments ("The ScreenNavigator has
its own mediator, and the Screen's mediator dispatches an event
that the ScreenNavigator's mediator can listen for.")</p>
<p>Way more comfortable with Contexts and configs overall. I really
like how you setup up your config files, Ondina (<a href=
"https://github.com/Ondina/robotlegs-bender-modular-air/tree/master/src/modulesAndPopups/shell/configs">https://github.com/Ondina/robotlegs-bender-modular-air/tree/master/...</a>)
Very clean and easy to work with.</p></div>zmaldonadotag:robotlegs.tenderapp.com,2009-10-18:Comment/335720572014-07-01T13:02:20Z2014-07-01T13:02:20ZRL2, iOS - Creating children views that have their own mediator<div><p>Hi Zack,</p>
<p>Oh, I'm glad that my example is useful and that you like it:)
Thank you.<br>
Yes, configs classes are cool.<br>
With robotlegs 1, we used commands for the bootstrapping
/configuration process. You can do that with rl2, as well, but
rl2's configs are much more convenient. You don't need any mappings
(commands had to be mapped to events..), thus you write less code.
They are 'clean', because the mappings are grouped together in
categories, mediators, models, services..etc, thus easier to manage
in a large application. In a small application, you could perform
the mappings inside of a single config.</p>
<p>I've read the Starling discussion. If I understand correctly,
you are actually after a way of managing the navigation between
different functional parts of your app. You can have multiple
contexts, each functional area with its own context, if you want.
But, that's not mandatory. You can treat each functional area like
a module, in the sense that it is pretty much self-contained, even
if it doesn't have a separate context. In case the functional areas
are sharing some of the classes, Models, custom events, services,
you create a 'commons' / 'shared' or whatever package for them,
which would be the equivalent of a library project in a
flex-modular application.<br>
Am I'm right in thinking that you need a solution for navigating
and structuring/organizing your pseudo-modules, rather than
creating multiple contexts? If so, and if you need help with this,
you may want to go into details about your use case.</p>
<p>Ondina</p></div>Ondina D.F.