Loading ...
Sorry, an error occurred while loading the content.

Problem with RSL and SWFLoaders

Expand Messages
  • Nick Durnell
    Hi all, I have built a large Flex application which consists of a main application window and a number of widgets that are displayed in various areas of the
    Message 1 of 6 , Dec 18, 2007
    View Source
    • 0 Attachment
      Hi all,

      I have built a large Flex application which consists of a main
      application window and a number of 'widgets' that are displayed in
      various areas of the screen. Each widget is itself a Flex
      application in its own right. When the main application starts up it
      checks which widgets should be loaded and creates SWFLoaders for each
      one.

      As the widgets share a lot of code I have recently created an RSL,
      core.swc, which holds all the common stuff. Unfortunately a lot of
      the widget applications now fail to load/start correctly.

      Here is the typical debug output when running the RSL-based
      application (with 11 widgets):

      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\Main.swf - 254,721 bytes after
      decompression
      # Loading WorldClocks1 (WorldClocks.swf)
      # Loading ComboGrid1 (GroupTreeMarketGridCombo.swf)
      # Loading PositionGrid1 (PositionGrid.swf)
      # Loading PositionGrid2 (PositionGrid.swf)
      # Loading TradeHistoryGrid1 (TradeHistoryGrid.swf)
      # Loading OrderBook1 (OrderBook.swf)
      # Loading AccountTransactions1 (AccountTransactions.swf)
      # Loading CommsControl1 (CommsControlContainer.swf)
      # Loading TradeTicketContainer1 (TradeTicketContainer.swf)
      # Loading AccountSummary1 (AccountSummary.swf)
      # Loading SignalQualityDisplay1 (SignalQualityDisplay.swf)
      [SWF] C:\Dev\Flex\childapps\bin\WorldClocks.swf - 274,452 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\GroupTreeMarketGridCombo.swf -
      330,684 bytes after decompression
      [SWF] C:\Dev\Flex\childapps\bin\PositionGrid.swf - 314,513 bytes
      after decompression
      [SWF] C:\Dev\Flex\childapps\bin\PositionGrid.swf - 314,513 bytes
      after decompression
      [SWF] C:\Dev\Flex\childapps\bin\TradeHistoryGrid.swf - 281,184 bytes
      after decompression
      [SWF] C:\Dev\Flex\childapps\bin\OrderBook.swf - 313,875 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\AccountTransactions.swf - 287,520
      bytes after decompression
      [SWF] C:\Dev\Flex\childapps\bin\CommsControlContainer.swf - 279,246
      bytes after decompression
      [SWF] C:\Dev\Flex\childapps\bin\TradeTicketContainer.swf - 312,721
      bytes after decompression
      [SWF] C:\Dev\Flex\childapps\bin\AccountSummary.swf - 276,915 bytes
      after decompression
      [SWF] C:\Dev\Flex\childapps\bin\SignalQualityDisplay.swf - 275,342
      bytes after decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [SWF] C:\Dev\Flex\childapps\bin\core.swf - 3,096,674 bytes after
      decompression
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      [Unload SWF] C:\Dev\Flex\childapps\bin\core.swf
      # applicationComplete in PositionGrid1
      # applicationComplete in AccountSummary1

      11 out of 11 widget applications are loaded and decompressed but
      applicationComplete only fires in 2 of them! There is no sign of
      life from the other 9 widgets.

      I am guessing that there is an issue somewhere when using multiple
      SWFLoaders at the same time with an RSL. To clarify, everything
      works fine if I do not use the RSL or if I change the main
      application to load one widget, wait for applicationComplete, load
      the next, wait again etc etc - although doing this is *very* slow.

      Also, what is going on with the loading, decompressing and unloading
      of the RSL (core.swf) for each widget? I am wondering if this is
      anything to do with the problem.

      Thoughts, anyone?

      Regards,

      Nick.
    • Alex Harui
      I would try to find out what happened to the other 9? Are they showing progress bars? Is the app stuck? Is CPU usage running high?
      Message 2 of 6 , Dec 18, 2007
      View Source
      • 0 Attachment
        I would try to find out what happened to the other 9?  Are they showing progress bars?  Is the app stuck?  Is CPU usage running high?


        From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Nick Durnell
        Sent: Tuesday, December 18, 2007 6:51 AM
        To: flexcoders@yahoogroups.com
        Subject: [flexcoders] Problem with RSL and SWFLoaders

        Hi all,

        I have built a large Flex application which consists of a main
        application window and a number of 'widgets' that are displayed in
        various areas of the screen. Each widget is itself a Flex
        application in its own right. When the main application starts up it
        checks which widgets should be loaded and creates SWFLoaders for each
        one.

        As the widgets share a lot of code I have recently created an RSL,
        core.swc, which holds all the common stuff. Unfortunately a lot of
        the widget applications now fail to load/start correctly.

        Here is the typical debug output when running the RSL-based
        application (with 11 widgets):

        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\Main. swf - 254,721 bytes after
        decompression
        # Loading WorldClocks1 (WorldClocks. swf)
        # Loading ComboGrid1 (GroupTreeMarketGri dCombo.swf)
        # Loading PositionGrid1 (PositionGrid. swf)
        # Loading PositionGrid2 (PositionGrid. swf)
        # Loading TradeHistoryGrid1 (TradeHistoryGrid. swf)
        # Loading OrderBook1 (OrderBook.swf)
        # Loading AccountTransactions 1 (AccountTransaction s.swf)
        # Loading CommsControl1 (CommsControlContai ner.swf)
        # Loading TradeTicketContaine r1 (TradeTicketContain er.swf)
        # Loading AccountSummary1 (AccountSummary. swf)
        # Loading SignalQualityDispla y1 (SignalQualityDispl ay.swf)
        [SWF] C:\Dev\Flex\ childapps\ bin\WorldClocks. swf - 274,452 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\GroupTreeMar ketGridCombo. swf -
        330,684 bytes after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\PositionGrid .swf - 314,513 bytes
        after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\PositionGrid .swf - 314,513 bytes
        after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\TradeHistory Grid.swf - 281,184 bytes
        after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\OrderBook. swf - 313,875 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\AccountTrans actions.swf - 287,520
        bytes after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\CommsControl Container. swf - 279,246
        bytes after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\TradeTicketC ontainer. swf - 312,721
        bytes after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\AccountSumma ry.swf - 276,915 bytes
        after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\SignalQualit yDisplay. swf - 275,342
        bytes after decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [SWF] C:\Dev\Flex\ childapps\ bin\core. swf - 3,096,674 bytes after
        decompression
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        [Unload SWF] C:\Dev\Flex\ childapps\ bin\core. swf
        # applicationComplete in PositionGrid1
        # applicationComplete in AccountSummary1

        11 out of 11 widget applications are loaded and decompressed but
        applicationComplete only fires in 2 of them! There is no sign of
        life from the other 9 widgets.

        I am guessing that there is an issue somewhere when using multiple
        SWFLoaders at the same time with an RSL. To clarify, everything
        works fine if I do not use the RSL or if I change the main
        application to load one widget, wait for applicationComplete , load
        the next, wait again etc etc - although doing this is *very* slow.

        Also, what is going on with the loading, decompressing and unloading
        of the RSL (core.swf) for each widget? I am wondering if this is
        anything to do with the problem.

        Thoughts, anyone?

        Regards,

        Nick.

      • Nick Durnell
        ... showing ... Hi Alex, I do not see any progress bars for the applications which fail to start. CPU usage is at 0% once the application has stuck . I ve
        Message 3 of 6 , Dec 19, 2007
        View Source
        • 0 Attachment
          --- In flexcoders@yahoogroups.com, "Alex Harui" <aharui@...> wrote:
          >
          > I would try to find out what happened to the other 9? Are they
          showing
          > progress bars? Is the app stuck? Is CPU usage running high?

          Hi Alex,

          I do not see any progress bars for the applications which fail to
          start. CPU usage is at 0% once the application has 'stuck'. I've also
          tried with fewer widgets and get the same problem. As long as there are
          more than one being loaded at once (which share an RSL), one of them
          fails to start.

          Is there anything I can do to check what Flash is doing behind the
          scenes? Any other events on the SWFLoaders/Applications it may be
          useful to listen for?

          Regards,

          Nick.
        • Alex Harui
          I think you d have to debug through it and see what is going on. However, before doing that, is it possible to re-implement this set of apps? Do these
          Message 4 of 6 , Dec 19, 2007
          View Source
          • 0 Attachment

            I think you’d have to debug through it and see what is going on.  However, before doing that, is it possible to re-implement this set of apps?  Do these sub-apps ever need to run on their own?  If not, you should consider using Modules.  If that’s too big an effort but those sub-apps don’t need to run on their own, you should not build them using RSLs and simply extern all of the classes in the RSL when you build them.  It will prevent them from even trying to load the RSL, but they’ll remain small and run fine because they’ll find the classes in the main app’s applicationDomain.  This should make your sub-apps show up even faster since they don’t need to wait for the 3MB RSL load.  I would expect this to solve your problem as well as there might be issues when more than one loader is trying to load the same bits.

             


            From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com ] On Behalf Of Nick Durnell
            Sent: Wednesday, December 19, 2007 2:53 AM
            To: flexcoders@yahoogroups.com
            Subject: [flexcoders] Re: Problem with RSL and SWFLoaders

             

            --- In flexcoders@yahoogro ups.com, "Alex Harui" <aharui@...> wrote:

            >
            > I would try to find out what happened to the other 9? Are they
            showing
            > progress bars? Is the app stuck? Is CPU usage running high?

            Hi Alex,

            I do not see any progress bars for the applications which fail to
            start. CPU usage is at 0% once the application has 'stuck'. I've also
            tried with fewer widgets and get the same problem. As long as there are
            more than one being loaded at once (which share an RSL), one of them
            fails to start.

            Is there anything I can do to check what Flash is doing behind the
            scenes? Any other events on the SWFLoaders/Applicat ions it may be
            useful to listen for?

            Regards,

            Nick.

          • Nick Durnell
            ... of ... those ... using ... in ... show ... I ... issues ... Hi Alex, It certainly looks like a problem with multiple loaders loading the same stuff at the
            Message 5 of 6 , Dec 20, 2007
            View Source
            • 0 Attachment
              --- In flexcoders@yahoogroups.com, "Alex Harui" <aharui@...> wrote:
              >
              > I think you'd have to debug through it and see what is going on.
              > However, before doing that, is it possible to re-implement this set
              of
              > apps? Do these sub-apps ever need to run on their own? If not, you
              > should consider using Modules. If that's too big an effort but
              those
              > sub-apps don't need to run on their own, you should not build them
              using
              > RSLs and simply extern all of the classes in the RSL when you build
              > them. It will prevent them from even trying to load the RSL, but
              > they'll remain small and run fine because they'll find the classes
              in
              > the main app's applicationDomain. This should make your sub-apps
              show
              > up even faster since they don't need to wait for the 3MB RSL load.
              I
              > would expect this to solve your problem as well as there might be
              issues
              > when more than one loader is trying to load the same bits.

              Hi Alex,

              It certainly looks like a problem with multiple loaders loading the
              same stuff at the same time. I have logged bug SDK-14085 for this.

              Unfortunately I cannot try your suggestions because each application
              does indeed have to be able to run on its own - the system I have
              created allows the applications to be removed from the main
              application window and opened in a new browser window. They can then
              be resized/minimised/moved to different monitors etc etc.

              Thanks for your help with this,

              Nick.
            • Alex Harui
              Have you tried using the framework RSL caching? Can you have a shell for applets so they never run on their own even when pulled out into their own browser
              Message 6 of 6 , Dec 26, 2007
              View Source
              • 0 Attachment
                Have you tried using the framework RSL caching?
                 
                Can you have a "shell" for applets so they never run on their own even when pulled out into their own browser window?


                From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Nick Durnell
                Sent: Thursday, December 20, 2007 1:31 AM
                To: flexcoders@yahoogroups.com
                Subject: [flexcoders] Re: Problem with RSL and SWFLoaders

                --- In flexcoders@yahoogro ups.com, "Alex Harui" <aharui@...> wrote:

                >
                > I think you'd have to
                debug through it and see what is going on.
                > However, before doing that,
                is it possible to re-implement this set
                of
                > apps? Do these sub-apps
                ever need to run on their own? If not, you
                > should consider using
                Modules. If that's too big an effort but
                those
                > sub-apps don't need
                to run on their own, you should not build them
                using
                > RSLs and simply
                extern all of the classes in the RSL when you build
                > them. It will
                prevent them from even trying to load the RSL, but
                > they'll remain small
                and run fine because they'll find the classes
                in
                > the main app's
                applicationDomain. This should make your sub-apps
                show
                > up even
                faster since they don't need to wait for the 3MB RSL load.
                I
                > would
                expect this to solve your problem as well as there might be
                issues
                >
                when more than one loader is trying to load the same bits.

                Hi Alex,

                It certainly looks like a problem with multiple loaders loading the
                same stuff at the same time. I have logged bug SDK-14085 for this.

                Unfortunately I cannot try your suggestions because each application
                does indeed have to be able to run on its own - the system I have
                created allows the applications to be removed from the main
                application window and opened in a new browser window. They can then
                be resized/minimised/ moved to different monitors etc etc.

                Thanks for your help with this,

                Nick.

              Your message has been successfully submitted and would be delivered to recipients shortly.