flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Running flex modules from html shell
Date Mon, 14 Sep 2015 17:31:59 GMT


On 9/14/15, 3:59 AM, "mark goldin" <markzolotoy@gmail.com> wrote:

>Yes, that would be the ideal solution. The only thing is how are we going
>to show these modules inside of html shell? An application can be run like
>this:
><body>
>    <iframe id="ff"  style="width:100%;height:100%;" scroll="no"
>        src="http://localhost/index.html">
>    </iframe>
></body>
>
>where index.html is a wrapper for swf file. But in case of a module how
>will it work?

I would assume you plan to re-use the iframe, so switching between
“modules” would result in code like:

 ff.src = “<some other URL>”/

I think folks are suggesting you replace the <iframe> with the <object>
tag that loads a single Flash/Flex SWF called something like
“moduleshell.swf”, which might just look like:

<mx:Application width=“100%”, height=“100%” creationComplete=“setup()">
  <fx:Script>
    private function setup():void
    {
       ExternalInterface.addCallback(“myCallback”, myCallback);
    }
    private function myCallback(url:String):void
    {
       ml.url = url;
    } 
  </fx:Script>
  <mx:ModuleLoader id=“ml” width=“100%” height=“100%” />
</mx:Application>

Then I think you can just call

  ff.myCallback(“<some other URL>”);

-Alex


>
>On Sun, Sep 13, 2015 at 10:48 PM Alex Harui <aharui@adobe.com> wrote:
>
>> I guess I don’t understand why you need to drive a bunch of modules
>> directly from HTML.  Why not have a single module loader that loads the
>> modules based on commands via ExternalInterface?
>>
>> -Alex
>>
>> On 9/13/15, 4:11 AM, "mark goldin" <markzolotoy@gmail.com> wrote:
>>
>> >What I am not sure of is how I am going to imitate Flex content inside
>>of
>> >the html shell. I am thinking to convert Flex modules into applications
>> >and
>> >them like this from the html:
>> ><body>
>> >    <iframe id="ff"  style="width:100%;height:100%;" scroll="no"
>> >        src="http://localhost/newapp.swf">
>> >    </iframe>
>> ></body>
>> >Then use localStorage to exchange data between.
>> >
>> >On Sat, Sep 12, 2015 at 11:39 PM Dave Glasser <dglasser@pobox.com>
>>wrote:
>> >
>> >> > > a module is not an application and cannot run without one.
>> >> That's true, At minimum, you'll need a shell application that loads
>>and
>> >> displays the modules. You can reload the shell app each time the
>>module
>> >> changes, and pass the module parameter into it through flashvars. The
>> >> browser caching would mean it wasn't downloaded each time, but you
>>would
>> >> still have to wait for the app to start up and initialize itself each
>> >>time
>> >> you switched modules. It would probably be better to have the shell
>>app
>> >> stay loaded and script it from Javascript like pkumar suggested.
>>Plus,
>> >>you
>> >> could have application state that persists from one module load to
>> >>another.
>> >> If it were me, I would probably alter your current main app to run in
>> >> "shell mode" and not display its menu, and add the ability to
>>control it
>> >> from Javascript.
>> >>
>> >>       From: mark goldin <markzolotoy@gmail.com>
>> >>  To: users@flex.apache.org
>> >>  Sent: Friday, September 11, 2015 11:12 AM
>> >>  Subject: Re: Running flex modules from html shell
>> >>
>> >> But that means I have the load the whole Flex application. How am I
>>am
>> >> going to share the screen between Flex and html?
>> >>
>> >>
>> >>
>> >> On Fri, Sep 11, 2015 at 9:51 AM pkumar.flex <prashakumar@gmail.com>
>> >>wrote:
>> >>
>> >> > You can use ExternalInterface.addCallback(). This function
>>basically
>> >>use
>> >> > for calling Flex function from javascript.
>> >> > you only need to call a javascript function and then java script
>>will
>> >> call
>> >> > Flex function to load module.
>> >> >
>> >> > On Fri, Sep 11, 2015 at 2:06 PM, mark goldin [via Apache Flex
>>Users] <
>> >> > ml-node+s2333346n11171h86@n4.nabble.com> wrote:
>> >> >
>> >> > > I am looking for some ideas if anything to do the following.
>> >> > > The main Flex application screen is constructed as a top
>>horizontal
>> >> menu.
>> >> > > When a menu item is clicked a Flex module is loaded and it's
>>shown
>> >> > > underneath of the top menu. I am trying to replicate the main
>>page
>> >>in
>> >> > html
>> >> > > which would have the same top menu and fire Flex modules. I
>> >>understand
>> >> > > that
>> >> > > a module is not an application and cannot run without one. Any
>>idea
>> >>of
>> >> > > making it work without substantial refactoring?
>> >> > >
>> >> > > Thanks
>> >> > >
>> >> > >
>> >> > > ------------------------------
>> >> > > If you reply to this email, your message will be added to the
>> >> discussion
>> >> > > below:
>> >> > >
>> >> > >
>> >> >
>> >>
>> >>
>> 
>>http://apache-flex-users.2333346.n4.nabble.com/Running-flex-modules-from-
>> >>html-shell-tp11171.html
>> >> > > To unsubscribe from Apache Flex Users, click here
>> >> > > <
>> >> >
>> >>
>> >>
>> 
>>http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?m
>> 
>>>>acro=unsubscribe_by_code&node=1&code=cHJhc2hha3VtYXJAZ21haWwuY29tfDF8LT
>>>>U0
>> >>MTcyMzE2NA==
>> >> > >
>> >> > > .
>> >> > > NAML
>> >> > > <
>> >> >
>> >>
>> >>
>> 
>>http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?m
>> 
>>>>acro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.nam
>>>>l.
>> 
>>>>namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabb
>>>>le
>> 
>>>>.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabbl
>>>>e%
>> 
>>>>3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21
>>>>na
>> >>bble%3Aemail.naml
>> >> > >
>> >> > >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > *Regards,*
>> >> > Prashant Kumar* | *Mob.: +91 8408811225
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> >
>> >>
>> >>
>> 
>>http://apache-flex-users.2333346.n4.nabble.com/Running-flex-modules-from-
>> >>html-shell-tp11171p11173.html
>> >> > Sent from the Apache Flex Users mailing list archive at Nabble.com.
>> >> >
>> >>
>> >>
>>
>>

Mime
View raw message