Question
Text Layout Framework
hi
i installed Flash builder 4 in my system and eclipse plugin.
this is my source code
Action script file
package components
{
import flashx.textLayout.container.DisplayObjectContainerController;
import flashx.textLayout.conversion.TextFilter;
import flashx.textLayout.elements.TextFlow;
import mx.collections.ArrayCollection;
import mx.controls.ComboBox;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.events.ListEvent;
use namespace mx_internal;
public class CustomComboBox extends ComboBox
{
private var _textFlow:TextFlow;
private var containerController:DisplayObjectContainerController;
private var _selectedLabel:String = '';
//Property which contain the Arabic String in ArrayCollection
public var _customLabelField:String = 'customString';
public function CustomComboBox()
{
super();
addEventListener(ListEvent.CHANGE, changeHandler);
addEventListener(FlexEvent.VALUE_COMMIT,changeHandler);
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
if(selectedItem)
{
// TODO: allow a String to be the data object, and hide the label so [object Object] doesn't appear
if(selectedItem && selectedItem[_customLabelField])
{
if(!containerController)
{
var txtXML:XML = XML('<TextFlow xmlns="http://ns.adobe.com/textLayout/2008"><div direction="rtl"><p>'+selectedItem[_customLabelField]+'</p></div></TextFlow>');
_textFlow = TextFilter.importToFlow(txtXML, TextFilter.TEXT_LAYOUT_FORMAT);
containerController = new DisplayObjectContainerController(textInput, this.width-20, this.height);
_textFlow.flowComposer.addController(containerController);
_textFlow.flowComposer.updateAllContainers();
_selectedLabel = selectedItem[_customLabelField];
}
}
}
textInput.move(-10, 5);
}
public function get customLabelField():String
{
return _customLabelField;
}
public function set customLabelField(value:String):void
{
_customLabelField = value;
}
override public function set dataProvider(value:Object):void
{
//Reset the 'label' property to empty string
for(var i:int = 0; i < (value as ArrayCollection).length; i++)
(value as ArrayCollection).getItemAt(i).label = '';
super.dataProvider = value;
}
//It will return the selected item displaying text
public function get SelectedLabel():String
{
return _selectedLabel;
}
private function changeHandler(event:Object):void
{
var txtXML:XML = XML('<TextFlow xmlns="http://ns.adobe.com/textLayout/2008"><div direction="rtl"><p>'+selectedItem[_customLabelField]+'</p></div></TextFlow>');
if(txtXML && containerController)
{
_textFlow = new TextFlow();
_textFlow = TextFilter.importToFlow(txtXML, TextFilter.TEXT_LAYOUT_FORMAT);
_textFlow.flowComposer.addController(containerController);
_textFlow.flowComposer.updateAllContainers();
_selectedLabel = selectedItem[_customLabelField];
}
}
}
}
This is my mxml file
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:components="components.*">
<!--Use the property 'customLabel' to populate indian or other language Text-->
<components:CustomButton id="tbn" customLabel="यह हिन्दी है" width="300" label="aaa"/>
<mx:HBox>
<mx:Button label="Hindi" click="{tbn.customLabel = 'यह हिन्दी है'}"/>
<mx:Button label="Telugu" click="{tbn.customLabel = 'ఇది తెలుగు'}"/>
</mx:HBox>
</mx:Application>
i use the flex sdk4 and i execute this program the error is following
type not found are not a compile time constant
[mxmlc] Loading configuration file C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\flex-config.xml
[mxmlc] C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\libs\textLayout_conversion.swc(flashx.textLayout.conversion:TextFilter)
[mxmlc] Error: Type was not found or was not a compile-time constant: ImportExportConfiguration.
[mxmlc] C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\libs\textLayout_conversion.swc(flashx.textLayout.conversion:TextFilter)
[mxmlc] Error: Type was not found or was not a compile-time constant: ImportExportConfiguration.
[mxmlc] C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\libs\textLayout_conversion.swc(flashx.textLayout.conversion:TextFilter)
[mxmlc] Error: Type was not found or was not a compile-time constant: ImportExportConfiguration.
[mxmlc] C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\libs\textLayout_conversion.swc(flashx.textLayout.conversion:TextFilter)
[mxmlc] Error: Type was not found or was not a compile-time constant: ImportExportConfiguration.
[mxmlc] C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\libs\textLayout_conversion.swc(flashx.textLayout.conversion:FXGImporter)
[mxmlc] Error: Type was not found or was not a compile-time constant: ImportExportConfiguration.
[mxmlc] C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\libs\textLayout_conversion.swc(flashx.textLayout.conversion:FXGExporter)
[mxmlc] Error: Type was not found or was not a compile-time constant: ImportExportConfiguration.
BUILD FAILED
pls help me
