Solved

foreign characters in flex can't be added to textAreas when in a different state

Posted on 2008-06-24
2
1,049 Views
Last Modified: 2008-09-11
Hi,
I am running into a unique problem that I haven't been able to find the solution to. When I add foreign characters to a textArea like "ü, ö, ä, õ, ~ and a" they display in the text Area. As soon as I enter one of the states in my application, that use custom components. When in a custom component's textArea no special character can be typed in, pasted in, or entered in the textArea in any way. Whatever is causing this does not affect richTextEditor elements which still allow the special characters to be pasted in.

I am including some cldoe
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" clipContent="false" xmlns:custom="sections.*" xmlns:components="components.*" layout="absolute" backgroundGradientColors="[#c0c0c0, #808080]" dropShadowEnabled="true"  creationComplete="checkLogin()">

	<mx:states>

		<mx:State name="copyright">

			<mx:RemoveChild target="{homepageMainHolder}"/>

			<mx:AddChild relativeTo="{mainHolder}" position="lastChild">

				<custom:copyright id="copyrightMainHolder"  y="10" hideEffect="{fadeOut}" showEffect="{fadeIn}" removedEffect="{fadeOut}" addedEffect="{fadeIn}" />

			</mx:AddChild>

			<mx:AddChild relativeTo="{mainHolder}" position="lastChild">

				<components:homeLink id="homeLink"  removedEffect="{fadeOut}" addedEffect="{fadeIn}"  x="22" y="59"/>

			</mx:AddChild>

		</mx:State>

</mx:states>
 

	<!-- define css style for the page -->

	<mx:Style source="../html-template/style.css" />

	<mx:Style source="../styles/advancedColorPicker.css" />

	 

	

 	<!-- Define effects -->

    <mx:Zoom id="shrink" duration="100" zoomHeightTo=".9" zoomWidthTo=".9" />

    <mx:Zoom id="revert" duration="50" zoomHeightTo="1" zoomWidthTo="1" />

    <mx:Dissolve id="dissolveOut" duration="500" alphaFrom="1.0" alphaTo="0.0"/>

    <mx:Dissolve id="dissolveIn" duration="500" alphaFrom="0.0" alphaTo="1.0"/>

    <mx:Fade id="fadeOut" duration="500" alphaFrom="1.0" alphaTo="0.0"/>

    <mx:Fade id="fadeIn" duration="500" alphaFrom="0.0" alphaTo="1.0"/>

	<mx:Blur id="blur" duration="1000"  blurXFrom="0.0" blurXTo="10.0" blurYFrom="0.0" blurYTo="10.0"/>

    <mx:Blur id="unblur" duration="1000" blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0"/>
 

	 <mx:Script source="as/imagesmoothing.as" />

	 <mx:Script source="as/url.as" />

	 <mx:Script>

	 	<![CDATA[

	 	

	 		import mx.managers.PopUpManager;

	 		
 

	 		

	 		[Bindable] public var secID:Number;

	 		[Bindable] public var secIDp:Number;

	 		[Bindable] public var clientID:Number;

	 		[Bindable] public var clientIDp:Number;

	 		[Bindable] public var clientname:String;

	 		[Bindable] public var packageID:Number;

	 		[Bindable] public var loggedIn:Boolean;

	 		[Bindable] public var pop1:*;

	 			 <!-- Create general layout -->

	<mx:Canvas backgroundColor="#ffffff" width="750" fontFamily="Arial"  height="100%" horizontalCenter="0" verticalCenter="0" id="mainHolder">

	

			<!-- Mlayout logo and navigation buttons -->

			<mx:Image x="22" y="16" autoLoad="true" useHandCursor="true" buttonMode="true" source="@Embed(source='icons/logo.jpg')" />

			<mx:Image x="697" y="18" source="@Embed(source='icons/icon-help.jpg')" id="site_help" autoLoad="true"   mouseDownEffect="{shrink}" mouseUpEffect="{revert}" toolTip="Site Help" click="navigateToURL(new URLRequest('http://www.portfoliositez.com/support/'))" buttonMode="true" useHandCursor="true"/>

			<mx:Image x="661" y="19" source="@Embed(source='icons/icon-viewsite.jpg')" id="view_site" autoLoad="true" mouseDownEffect="{shrink}" mouseUpEffect="{revert}" toolTip="View Site" click="navigateToURL(new URLRequest('../'))" buttonMode="true" useHandCursor="true"/>

			<mx:Image x="621" y="20" source="@Embed(source='icons/icon-home.jpg')" id="site_home" autoLoad="true" mouseDownEffect="{shrink}" mouseUpEffect="{revert}" toolTip="Site Home"  useHandCursor="true" buttonMode="true" click="mx.core.Application.application.homeClick(event);"/>

			<mx:Image x="581" y="20" source="@Embed(source='icons/icon-aboutsite.png')" id="site_info" autoLoad="true" mouseDownEffect="{shrink}" mouseUpEffect="{revert}" toolTip="Useful information about your template"  useHandCursor="true" buttonMode="true" click="navigateToURL(new URLRequest('http://www.portfoliositez.com/templates/frida/'))"/>

	 		<mx:HRule x="22" y="58" width="707"/>

			

	 		

	 		<!-- Import homepage component -->

			<custom:homepage id="homepageMainHolder" height="100%" y="10" hideEffect="{fadeOut}" showEffect="{fadeIn}"  removedEffect="{fadeOut}" addedEffect="{fadeIn}" />

			

	</mx:Canvas>

	

</mx:Application>
 
 
 
 
 
 
 
 
 
 

<!-------------code from one of the files that contain a text area that isn't allowing special characters -------->
 

<?xml version="1.0" encoding="utf-8"?>

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:components="components.*" creationComplete="SrvCopy.send(), init()" addedToStage="SrvCopy.send()">

 

 

	 <!-- Define effects -->

    <mx:Zoom id="shrink" duration="100" zoomHeightTo=".9" zoomWidthTo=".9" />

    <mx:Zoom id="revert" duration="50" zoomHeightTo="1" zoomWidthTo="1" />	

    <mx:Fade id="fadeOut" duration="500" alphaFrom="1.0" alphaTo="0.0"/>

    <mx:Fade id="fadeIn" duration="500" alphaFrom="0.0" alphaTo="1.0"/>

 	

 	<mx:Script source="../as/advancedColorPicker.as" />

 	<mx:Script source="../as/url.as" />

 	

 	

 <mx:Canvas id="copyrightHolder"  verticalScrollPosition="10">

	 <!-- Create structure for copyright information -->

	 <mx:Panel width="707" height="360" layout="absolute" id="copyright_container" borderThickness="1" x="21" y="112" borderThicknessBottom="5"  borderThicknessTop="5" headerHeight="10" fontFamily="mainFont" fontSize="10" fontWeight="normal">

		<mx:Label id="copyrightLabel" />

		<mx:HBox x="10" y="26" width="667">

			<mx:Label text="Copyright Line"/>

			<mx:TextInput width="527" id="copyrightLine" text="{SrvCopy.lastResult.copyrights.copyright.text}" change="infoUpdated.visible=false"/>

		</mx:HBox>

		<mx:HBox width="667" x="10" y="73">

			<mx:Label text="Copyright Link"/>

			<mx:TextInput width="527" id="copyrightLink" text="{SrvCopy.lastResult.copyrights.copyright.link}" change="infoUpdated.visible=false" toolTip="links need to be full urls. ie- 'http://www...'" />

		</mx:HBox>

		<mx:HSlider x="148" y="118" minimum="0" maximum="100" id="copyrightOpacity" allowTrackClick="true" labels="[0%,100%]" value="{SrvCopy.lastResult.copyrights.copyright.opacity}" width="200" tickInterval="10" snapInterval="1" liveDragging="true" change="infoUpdated.visible=false"/>

		<mx:Label x="10" y="130" text="Copyright Line Opacity"/>

		<mx:VBox left="10" top="184" height="31">

			<mx:HBox width="100%" left="10" top="10" verticalAlign="middle">

				<mx:Label text="Copyright Line Color"/>

				<mx:ColorPicker id="picker" selectedColor="{parseInt(SrvCopy.lastResult.copyrights.copyright.color, 16)}" showTextField="true" change="infoUpdated.visible=false"/>

				<mx:Image source="assets/colorWheel.png" click="openPicker(event)" buttonMode="true" toolTip="open advanced color picker"/>

				<mx:Label id="hexColor" text="{rgbToHex(picker.selectedColor)}" visible="false" />

				<mx:Label text="{sample.alpha}" visible="false"/>

			</mx:HBox>

			<mx:CheckBox label="Enable stage color picker" id="picker_check" visible="false" />

		</mx:VBox>

		<mx:Label x="10" y="247" text="Sample:"/>

		<mx:Label id="sample" x="62" y="248" text="{copyrightLine.text}" width="606" color="{picker.selectedColor}"  alpha="{copyrightOpacity.value/100}" fontFamily="mainFont" fontSize="10"/>

		<mx:ControlBar height="38" width="713" x="-21" y="306">

			<mx:Button label="Update Copyright Information" id="updateCopyright" click="SrvCopy.send(),infoUpdated.visible=true"/>

			<mx:Label id="infoUpdated" text="     Information has been updated. " width="206" visible="false"  showEffect="{fadeIn}"  hideEffect="{fadeOut}" fontFamily="mainFont" fontSize="10"  addedToStage="this.infoUpdated.visible=false"/>

		</mx:ControlBar>

	</mx:Panel>

	 <mx:Label x="128" y="52" text="EDIT COPYRIGHT INFORMATION" fontSize="10" fontFamily="mainFont" textAlign="left"/>

 </mx:Canvas>        

	        

	        

		<!-- Create http connections to pull in content from xml files -->

		 <mx:HTTPService id="SrvCopy" url="php/copyright.php"  useProxy="false" method="POST"  showBusyCursor="true" >

		      	<mx:request xmlns="">

		        		<copyright>{copyrightLine.text}</copyright><link>{copyrightLink.text}</link><opacity>{copyrightOpacity.value}</opacity><colorI>{rgbToHex(picker.selectedColor)}</colorI>

		      	</mx:request>

		   </mx:HTTPService>
 
 

</mx:Canvas>

Open in new window

0
Comment
Question by:jenie_penny13
2 Comments
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
ID: 21864409
Have a look here, other than that I'm out of ideas :)

http://capitalhcoder.com/2007/11/11/unicode-foreign-character-entry-in-flex/
0
 

Author Comment

by:jenie_penny13
ID: 21865317
Thanks for the reply :-) I actually had found that and tried to use it, but it also does not work when not on the main Application page.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now