<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>flex-as &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/flex-as/</link>
	<description>Feed of posts on WordPress.com tagged "flex-as"</description>
	<pubDate>Wed, 10 Feb 2010 15:28:29 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[alpha &amp; rotation issue for textArea with htmlText]]></title>
<link>http://haritkothari.wordpress.com/2009/09/28/alpha-rotation-issue-for-textarea-with-htmltext/</link>
<pubDate>Mon, 28 Sep 2009 04:31:16 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/09/28/alpha-rotation-issue-for-textarea-with-htmltext/</guid>
<description><![CDATA[I had been playing with this for one of a project requirement. Description of scenario: Embedded fon]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I had been playing with this for one of a project requirement.</p>
<p>Description of scenario:</p>
<ul>
<li>Embedded fonts &#8216;Times New Roman&#8217; both, using default font manager (Batik) as well as AFE</li>
<li> The application consists of two text area components</li>
<li> For 1st textarea, I am setting text using &#8216;text&#8217; property and setting font family, size and color using setStyle().</li>
<li> For second, I am providing text related information via &#8216;htmlText&#8217; property.</li>
<li> Using a slider I should be able to change alpha value of both textArea components.</li>
</ul>
<p>Behavioral problems:</p>
<ul>
<li>When I change value using slider, the alpha effect is applied and visible for 1st textarea, but in case of second, alpha value gets applied but text has no visible impact of alpha.</li>
<li> When I rotate both textArea components using, 1st gets rotated, but not second. In case of both textareas, I am referring and using embedded font only. (font family &#8216;TNR&#8217; in example)</li>
</ul>
<p>I expect both textAreas behave identical.</p>
<p>As far as I know and received primary feedback from a famous flexer guy, my code is right. If I consider this, there is definitely a limitation / bug in flex SDK. Hence I <a href="http://bugs.adobe.com/jira/browse/SDK-23453" target="_blank">suggested a new task in SDK</a>.</p>
<p>Here is a code I had written to simulate the SDK limitation / bug:</p>
<pre class="brush: xml;">
&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; creationComplete=&#34;init()&#34;&#62;
	&#60;mx:Style&#62;
		@font-face
		{
			src: url('/assets/fonts/times-new-roman.ttf');
			fontFamily: &#34;TNR&#34;;
			font-weight:normal;
			font-style:normal;

			advancedAntiAliasing: true;
		}
	&#60;/mx:Style&#62;
	&#60;mx:Script&#62;
		&#60;![CDATA[
			import mx.events.SliderEvent;

			private function init():void
			{
				basicTxt.text = &#34;This is a sample text!&#34;;
			}

			private function onChange(event:SliderEvent):void
			{
				basicTxt.alpha = event.value;
				htmlTxt.alpha = event.value;
			}

			private function doRotate(event:MouseEvent):void
			{
				basicTxt.rotation = 20;
				htmlTxt.rotation = 20;
			}
		]]&#62;
	&#60;/mx:Script&#62;
	&#60;mx:VBox width=&#34;100%&#34; height=&#34;100%&#34;&#62;
		&#60;mx:HBox width=&#34;70%&#34; height=&#34;50%&#34;&#62;
			&#60;mx:TextArea id=&#34;basicTxt&#34; width=&#34;80%&#34; backgroundColor=&#34;blue&#34; fontSize=&#34;36&#34; height=&#34;100%&#34; fontFamily=&#34;TNR&#34;/&#62;
			&#60;mx:TextArea id=&#34;htmlTxt&#34; width=&#34;80%&#34; backgroundColor=&#34;blue&#34; height=&#34;100%&#34;&#62;
			&#60;mx:htmlText&#62;
					&#60;![CDATA[&#60;TEXTFORMAT LEADING=&#34;2&#34;&#62;&#60;P ALIGN=&#34;LEFT&#34;&#62;&#60;FONT FACE=&#34;TNR&#34; SIZE=&#34;36&#34; COLOR=&#34;#000000&#34; LETTERSPACING=&#34;0&#34; KERNING=&#34;0&#34;&#62;This is a sample text!&#60;/FONT&#62;&#60;/P&#62;&#60;/TEXTFORMAT&#62;]]&#62;
				&#60;/mx:htmlText&#62;
			&#60;/mx:TextArea&#62;
		&#60;/mx:HBox&#62;
		&#60;mx:HSlider minimum=&#34;0&#34; maximum=&#34;1&#34; value=&#34;1&#34; change=&#34;onChange(event)&#34; /&#62;
		&#60;mx:Button label=&#34;Rotate&#34; click=&#34;doRotate(event)&#34; /&#62;
	&#60;/mx:VBox&#62;
