3 Replies Latest reply on Dec 17, 2008 1:17 PM by Newsgroup_User

    how to assign a flex module to a html tag

    atanum
      Hi, we have a web application where the html page has multiple flex apps. An example is

      <div id="flash1"'>
      <object ....
      <param name="movie" value="main1.swf" /> >
      ....
      </object>
      </div>
      <div id="flash2"'>
      <object ....
      <param name="movie" value="main2.swf" /> >
      ....
      </object>
      </div>

      This type of architecture appears to consume a lot of resources. We want to use Flex modules where we would like to load only a thin parent app under some <div> tags. This parent app will in turn load modules such as main1.swf and main2.swf. However the objective is main1.swf module should be displayed under div "flash1" and main2.swf module should be displayed under div "flash2". Thus we will be able to limit the number of flash players to one.

      I have not found any documentation where I can assign a module to load under a specified html tag. I am not sure if this possible. If yes, can you please point me in the right direction ? Appreciate any help !!!

      Best regards
        • 1. Re: how to assign a flex module to a html tag
          matthew horn Level 3
          Can you use JavaScript or whatever scripting engine (maybe PHP or ASP.NET) is available to embed the right SWF at the time of the page request?

          BTW, if you are running the latest version of Flex (3.02), you should check out the differences between using SWFLoader and modules to load SWFs. You might find that loading apps is better suited to your needs than loading modules.

          matt horn
          flex docs
          • 2. Re: how to assign a flex module to a html tag
            atanum Level 1
            Thanks for your reply.


            <<Can you use JavaScript or whatever scripting engine (maybe PHP or ASP.NET) is available to embed the right SWF at the time of the page request?>>

            No, it is the requirement to show both the SWFs on the same page. Actually there are some pages in our webapp where there will be four SWFs to be displayed. Can you please confirm that two SWF files on this page (in my example) will invoke two separate instances of flash player on my page. If yes, that is what I want to prevent. Is there any way I can use the one flash player instance will run multiple SWFs on the page ?


            <<BTW, if you are running the latest version of Flex (3.02), you should check out the differences between using SWFLoader and modules to load SWFs. You might find that loading apps is better suited to your needs than loading modules.>>

            Is SWFLoader more memory efficient than the regular flash player ? Please excuse my ignorance as I could not understand what advantages SWFLoader may bring.

            Best regards
            Atanu
            • 3. Re: how to assign a flex module to a html tag
              Level 7

              "atanum" <webforumsuser@macromedia.com> wrote in message
              news:gibnto$i5b$1@forums.macromedia.com...
              > Thanks for your reply.
              >
              >
              > <<Can you use JavaScript or whatever scripting engine (maybe PHP or
              > ASP.NET)
              > is available to embed the right SWF at the time of the page request?>>
              >
              > No, it is the requirement to show both the SWFs on the same page. Actually
              > there are some pages in our webapp where there will be four SWFs to be
              > displayed. Can you please confirm that two SWF files on this page (in my
              > example) will invoke two separate instances of flash player on my page. If
              > yes,
              > that is what I want to prevent. Is there any way I can use the one flash
              > player
              > instance will run multiple SWFs on the page ?

              If you use one really tall swf, you can make it appear to be several
              separate apps.

              >
              > <<BTW, if you are running the latest version of Flex (3.02), you should
              > check
              > out the differences between using SWFLoader and modules to load SWFs. You
              > might
              > find that loading apps is better suited to your needs than loading
              > modules.>>
              >
              > Is SWFLoader more memory efficient than the regular flash player ? Please
              > excuse my ignorance as I could not understand what advantages SWFLoader
              > may
              > bring.

              SWFLoader is a component that's part of the Flex framework. It's one way to
              load swf's into a parent swf.