2 Replies Latest reply on Sep 9, 2012 4:03 PM by code_away

    GIF throwing error; PNG doesn't in mx:Button-Flex 4.5.1a

    code_away Level 1

      I've converted my flex 3 app to flex 4 (using 4.5.1a). Anyhow, the below mxml which is in a popup window (ItemDetails) throw an error. When I change printer.gif to printer.png, the popup appears and no error appears. Under my assets folder and have a printer.gif and printer.png file. Any thoughts on what is causing the error???

       

      MXML:

      <mx:Button  id = "btnPrint" click = "printWindow();" toolTip="Print" icon="@Embed(source='assets/printer.gif')" x="601" y="32"  width="49"/>

       

      Error:

      ReferenceError: Error #1065: Variable ItemDetails__embed_mxml_assets_printer_gif_1274103970 is not defined.

                at ItemDetails()

                at mx.managers::PopUpManagerImpl/createPopUp()

                at mx.managers::PopUpManager$/createPopUp()

                at MyProject/btnPrintClick()

                at MyProject/__btnPrintMenu_click()

       

       

      - code_away

        • 1. Re: GIF throwing error; PNG doesn't in mx:Button-Flex 4.5.1a
          code_away Level 1

          Now I'm not sure the file type has anything to do with it. I added a new field to the popup ItemDetails form, then after copying the new SWF and hitting refresh, I get the below error. I then simply recompiled the app (without making changes) and replaced the SWF, then the error went away. This is truly sporadic.

           

          ReferenceError: Error #1065: Variable ItemDetails__embed_mxml_assets_printer_png_1274121104 is not defined.

            at flash.display::MovieClip/nextFrame()

                    at mx.managers::SystemManager/deferredNextFrame()

                    at mx.managers::SystemManager/preloader_preloaderDocFrameReadyHandler()

                    at flash.events::EventDispatcher/dispatchEventFunction()

                    at flash.events::EventDispatcher/dispatchEvent()

                    at mx.preloaders::Preloader/timerHandler()

                    at flash.utils::Timer/_timerDispatch()

                    at flash.utils::Timer/tick()

          • 2. Re: GIF throwing error; PNG doesn't in mx:Button-Flex 4.5.1a
            code_away Level 1

            This is by far the biggest anomaly I've seen in Flex. The SWF throws the error, then after recompiling and using the new SWF twice (without changing the source code), it works the second time.

             

            In my research I found this post: http://kachurovskiy.com/2010/storing-icons-in-external-zip-and-seamless-work-with-composit e-icons/

             

            I'm not the only one who has experienced this issue - (Google "Flex ReferenceError: Error #1065 ")