&#60;/mx:Application&#62;
</pre>
<p>I will appreciate if anyone can give some ideas / pointers to work around.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Flash Player and Text]]></title>
<link>http://haritkothari.wordpress.com/2009/08/12/flash-player-and-text/</link>
<pubDate>Wed, 12 Aug 2009 09:05:45 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/08/12/flash-player-and-text/</guid>
<description><![CDATA[It&#8217;s been very difficult to achieve WUSIWUG in Flex 3 (Flash Player 9) and InDesign Server, at]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>It&#8217;s been very difficult to achieve <a href="http://en.wikipedia.org/wiki/WYSIWYG" target="_blank">WUSIWUG</a> in Flex 3 (Flash Player 9) and <a href="http://www.adobe.com/products/indesignserver/" target="_blank">InDesign Server</a>, at least for Text viz, font family, font size etc. In other words, a character with Arial font and size 12 in flash player will look differently from other non flash applications like text editors, design tools etc, having the same character specification. Therefore it is difficult to achieve the same output what you see in flash player, with InDesign Server and so in output PDF! Albeit, both are Adobe products!!!</p>
<p>Speaking to <a href="http://www.webkitchen.be/" target="_blank">Serge Jespers</a> about this he accepted that Flash player is built differently. Also, <a href="http://www.anandvardhan.com/" target="_blank">Anand </a>added that the new <a href="http://labs.adobe.com/technologies/textlayout/" target="_blank">Text Layout Framework</a>, available with Flex 4, runs with Flash Player 10 has addressed many such issues. It has many changes as compared to traditional TextArea component available with Flex 3.</p>
<p>However, Text Layout Framework is not 100% compatible with Flex 3.2. It is not possible to embed and use font in Flex 3.2 (or 3.3) with TLF. The <a href="http://labs.adobe.com/technologies/textlayout/releasenotes.html#known" target="_blank">release notes</a> from adobe clearly mentions this, considering root level change in embedded font structure. My experiment also failed to show an embedded font with TLF under Flex 3.3.</p>
<p>However, a point communicated by Jespers, that the TLF is made with the help of <a href="http://www.adobe.com/products/indesignserver/" target="_blank">InDesign</a> team is a ray of hope to go forward WUSIWUG. But is long way to migrate from Flex 3 to Flex 4, waiting for Flex 4 to be mature from its beta release.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Flex application &amp; new fonts]]></title>
<link>http://haritkothari.wordpress.com/2009/06/30/flex-application-new-fonts/</link>
<pubDate>Tue, 30 Jun 2009 11:51:20 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/06/30/flex-application-new-fonts/</guid>
<description><![CDATA[A typical requirement was to provide some means so that anyone can upload / add new font(s) and the ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom:0;">A typical requirement was to provide some means so that anyone can upload / add new font(s) and the same can be used by Flex application. The Flex project should not require recompilation process.</p>
<p style="margin-bottom:0;">Font, as a <em>TTF </em>or <em>FON </em>file cannot be used unless embedded, but that requires recompilation.</p>
<p style="margin-bottom:0;">Searching around net gave me a way to solve this gave me a reasonable good solution.</p>
<p style="margin-bottom:0;">Instead of specifying external styles such as <strong><em>&#60;mx:Style source=&#8221;assets/styles/fonts.css&#8221;/&#62;</em></strong> I used <em><strong>StyleManager</strong></em>.</p>
<p style="margin-bottom:0;">Any change in fonts.css requires project recompilation to get the change in effect.</p>
<p style="margin-bottom:0;">So, I compiled fonts.css using <em><strong>mxmlc fonts.css</strong></em> . This compiled <em>CSS </em>to <em>SWF</em>.</p>
<p style="margin-bottom:0;">Then I loaded fonts at runtime using <em><strong>StyleManager.loadStyleDeclarations(&#8220;fonts.swf&#8221;, true, true);</strong></em></p>
<p style="margin-bottom:0;">And that&#8217;s it&#8230;.! The font(s) inside fonts.swf can be used and that gives the same effect as embedded.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[RIA in a new avtar with Flash Builder 4]]></title>
<link>http://haritkothari.wordpress.com/2009/06/22/ria-in-a-new-avtar-with-flash-builder-4/</link>
<pubDate>Mon, 22 Jun 2009 14:43:15 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/06/22/ria-in-a-new-avtar-with-flash-builder-4/</guid>
<description><![CDATA[Adobe Flash Builder, formerly Flex Builder is already out with beta tag at present. Personally, I di]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://labs.adobe.com/technologies/flashbuilder4/" target="_blank">Adobe Flash Builder</a>, formerly Flex Builder is already out with beta tag at present. Personally, I dislike the renamed brand as Flash Builder. Already, many have misconception that Flash and Flex are similar! The only common point is that both supports ActionScript (ECMA 335), but so what? Application of both suits are totally different. Of course, the SDK brand remains same, <a href="http://labs.adobe.com/technologies/flex4sdk/" target="_blank">Flex SDK version 4, Gumbo</a>.</p>
<p>It is near to Adobe’s Creative Suite family. In Flash Builder 4, you can work with Flash MovieClip, import designs from <a href="http://labs.adobe.com/technologies/flashcatalyst/" target="_blank">Catalyst</a>. So is pointer in that direction.</p>
<p>Data centric features are really attractive, be it data binding or data object like Hibrnate in java, representing data as POJO. But, this is limited to CRUD only. Flex 4 has backward compatibility – with halo components!</p>
<p>Features with newer IDE is welcomed, especially network monitor. This eliminates need of <a href="https://addons.mozilla.org/en-US/firefox/addon/6647" target="_blank">httpfox</a> and such third party browser plug-in!</p>
<p>Overall, Flex 4 seems to be reached to the community expectations! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://www.insideria.com/2009/06/overview-of-flex-4-gumbo.html" target="_blank">Here</a> is something more. Tim Buntel says <a href="http://www.adobe.com/devnet/flex/articles/flex4builder_whatsnew.html" target="_blank">this</a>.</p>
<p><!--[if gte mso 9]&#62;  Normal 0         MicrosoftInternetExplorer4  &#60;![endif]--></p>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:0;width:1px;height:1px;"><!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:宋体; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:SimSun;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&#62; &#60;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&#34;Table Normal&#34;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&#34;&#34;; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&#34;Times New Roman&#34;; 	mso-fareast-font-family:&#34;Times New Roman&#34;;} --> <!--[endif]--></p>
<p class="MsoNormal">Adobe Flash Builder, formerly Flex Builder is already out with beta tag at present. Personally, I dislike the renamed brand as Flash Builder. Of course, the SDK brand remains same, Flex SDK version 4, Gumbo.</p>
<p class="MsoNormal">
<p class="MsoNormal">It is near to Adobe’s Creative Suite family. In Flash Builder 4, you can play with Flash MovieClip, import designs from Catalyst. So is that pointer.</p>
<p class="MsoNormal">
<p class="MsoNormal">Data centric features are really attractive, be it data binding or data object like in Hibrnate with java, representing data as POJO. But, this is limited to CRUD only. Flex 4 has backward compatibility – with halo components (I am yet not sure about the level)!</p>
<p class="MsoNormal">
<p class="MsoNormal">Features with newer IDE is welcomed, especially network monitor. This eliminates need of httpfox and such third party browser plug-in!</p>
<p class="MsoNormal">
<p class="MsoNormal">Overall, Flex 4 seems to be reached to the community expectations! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Flex (Flash Player) - DPI and input/output]]></title>
<link>http://haritkothari.wordpress.com/2009/05/29/flex-flash-player-dpi-and-inputoutput/</link>
<pubDate>Fri, 29 May 2009 11:52:30 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/05/29/flex-flash-player-dpi-and-inputoutput/</guid>
<description><![CDATA[DPI is often confused with screen resolution. Actually when screen resolution changes (in pixel heig]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>DPI is often confused with screen resolution. Actually when screen resolution changes (in pixel height x width) the DPI rate is not necessarily changed.</p>
<p>In most cases DPI remains same, unless changed intentionally. In simple language, increasing screen resolution will allow more dots to be displayed on screen, by decreasing distance between each dot. Increasing DPI rate of screen but keeping resolution will increase number of dots per inch; by decreasing dot thickness, and that will eventually result into more dots in whole screen, with unchanged resolution.</p>
<p>When image resolution comes into picture, DPI plays role to consider depth of an Image. More the DPIs, better is the image &#8211; depth.<br />
Two similar looking image (at its original size) may have different DPIs. The image with higher DPI rate, if zoomed in, will not get blurred or distorted very easily.</p>
<p>DPI is the somewhat similar concept of mega pixel &#8211; the camera term.</p>
<p>This term and its effect came into picture when I started input and output to real wprld from Flex application!<br />
Flex application (or flash player) accepts width, height, x, y or such dimension properties in pixels only. The real world deals with inch, foot, centimeter or any such unit.</p>
<p>So where the game is?</p>
<p>Above simple question puzzles many.<br />
widthInch = widthPixels/DPI is the key!</p>
<p>Say you have image with 500 pixels, width in inch will be 500/DPI. So if DPI is 96, then width is 500/96inches.</p>
<p>In case of flash player, DPI rate is 96.<br />
So if I want to display an image in 2 inches width, I need to set image width to 2*96 pixels. This ignores Image (physical image file) and its DPI rate as I am going to display in flash player, not any image editor.</p>
<p>Also, <a href="http://bugs.adobe.com/jira/browse/SDK-13778" target="_blank">this</a> bug post is strange upto my knowledge. Flash Player&#8217;s DPI seems constant, ignoring screen DPI.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Color Fill in Flex]]></title>
<link>http://haritkothari.wordpress.com/2009/05/04/color-fill-in-flex/</link>
<pubDate>Mon, 04 May 2009 06:38:24 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/05/04/color-fill-in-flex/</guid>
<description><![CDATA[&lt;mx:Script&gt; &lt;![CDATA[ private function fill(event:MouseEvent):void { var data:BitmapData = ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><pre class="brush: xml;">
&lt;mx:Script&gt;
	&lt;![CDATA[
		private function fill(event:MouseEvent):void
		{
			var data:BitmapData = Bitmap(imageObject.content).bitmapData;
			data.floodFill(event.localX,event.localY,0x00ffff);  // replace 0x00ffff with your choice of color
		}
	]]&gt;
&lt;/mx:Script&gt;
&lt;mx:Image id=&quot;imageObject&quot; source=&quot;....&quot; click=&quot;fill(event)&quot; /&gt;
</pre>
<p>This few lines simply fills selected or defined color to DisplayObject / Image like fill tool of any Paint tool.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Simple solution to a complex problem - customized Rich Text Editor]]></title>
<link>http://haritkothari.wordpress.com/2009/04/18/simple-solution-of-a-complex-problem-customized-rich-text-editor/</link>
<pubDate>Sat, 18 Apr 2009 12:08:10 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/04/18/simple-solution-of-a-complex-problem-customized-rich-text-editor/</guid>
<description><![CDATA[Apparently, creating customized RichTextEditor component in flex was looking time consuming. The ric]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Apparently, creating customized RichTextEditor component in flex was looking time consuming. The rich APIs that flex provides made this task easier.</p>
<p style="margin-bottom:0;">I retrieved reference of different styling controls from a hidden richTextEditor object, arranged them as per my requirement, and its done!</p>
<p style="margin-bottom:0;">I thought to make a custom editor with customized control positions is a big task, but is not what I thought! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; creationComplete=&quot;init()&quot;&gt;
	&lt;mx:Script&gt;
		&lt;![CDATA[
			import mx.controls.Button;
			import mx.controls.TextArea;
			import mx.controls.TextInput;
			import mx.controls.RichTextEditor;

			private function init():void
			{
				var textInput:TextInput = rte.linkTextInput;
				textInput.visible = false;

				var bulletsButton:Button = rte.bulletButton;
				bulletsButton.visible = false;

				var fontFamily:DisplayObject = rte.fontFamilyCombo;
				font.addChild(fontFamily);
				var fontSize:DisplayObject = rte.fontSizeCombo;
				font.addChild(fontSize);

				var alignBtns:DisplayObject = rte.alignButtons;
				effects.addChild(alignBtns);

				var boldBtn:DisplayObject = rte.boldButton;
				var italicBtn:DisplayObject = rte.italicButton;
				var underlineBtn:DisplayObject = rte.underlineButton;
				var colorPicker:DisplayObject = rte.colorPicker;
				var styles:HBox = new HBox();
				styles.addChild(boldBtn);
				styles.addChild(italicBtn);
				styles.addChild(underlineBtn);
				styles.addChild(colorPicker);
				effects.addChild(styles);

				var textArea:TextArea = rte.textArea;
				editor1.addChild(textArea);
			}
		]]&gt;
	&lt;/mx:Script&gt;
	&lt;mx:VBox id=&quot;controls&quot; width=&quot;250&quot; height=&quot;100&quot;&gt;
		&lt;mx:HBox id=&quot;font&quot; /&gt;
		&lt;mx:HBox id=&quot;effects&quot; /&gt;
	&lt;/mx:VBox&gt;
	&lt;mx:Panel id=&quot;editor1&quot; x=&quot;300&quot; width=&quot;300&quot; height=&quot;300&quot;/&gt;
	&lt;mx:RichTextEditor id=&quot;rte&quot; visible=&quot;false&quot; /&gt;
&lt;/mx:Application&gt;
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[3 ways to get control in Flex over user input through Keyboard]]></title>
<link>http://haritkothari.wordpress.com/2009/02/10/3-ways-to-get-control-in-flex-over-user-input-through-keyboard/</link>
<pubDate>Tue, 10 Feb 2009 11:40:41 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/02/10/3-ways-to-get-control-in-flex-over-user-input-through-keyboard/</guid>
<description><![CDATA[1. Use of restrict property. The following example allows only numeric input &lt;mx:TextInput id=]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>1. Use of restrict property. The following example allows only numeric input</p>
<pre class="brush: xml;">
&lt;mx:TextInput id=&quot;textInput&quot; restrict=&quot;0-9\-&quot; /&gt;
</pre>
<p>2. Use of unicodeRange style property inside CSS (stylesheet) while embedding fonts. The following example restricts all special symbols except period sign(.).</p>
<pre class="brush: css;">
@font-face
{
src:url(&quot;../assets/myFont.ttf&quot;);
fontFamily: myFontFamily;
flashType: true;
unicodeRange:
U 0041-U 005A, /* Upper-Case [A..Z] */
U 0061-U 007A, /* Lower-Case a-z */
U 0030-U 0039, /* Numbers [0..9] */
U 002E-U 002E; /* Period [.] */
}
</pre>
<p>3. Use of Flex built in validator components. Following example calls handleValid and makes it sure that user does not leave inputComponent blank.</p>
<pre class="brush: xml;">
&lt;mx:Validator id=&quot;reqValid&quot; required=&quot;true&quot; source=&quot;{inputComponent}&quot; property=&quot;text&quot; valid=&quot;handleValid(event)&quot; invalid=&quot;handleValid(event)&quot;/&gt;
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Font transcoding error - specify font style]]></title>
<link>http://haritkothari.wordpress.com/2009/02/05/font-transcoding-error-specify-font-style/</link>
<pubDate>Fri, 06 Feb 2009 05:16:54 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/02/05/font-transcoding-error-specify-font-style/</guid>
<description><![CDATA[Flex SDK has rich set of font managers. Those 3 (Batik, AFE, JRE) manage and transcode to flash play]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Flex SDK has rich set of font managers. Those 3 (Batik, AFE, JRE) manage and transcode to flash player fonts.<br />
However, using following code in CSS caused comile time exception.</p>
<p>&#8220;exception during transcoding: Font for alias &#8216;Arial Bold&#8217; with plain weight and style was not found at&#8230;&#8221;</p>
<pre class="brush: css;">
@font-face
{
src: url('/assets/fonts/arial-bold.ttf');
fontFamily: &quot;Arial Bold&quot;;
}

@font-face
{
src: url('/assets/fonts/arial-bold-italic.ttf');
fontFamily: &quot;Arial Bold Italic&quot;;
}
</pre>
<p>The perfect solution that I could find was that I also need to specify font weight &#38; style in CSS, as per the type of font, I am embedding.</p>
<p>Here is the perfect solution:</p>
<pre class="brush: css;">
@font-face
{
src: url('/assets/fonts/arial-bold.ttf');
fontFamily: &quot;Arial Bold&quot;;
font-weight:bold;
}

@font-face
{
src: url('/assets/fonts/arial-bold-italic.ttf');
fontFamily: &quot;Arial Bold Italic&quot;;
font-weight:bold;
font-style:italic;
}
</pre>
<p>Flex SDK is really very smart in this case. It actually detects that the font supplied is of which type effect &#8211; bold, italics or both.<br />
More on font managers is <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_06.html" target="_blank">here</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Parameter sequence disturbed : Web Service in Flex]]></title>
<link>http://haritkothari.wordpress.com/2009/01/31/parameter-sequence-disturbed-web-service-in-flex/</link>
<pubDate>Sat, 31 Jan 2009 05:35:20 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/01/31/parameter-sequence-disturbed-web-service-in-flex/</guid>
<description><![CDATA[I implemented an application in Flex that used web service, written in PHP with NuSOAP library. The ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I implemented an application in Flex that used web service, written in PHP with <a href="http://sourceforge.net/projects/nusoap/" target="_blank">NuSOAP</a> library. The WSDL file that was available for Web Service is as under:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;definitions xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:tns=&quot;http://server&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot; xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot; targetNamespace=&quot;http://server&quot;&gt;
&lt;types&gt;
&lt;xsd:schema targetNamespace=&quot;http://server&quot; &gt;
 &lt;xsd:import namespace=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; /&gt;
 &lt;xsd:import namespace=&quot;http://schemas.xmlsoap.org/wsdl/&quot; /&gt;
&lt;/xsd:schema&gt;
&lt;/types&gt;
&lt;message name=&quot;saveImgRequest&quot;&gt;
&lt;part name=&quot;id&quot; type=&quot;xsd:string&quot; /&gt;
&lt;part name=&quot;data&quot; type=&quot;xsd:string&quot; /&gt;
&lt;part name=&quot;emailId&quot; type=&quot;xsd:string&quot; /&gt;
&lt;part name=&quot;notes&quot; type=&quot;xsd:string&quot; /&gt;&lt;/message&gt;
&lt;message name=&quot;saveImgResponse&quot;&gt;
&lt;part name=&quot;return&quot; type=&quot;xsd:boolean&quot; /&gt;&lt;/message&gt;
&lt;message name=&quot;purchaseRequest&quot;&gt;
&lt;part name=&quot;id&quot; type=&quot;xsd:string&quot; /&gt;
&lt;part name=&quot;data&quot; type=&quot;xsd:string&quot; /&gt;&lt;/message&gt;
&lt;message name=&quot;purchaseResponse&quot;&gt;
&lt;part name=&quot;return&quot; type=&quot;xsd:boolean&quot; /&gt;&lt;/message&gt;
&lt;portType name=&quot;purchasePortType&quot;&gt;
  &lt;operation name=&quot;saveImg&quot;&gt;
    &lt;input message=&quot;tns:saveImgRequest&quot;/&gt;
    &lt;output message=&quot;tns:saveImgResponse&quot;/&gt;
  &lt;/operation&gt;
  &lt;operation name=&quot;purchase&quot;&gt;
    &lt;input message=&quot;tns:purchaseRequest&quot;/&gt;
    &lt;output message=&quot;tns:purchaseResponse&quot;/&gt;
  &lt;/operation&gt;
&lt;/portType&gt;
&lt;binding name=&quot;purchaseBinding&quot; type=&quot;tns:purchasePortType&quot;&gt;
  &lt;soap:binding style=&quot;rpc&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;/&gt;
  &lt;operation name=&quot;saveImg&quot;&gt;
    &lt;soap:operation soapAction=&quot;http://server/webservice.php/saveImg&quot; style=&quot;rpc&quot;/&gt;
    &lt;input&gt;&lt;soap:body use=&quot;encoded&quot; namespace=&quot;http://server&quot; encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;&lt;/input&gt;
    &lt;output&gt;&lt;soap:body use=&quot;encoded&quot; namespace=&quot;http://server&quot; encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;&lt;/output&gt;
  &lt;/operation&gt;
  &lt;operation name=&quot;purchase&quot;&gt;
    &lt;soap:operation soapAction=&quot;http://server/webservice.php/purchase&quot; style=&quot;rpc&quot;/&gt;
    &lt;input&gt;&lt;soap:body use=&quot;encoded&quot; namespace=&quot;http://server&quot; encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;&lt;/input&gt;
    &lt;output&gt;&lt;soap:body use=&quot;encoded&quot; namespace=&quot;http://server&quot; encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;&lt;/output&gt;
  &lt;/operation&gt;
&lt;/binding&gt;
&lt;service name=&quot;purchase&quot;&gt;
&lt;port name=&quot;purchasePort&quot; binding=&quot;tns:purchaseBinding&quot;&gt;
    &lt;soap:address location=&quot;http://server/webservice.php&quot;/&gt;
  &lt;/port&gt;
&lt;/service&gt;
&lt;/definitions&gt;
</pre>
<p>After carefully considering the sequence of parameters in web service method call, I tried to import Web Service through Flex Builder&#8217;s Import web service wizard.</p>
<p>Surprisingly, methods that are served by the Web Service have been detected with all parameters. But, with a surprise:</p>
<p><a href="http://haritkothari.wordpress.com/files/2009/01/import_ws.jpg"><img class="alignnone size-medium wp-image-223" title="Web Serice Import Wizard in Flex Builder 3" src="http://haritkothari.wordpress.com/files/2009/01/import_ws.jpg?w=300" alt="Web Serice Import Wizard in Flex Builder 3" width="300" height="269" /></a></p>
<p>Why is the sequence of parameters been changed? Neither parameters are in ascending/descending order of alphabets nor are in original sequence as are declared!</p>
<p>Can anyone give reason?</p>
<p>Ignoring unwanted sequence through import wizard, I finally implemented Web Service with parameters as are there in WSDL, and it worked fine for me!</p>
<pre class="brush: java;">
private function initAndCallWS():void
{
    saveImageWebService = new WebService();               
    saveImageWebService.wsdl = &quot;http://server/webservice.php?wsdl&quot;;
    saveImageWebService.saveImg.addEventListener(&quot;result&quot;, resultHandler);
    saveImageWebService.saveImg.addEventListener(&quot;fault&quot;, faultHandler);
    saveImageWebService.addEventListener(LoadEvent.LOAD,loadHandler);
    saveImageWebService.loadWSDL();
}

private function loadHandler(event:LoadEvent):void
{
    saveImageWebService.saveImg(&quot;userID&quot;,&quot;image_content&quot;, &quot;email@server.com&quot;, &quot;notes&quot;);
}
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[A statement can change the life]]></title>
<link>http://haritkothari.wordpress.com/2009/01/20/a-statement-can-change-the-life/</link>
<pubDate>Wed, 21 Jan 2009 05:18:21 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2009/01/20/a-statement-can-change-the-life/</guid>
<description><![CDATA[This makes very generic sense &#8211; this is about my experience in terms of software programming. ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This makes very generic sense &#8211;  this is about my experience in terms of software programming.</p>
<p style="margin-bottom:0;">My team was facing big pain to solve a very small – simple looking issue. Everything was logically simple and correct.</p>
<p style="margin-bottom:0;">In flex 3, I disabled TextInput something like under:</p>
<p style="margin-bottom:0;"><strong><em>objTextInput.enabled = false;</em></strong></p>
<p style="margin-bottom:0;">After that I tried to change color through stylesheet (CSS) and it did not work. Contradictory I was able to change font-family and font size of the same component in same fashion, and was working fine.</p>
<p style="margin-bottom:0;">Changing to <strong><em>objTextInput.enabled = true;</em></strong> worked perfectly fine as expected!</p>
<p style="margin-bottom:0;">What can I consider this as? A bug in Flex 3 SDK or bug in my understanding? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Masking with customized / polygon shape]]></title>
<link>http://haritkothari.wordpress.com/2008/12/30/masking-with-customized-polygon-shape/</link>
<pubDate>Tue, 30 Dec 2008 12:57:01 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2008/12/30/masking-with-customized-polygon-shape/</guid>
<description><![CDATA[A typical requirement to create custom closed shape was a big pain till now at my workplace. Many we]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="margin-bottom:0;">A typical requirement to create custom closed shape was a big pain till now at my workplace. Many were working to create some run time changeable shape and through that, mask an image. I achieved this; finally, after visiting a blog and a forum for Flash programming. Also, my colleague <a href="http://mayurthakor.wordpress.com/" target="_blank">Mayur</a> helped to organize once I was ready and I explained like Proof of Concept.</p>
<p style="margin-bottom:0;">For custom shape, you will require a reference to public property of any DisplayObject / UIComponent – that is graphics (flash.display.Graphics)</p>
<p style="margin-bottom:0;">Now is the real crux.</p>
<p style="margin-bottom:0;">The next steps work just like you draw something on paper (or Canvas)</p>
<p style="margin-bottom:0;">
<pre class="brush: java;">
// Create and initialize Sprite object
var spriteObj:Sprite = new Sprite();

// Clear graphics
spriteObj.graphics.clear();

// Define style of line (border of the shape)
spriteObj.graphics.lineStyle(1, 0xff00ff);

// Start filling with a selected color
spriteObj.graphics.beginFill(0x00ff00);

// Move to a position to start from (without actually drawing)
spriteObj.graphics.moveTo(x, y);

// Draw a line / curve or anything that is supported by graphics
// This may be used in a loop or recursive manner to draw lines / curves passing through n points
for(...;...;...)
{
	spriteObj.graphics.curveTo(handlerX, handlerY, x, y);
}

// End filling process, just like you put pen aside!
spriteObj.graphics.endFill();

// Define a new canvas and initialize it
var canObj:Canvas = new Canvas();

// Add the just created Sprite object as a raw (not direct UIComponent child) child
canObj.rawChildren.addChild(spriteObj);

// Use over image as a mask, if required
imgComp.mask =  canObj;
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Flexible Eclipse]]></title>
<link>http://haritkothari.wordpress.com/2008/12/09/flexible-eclipse/</link>
<pubDate>Tue, 09 Dec 2008 18:08:14 +0000</pubDate>
<dc:creator>haritkothari</dc:creator>
<guid>http://haritkothari.wordpress.com/2008/12/09/flexible-eclipse/</guid>
<description><![CDATA[Flex SDK is Free &amp; Open Source but Flex Builder is neither free nor open source. I googled if th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><!--[if gte mso 9]&#62;  Normal 0         MicrosoftInternetExplorer4  &#60;![endif]-->Flex SDK is Free &#38; Open Source but Flex Builder is neither free nor open source.</p>
<p>I googled if there is any way to use Flex SDK with Eclipse (because Flex Builder is built on Eclipse too) for development purpose.I found 2 useful results; Of course I haven&#8217;t tried yet.</p>
<p class="MsoNormal">http://cfsilence.com/blog/client/index.cfm/2007/3/26/Setting-Up-Eclipse-For-Flex-2</p>
<p>http://www.darronschall.com/weblog/archives/000182.cfm</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Google indexa flash]]></title>
<link>http://bragasofts.wordpress.com/2008/07/01/google-indexa-flash/</link>
<pubDate>Tue, 01 Jul 2008 14:58:36 +0000</pubDate>
<dc:creator>bragasofts</dc:creator>
<guid>http://bragasofts.wordpress.com/2008/07/01/google-indexa-flash/</guid>
<description><![CDATA[Hoy me desayune la grata noticia de que google ya sabe crawlear paginas hechas con flash. Cae una de]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hoy me desayune la grata noticia de que google ya sabe crawlear paginas hechas con flash. Cae una de las barreras mas importantes de flex y flash en general.</p>
<p>http://googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html</p>
<p>Parece ser entonces que lo que hicieron para explorar los swf los muchachos de google es usar los controles de usuario. Sacando conjeturas, supongo que habran hecho bots capaces de reconocer los controles y sabiendo usarlos.</p>
<p>Lo que mejor indexa el google de los sitios y widgets flash es el texto que ve el usuario (despues de todo la indexación esta basada en el escaneo de la interface).</p>
<p>Lo que todavía no indexa (02/07/2008 dd/mm/aaaa) son las imagenes incluidas en dentro de los swf.</p>
<p>Una piedra importante sale del camino de las aplicaciones RIA.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
