Skip navigation
Currently Being Moderated

Type was not found or was not a compile-time constant: ImportExportConfiguration

Feb 25, 2010 2:58 AM

Hi,

     I am using text layout framework and getting an error type was not found or was not a compile-time constant: ImportExportConfiguration. I am using Flex Builder 3 , Flex SDK version flex_sdk_4.0.0.10485 and flash player 10.0.12 , Surprisingly this error not located in my project workspace.

In my code i uses

 

import flashx.textLayout.container.DisplayObjectContainerController;

    

Help

Thanks

Gaurav kumar Pandey

 
Replies
  • Currently Being Moderated
    Feb 25, 2010 10:29 AM   in reply to gauravk.pandey

    You are using an older version of our code. I suggest you update to the latest code, see: http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK.

     

    You don't need to use the Flex Framework, but it comes with the latest textLayout libraries and source code.

     

    Hope this helps,

     

    - robin

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 1, 2010 10:02 PM   in reply to gauravk.pandey

    Can you tell me what is the code you are trying to run? You have TLF, and you are trying to run it with some code. Can you tell me what that code is? Does it work with a very simple example? ITextLineCreator is an old API, that is not present in the new code. But if you are trying to run TLF with some old example code, that could explain your difficulty.

     

    Thanks,

     

    - robin

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2010 8:50 PM   in reply to gauravk.pandey

    Glad you got it working!

     

    If you build the build.xml that comes with TLF, it will build the docs for you. You can do this using Ant. The docs for TLF are not posted online yet.

     

    Thanks!

     

    - robin

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2010 9:16 PM   in reply to robin.briggs

    You can also get the documentation for a particular Flex SDK 4 build under the "Language Reference" links here:

     

    http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4

     

    This will include the docs for the TLF build that SDK uses.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 30, 2010 2:27 AM   in reply to gauravk.pandey

    Hi Gaurav,

     

    How were you able to solve that problem... "" 1046: Type was not found...:ImportExportConfiguration""

     

    I want to shift my project from flex SDK 3.5 to 4.0 and m facing this error.

     

    Were you earlier working in flex 3.5.

     

    Help

     

     

     

    Regards,

    Nitika Agarwal

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 21, 2011 4:00 AM   in reply to gauravk.pandey

    hi,

     

    I got same issue but in custome componets.

     

    like:

     

    Type was not found or was not a compile-time constant: spinner

    Type was not found or was not a compile-time constant: winprogress

     

    Is any one know why this happen ?

     

    dhruv

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2011 5:23 PM   in reply to singh.dhruv

    I don't think these are TLF errors. Can you tell me what you're trying to build?

     

    Thanks,

     

    - robin

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 5, 2011 12:49 AM   in reply to gauravk.pandey

    I have same problem with can't use  TextConverter.importToFlow(...) , it show "type was not found or was not a compile-time constant: ImportExportConfiguration".My lib have a textLayout.swc component and I use it,my code as flow :

     

    import .... ;

     

    public class SimpleEditor extends MovieClip
    {

      private var _textFlow:TextFlow;
         

      public function SimpleEditor ()
      {

        
       var loader:URLLoader = new URLLoader();
       loader.load (new URLRequest("SimpleText.xml"));
       loader.addEventListener (Event.COMPLETE, loadCompleteHandler);
       }

      //
      private function loadCompleteHandler (e:Event):void
      {
      _textFlow = TextConverter.importToFlow( e.target.data,TextConverter.TEXT_FIELD_HTML_FORMAT);
      }

    }

     

    why ? if I delete  textLayout.swc  from my lib, it can work ! 

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 8, 2011 1:34 AM   in reply to gauravk.pandey

    It still can't work ! I use Flash CS5 and sdk is 4.0.In publish setting it have textLayout.swc and flex.swc form path of lib.When I add  TextConverter.export(..),it show Error 1046: Type was not found or was not a compile-time constant: importExportConfiguration.My code as flow :

     


    package
    {

    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.formats.IParagraphFormat;
    import flashx.textLayout.formats.ParagraphFormat;
    import flashx.textLayout.formats.ICharacterFormat;
    import flashx.textLayout.formats.CharacterFormat;
    import flashx.textLayout.formats.IContainerFormat;
    import flashx.textLayout.formats.ContainerFormat;
    import flashx.textLayout.formats.TextAlign;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.edit.UndoManager;
    import flashx.textLayout.edit.ElementRange;
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.events.StatusChangeEvent;
    import flashx.textLayout.events.SelectionEvent;
    import flash.events.Event;
    import flash.events.KeyboardEvent;
    import flash.events.IOErrorEvent;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.display.MovieClip;
    import flash.display.Stage;
    import flash.display.StageScaleMode;
    import flash.display.StageAlign;
    import flash.ui.Keyboard;
    import flash.text.Font;
    import flash.geom.Rectangle;
    import flashx.textLayout.conversion.ConversionType;
    import flash.events.MouseEvent;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.container.ContainerController;
    import fl.events.ColorPickerEvent;
    import fl.motion.Color;
    import flash.geom.ColorTransform;


    public class SimpleEditor extends MovieClip
    {

      private var _textFlow:TextFlow;
            private var testFlow:TextFlow;

     

      public function SimpleEditor ()
      {

       TextFlow.defaultConfiguration.noFocusSelectionFormat = TextFlow.defaultConfiguration.focusSelectionFormat;
       //initWidgets ();
       //initStage ();
      
       var loader:URLLoader = new URLLoader();
       loader.load (new URLRequest("SimpleText.xml"));
       loader.addEventListener (Event.COMPLETE, loadCompleteHandler);
       }

             //
    private function loadCompleteHandler (e:Event):void
      {
       myTextLayout.xmlText = e.target.data;
       initTextFlow ();
     
      }
           //
           private function initTextFlow ():void
      {
       _textFlow = myTextLayout.textFlow;
                _textFlow.addEventListener (StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGED, graphicChanged);
       _textFlow.addEventListener (SelectionEvent.SELECTION_CHANGE,selectionChangeListener,false,0,true );
       
       _textFlow.flowComposer.updateAllContainers ();
       
       _textFlow.interactionManager.setSelection (0,0);
       _textFlow.interactionManager.setFocus ();
      
      
      var xmlOut:XML = TextConverter.export(_textFlow,TextConverter.TEXT_LAYOUT_FORMAT,Conve rsionType.XML_TYPE) as XML;
      }

     

           private function initWidgets ():void
      {
       populateFontFamily ();
       direction.addEventListener (Event.CHANGE, changeDirection);
       blockprogression.addEventListener (Event.CHANGE, changeBlockProgression);
       verticalalign.addEventListener (Event.CHANGE, changeVerticalAlign);
       columngap.addEventListener (KeyboardEvent.KEY_UP, changeColumnGap);
       columncount.addEventListener (KeyboardEvent.KEY_UP, changeColumnCount);
       textindent.addEventListener (KeyboardEvent.KEY_UP, changeTextIndent);
       textalign.addEventListener (Event.CHANGE, changeTextAlign);
       lineheight.addEventListener (KeyboardEvent.KEY_UP, changeLineHeight);
       fontsize.addEventListener (KeyboardEvent.KEY_UP, changeFontSize);
       fontfamily.addEventListener (Event.CHANGE, changeFontFamily);
       btnItalic.addEventListener (MouseEvent.CLICK, changeFontItalic);
       btnBold.addEventListener (MouseEvent.CLICK, changeFontBold);  
       fromPicker.addEventListener (ColorPickerEvent.CHANGE, changeColor);

     

      }
     
      private function initStage ():void
      {
       stage.scaleMode = StageScaleMode.NO_SCALE;
       stage.align = StageAlign.TOP_LEFT;
       stage.addEventListener (Event.RESIZE, resizeHandler);
      }
          //
          private function populateFontFamily ():void
      {
       // try to add fonts to the drop down
       var fonts:Array = Font.enumerateFonts(true);
       fonts.sortOn ("fontName", Array.CASEINSENSITIVE);
       for (var i:int = 0; i< fonts.length; i++)
       {
        fontfamily.dataProvider.addItem ({label: fonts[i].fontName, data: fonts[i].fontName});
        //trace( fonts[i].fontName);
       }
      }
          
        private function graphicChanged (sce:StatusChangeEvent):void
      {
       _textFlow.flowComposer.updateAllContainers();
       
      }

      private function selectionChangeListener (e:SelectionEvent):void
      {
       // set display according to the values at the beginning of the selection range
       var paragraphFormat:IParagraphFormat = e.selectedElementRange.paragraphFormat;
       var characterFormat:ICharacterFormat = e.selectedElementRange.characterFormat;
       var containerFormat:IContainerFormat = e.selectedElementRange.containerFormat;

       // update the different comboboxes so their selectedItem matches the current selection
       updateComboBox (fontfamily, characterFormat.fontFamily);// font family
       updateComboBox (textalign, paragraphFormat.textAlign);// text alignment
       updateComboBox (verticalalign,containerFormat.verticalAlign);// vertical alignment
       updateComboBox (blockprogression,_textFlow.computedContainerFormat.blockProgression) ;// block progressions
       updateComboBox (direction,_textFlow.getComputedColumnDirection());// direction

       // update the different text input entries
       fontsize.text = characterFormat.fontSize.toString();// font size
       lineheight.text = characterFormat.lineHeight.toString();// line height
       textindent.text = paragraphFormat.textIndent.toString();// indentation
       columncount.text = containerFormat.columnCount.toString();// number of columns
       columngap.text = containerFormat.columnGap.toString();// gaps/gutter width
       
       //TextConverter.export(_textFlow,TextConverter.TEXT_LAYOUT_FORMAT,Con versionType.XML_TYPE);
      
      }


      private function updateComboBox (box:ComboBox,val:String):void
      {
       for (var i:int = 0; i < box.dataProvider.length; i++)
       {
        if (box.dataProvider.getItemAt(i).data == val)
        {
         box.selectedIndex = i;
         return;
        }
       }
       box.text = val;
      }
    //
      private function changeFontFamily (e:Event):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager)
       {
        var cf:CharacterFormat = new CharacterFormat();
        cf.fontFamily = ComboBox(e.currentTarget).selectedItem.data;
        IEditManager(_textFlow.interactionManager).applyCharacterFormat (cf);
        _textFlow.interactionManager.setFocus ();
       }
      }
      private function changeFontSize (ke:KeyboardEvent):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager && ke.keyCode == Keyboard.ENTER)
       {
        var cf:CharacterFormat = new CharacterFormat();
        cf.fontSize = TextInput(ke.currentTarget).text;
        
        IEditManager(_textFlow.interactionManager).applyCharacterFormat (cf);
        _textFlow.interactionManager.setFocus ();
       }
       //TextConverter.export(_textFlow,TextConverter.TEXT_LAYOUT_FORMAT,Con versionType.XML_TYPE);
      }
      //
      private function changeFontItalic (e:MouseEvent):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager)
       {
        var cf:CharacterFormat = new CharacterFormat();
        cf.fontStyle="italic";    
        IEditManager(_textFlow.interactionManager).applyCharacterFormat (cf);
        _textFlow.interactionManager.setFocus ();
       }
      }
      //
      private function changeFontBold (e:MouseEvent):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager)
       {
        var cf:CharacterFormat = new CharacterFormat();
        cf.fontWeight="bold";       
        IEditManager(_textFlow.interactionManager).applyCharacterFormat (cf);
        _textFlow.interactionManager.setFocus ();
       }
      }
      //

     

      private function changeColor (e:ColorPickerEvent):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager)
       {
        var clipTransform:ColorTransform=new ColorTransform();
                   
        var cf:CharacterFormat = new CharacterFormat();
        clipTransform.color=fromPicker.selectedColor;

     

                 
        cf.color=clipTransform.color;
        IEditManager(_textFlow.interactionManager).applyCharacterFormat (cf);
        _textFlow.interactionManager.setFocus ();
        
       }
      }
      //
      private function changeLineHeight (ke:KeyboardEvent):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager && ke.keyCode == Keyboard.ENTER)
       {
        var cf:CharacterFormat = new CharacterFormat();
        cf.lineHeight = TextInput(ke.currentTarget).text;
        IEditManager(_textFlow.interactionManager).applyCharacterFormat (cf);
        _textFlow.interactionManager.setFocus ();
       }
      }

      private function changeTextAlign (e:Event):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager)
       {
        var pf:ParagraphFormat = new ParagraphFormat();
        pf.textAlign = ComboBox(e.currentTarget).selectedItem.data;
        IEditManager(_textFlow.interactionManager).applyParagraphFormat (pf);
        _textFlow.interactionManager.setFocus ();
       }
      }

      private function changeTextIndent (ke:KeyboardEvent):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager && ke.keyCode == Keyboard.ENTER)
       {
        var pf:ParagraphFormat = new ParagraphFormat();
        pf.textIndent = TextInput(ke.currentTarget).text;
        IEditManager(_textFlow.interactionManager).applyParagraphFormat (pf);
        _textFlow.interactionManager.setFocus ();
       }
      }

      private function changeColumnCount (ke:KeyboardEvent):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager && ke.keyCode == Keyboard.ENTER)
       {
        var cf:ContainerFormat = new ContainerFormat();
        cf.columnCount = TextInput(ke.currentTarget).text;

        IEditManager(_textFlow.interactionManager).applyContainerFormat (cf);
        _textFlow.interactionManager.setFocus ();
       }
      }

      private function changeColumnGap (ke:KeyboardEvent):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager && ke.keyCode == Keyboard.ENTER)
       {
        var cf:ContainerFormat = new ContainerFormat();
        cf.columnGap = TextInput(ke.currentTarget).text;
        IEditManager(_textFlow.interactionManager).applyContainerFormat (cf);
        _textFlow.interactionManager.setFocus ();
       }
      }

      private function changeVerticalAlign (e:Event):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager)
       {
        var cf:ContainerFormat = new ContainerFormat();
        cf.verticalAlign = ComboBox(e.currentTarget).selectedItem.data;
        
        IEditManager(_textFlow.interactionManager).applyContainerFormat (cf);
        _textFlow.interactionManager.setFocus ();
       }
      }

      private function changeBlockProgression (e:Event):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager)
       {
        var cf:ContainerFormat = new ContainerFormat();
        cf.blockProgression = ComboBox(e.currentTarget).selectedItem.data;
        IEditManager(_textFlow.interactionManager).applyFormatToElement (_textFlow,null,null,cf);
        _textFlow.interactionManager.setFocus ();
       }
      }


      private function changeDirection (e:Event):void
      {
       if (_textFlow && _textFlow.interactionManager is IEditManager)
       {
        var pf:ParagraphFormat = new ParagraphFormat();
        pf.direction = ComboBox(e.currentTarget).selectedItem.data;
       
        IEditManager(_textFlow.interactionManager).applyFormatToElement (_textFlow,null,pf,null);
        _textFlow.interactionManager.setFocus ();
       }
      }

      private function resizeHandler (e:Event):void
      {
       
       myTextLayout.width = stage.stageWidth - myTextLayout.x;
       myTextLayout.height = stage.stageHeight - myTextLayout.y;

      
       _textFlow.flowComposer.getControllerAt(0).container.parent.scrollRect = new Rectangle(0,0,myTextLayout.width,myTextLayout.height);
      }
    }
    }

     

     

    Did the problem had old version of flex sdk or not import lib or textLayout component not suppose TextConverter.export() class ? please help me, I have source code to download test.My e-mail : hsu.shan.chuang@gmail.com ,tks !

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points