6 Replies Latest reply on Feb 16, 2011 5:05 PM by AlHolden

    Build SWC file using command line compiler

    Zolotoj Level 3

      I am getting the following error during compilation:

      Command line: Error: unable to open 'manifest.xml'

       

      Any help?

       

      Thanks

        • 1. Re: Build SWC file using command line compiler
          Zolotoj Level 3

          I was finally able to run a compilation for MaskedTextInput component. I am getting errors. Can someone please help?

           

          Microsoft Windows [Version 6.0.6002]
          Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
          
          C:\Users\mgoldin>h:
          
          H:\>cd H:\projects\sfcs\MaskedTextInput
          
          H:\projects\sfcs\MaskedTextInput>buildswc.bat
          File not found - FWPATH.TXT
          Could Not Find H:\projects\sfcs\MaskedTextInput\fwpath.txt
          Loading configuration file D:\Program Files (x86)\Adobe\Adobe Flash Builder Beta
           2\sdks\4.0.0\frameworks\flex-config.xml
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as: Err
          or: Can not resolve a multiname reference unambiguously. MaskedTextInput (from H
          :\projects\sfcs\MaskedTextInput\src\MaskedTextInput.as) and com.adobe.flex.extra
          s.controls:MaskedTextInput (from H:\projects\sfcs\MaskedTextInput\src\com\adobe\
          flex\extras\controls\MaskedTextInput.as) are available.
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as(54):
           col: 16 Error: Access of undefined property MaskedTextInput.
          
                          if(parent is MaskedTextInput)
                                       ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as(55):
           col: 19 Error: Call to a possibly undefined method MaskedTextInput.
          
                          cellWidth = MaskedTextInput(parent).measureText("W").width;
                                      ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as(63):
           col: 10 Error: Call to a possibly undefined method MaskedTextInput.
          
                          if(MaskedTextInput(parent).required)
                             ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as(77):
           col: 18 Error: Access of undefined property MaskedTextInput.
          
                                          if(parent is MaskedTextInput)
                                                       ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as(81):
           col: 10 Error: Call to a possibly undefined method MaskedTextInput.
          
                                                          if(MaskedTextInput(parent).maskM
          ap[i][1] && MaskedTextInput(parent)._working[i] == " ")
                                                             ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as(81):
           col: 51 Error: Call to a possibly undefined method MaskedTextInput.
          
                                                          if(MaskedTextInput(parent).maskM
          ap[i][1] && MaskedTextInput(parent)._working[i] == " ")
          
                      ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as(83):
           col: 35 Error: Call to a possibly undefined method MaskedTextInput.
          
                                                                  g.drawRect(x1,y1,cellWid
          th,MaskedTextInput(parent).height-5);
          
             ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\skins\MTISkin.as(79):
           col: 24 Error: Call to a possibly undefined method MaskedTextInput.
          
                                                  for(var i:int=0;i<MaskedTextInput(parent
          ).maskMap.length;i++)
                                                                    ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\controls\MaskedTextIn
          put.as(534): col: 44 Error: Implicit coercion of a value of type mx.core:IUIText
          Field to an unrelated type flash.display:DisplayObject.
          
                                  addChildAt(embedTextField,getChildIndex(textField));
                                                                          ^
          
          H:\projects\sfcs\MaskedTextInput\src\com\adobe\flex\extras\controls\MaskedTextIn
          put.as(1325): col: 45 Error: Implicit coercion of a value of type mx.core:IUITex
          tField to an unrelated type flash.display:DisplayObject.
          
                                          addChildAt(embedTextField,getChildIndex(textFiel
          d));
                                                                                  ^
          
          H:\projects\sfcs\MaskedTextInput>
          

          • 2. Re: Build SWC file using command line compiler
            levancho Level 3

            error seems obviouse to me, you have some compilation/syntax error taht you need to fix ,maybe missing import.

            • 3. Re: Build SWC file using command line compiler
              Zolotoj Level 3

              Well, it's not my source code, I dont know much about it. I did some research on the Web to find out why it does not dispatch a change event. I have found an answer that suggests to add one line of code. Same error is produced while compiling without my code.

              • 4. Re: Build SWC file using command line compiler
                Darrell Loverin Level 4

                I don't see the commands you are using to build the swc, only the error messages.

                 

                compc is the command line tool used to build swcs. Please check out the documentation here: http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf69084-7fd2.ht ml

                 

                 

                -Darrell

                • 5. Re: Build SWC file using command line compiler
                  Zolotoj Level 3

                  Here is a script I am using:

                   

                  @echo off

                  if NOT (%SDKDIR%)==() goto :checkCompc

                   

                  regedit /e fwpath.txt "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flex Builder 2"

                  for /f " tokens=2 delims==" %%f  in ('find "FrameworkPath" fwpath.txt') do set SDKDIR=%%f

                  del fwpath.txt

                   

                  if (%SDKDIR%)==() set SDKDIR="D:\Program Files (x86)\Adobe\Adobe Flash Builder Beta 2\sdks\4.0.0"

                   

                  :checkCompc

                   

                  if exist "%SDKDIR:"=%\bin\compc.exe" goto :build

                  echo Error: Could not find compc.exe, please install FlexBuilder or set SDKDIR environment variable to flex framework directory.

                  exit /b

                   

                  :build

                  "%SDKDIR:"=%\bin\compc.exe" -source-path src -output bin\MaskedTextInput.swc -include-namespaces=http://www.adobe.com/2006/fc -namespace http://www.adobe.com/2006/fc H:\projects\sfcs\MaskedTextInput\manifest.xml -include-classes com.adobe.flex.extras.skins.MTISkin -library-path %SDKDIR%\frameworks\libs

                   

                  • 6. Re: Build SWC file using command line compiler
                    AlHolden Level 1

                    I know this thread is aged, but I found it during a search for "MaskedTextInput" and "Flex 4", and (from examination of the trace above) the cause looks the same. I wanted to tag this with the workaround I used.

                     

                    I think that Zolotoj was trying to compile the com resource of the custom component MaskedTextInput (created by the Adobe Flex team in 2006) using the compiler in Flex/FlashBuilder 4. This produced the following compiler error for me - in two places

                    Implicit coercion of a value of type mx.core:IUIText Field to an unrelated type flash.display:DisplayObject

                     

                    What I did was add some explicit casting to the file MaskedTextInput.as around lines 534 and 1325. I changed:

                    addChildAt(embedTextField,getChildIndex(textField));

                    To this:

                     

                    addChildAt(embedTextField,getChildIndex(textField as DisplayObject));

                    At this point the Library project I was working on was able to compile successfully under Flex SDK 4.1 - and the component seems to be working OK for me as a date input device.

                     

                    I hope this prevents hours of future searching madness for any Flex geeks who follow me...