0 Replies Latest reply on Feb 7, 2012 12:41 PM by alinator11

    Each publish of SWC makes children of other SWC's null

    alinator11 Level 2

      I have a mobile app that has 6 SWC animations as part of it. The SWC's all have the same children but are slightly different animations. I took each fla, converted to a Flex component, published and tested each in succession. Once I got a good test of all SWC loading to the mobile (Android) screen and displaying children as expected, I started my test over with SWC number 1. It failed.


      I tried uncovering what had changed between the first time I tested and the last time I tested and could identify nothing. I republished the SWC as part of that search and then updated the Flex build path with the latest SWC. All the sudden SWC 1 works so I test SWC 2. Same deal (it's now broken). I publish SWC 2 again and test. It works. Then I go back and test SWC 1 again and it is now broken!!!!


      This is a little of the Flex mobile code to put this in perspective:


                     else if(movieNumber == 5) {

                              poloroid = Poloroid(shooterFive.getChildByName("eventPhoto"));                       

                              eventPhotoLayer = EventPhotoLayer(shooterFive.getChildByName("eventPhotoLayer"));

                              textAndBossLayer = TextAndBossLayer(shooterFive.getChildByName("textAndBossLayer"));

                              bossPicFrame = BossFrame(shooterFive.getChildByName("bossFrame"));


                          else if(movieNumber == 6) {

                              poloroid = Poloroid(shooterSix.getChildByName("eventPhoto"));                       

                              eventPhotoLayer = EventPhotoLayer(shooterSix.getChildByName("eventPhotoLayer"));                       

                              textAndBossLayer = TextAndBossLayer(shooterSix.getChildByName("textAndBossLayer"));                       

                              bossPicFrame = BossFrame(shooterSix.getChildByName("bossFrame"));




      If I publish the SWC related to number 5 and test, 5 will work fine but 6 no longer will. If I publish 6 it starts working but 5 breaks.


      I put in trace statements and find that Poloroid and EventPhotoLayer get created no matter what. What is breaking is BossFrame and TextAndBossLayer. With each publish, the latest SWC becomes the only SWC that won't have a null BossFrame and TextAndBossLayer. Any ideas how I can fix this?


      I tried giving unique instance names to each FLA's children and then publishing (e.g. "textAndBossLayer1", "testAndBossLayer2", etc). That made no difference. For some reason, only the latest version of the SWC that contains BossFrame will have a non-null BossFrame (and TextAndBossLayer) when I run but other objects don't have the same problem.


      Message was edited by: alinator11