Flex Formatter
August 20, 2009 at 5:05 PM | In Adobe, IT, Software | Leave a CommentTags: code, flex, eclipse, adobe, flex 4, sourceforge, bsd, flex formatter, refactor, indent, plugin
Flex Builder 3, an eclipse~ IDE for flex and actionscript based project development lacks few primary code indentation and refactoring functionalities by itself.
Searching for some other technical requirement drove me to Flex Formatter, a third party project on source! Cheers, its BSD license!
This tool is really small but very essential and useful plugin
Many times it happens that code is written in hurry to achieve some short term goal. Either some efforts need to invest to refactor and indent the code, or else go for Flex Formatter.
Built in capability to generate ASDoc is also impressive! However, I suppose, all these features, of flex formatter have been covered with Flash Builder 4.
Flash Player and Text
August 12, 2009 at 2:35 PM | In Flex / AS, Programming, webApp | Leave a CommentTags: flex, flex 3, flash player, flash, adobe, flex 4, gumbo, indesign, indesign server, serge jespers, serge, anand, anand vardhan, text layout framework, tlf, player 9, player 10
It’s been very difficult to achieve WUSIWUG in Flex 3 (Flash Player 9) and InDesign Server, 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!!!
Speaking to Serge Jespers about this he accepted that Flash player is built differently. Also, Anand added that the new Text Layout Framework, 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.
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 release notes 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.
However, a point communicated by Jespers, that the TLF is made with the help of InDesign 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.
RIA in a new avtar with Flash Builder 4
June 22, 2009 at 8:13 PM | In Blog, Flex / AS, Programming | Leave a CommentTags: adobe, catalyst, flash builder 4, flex, flex 4, gumbo, sdk
Adobe Flash Builder, 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, Flex SDK version 4, Gumbo.
It is near to Adobe’s Creative Suite family. In Flash Builder 4, you can work with Flash MovieClip, import designs from Catalyst. So is pointer in that direction.
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!
Features with newer IDE is welcomed, especially network monitor. This eliminates need of httpfox and such third party browser plug-in!
Overall, Flex 4 seems to be reached to the community expectations!
Here is something more. Tim Buntel says this.
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.
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.
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)!
Features with newer IDE is welcomed, especially network monitor. This eliminates need of httpfox and such third party browser plug-in!
Overall, Flex 4 seems to be reached to the community expectations!
Flex (Flash Player) – DPI and input/output
May 29, 2009 at 5:22 PM | In Flex / AS, Internet, Programming, webApp | Leave a CommentTags: actionscript, adobe, dpi, flash, flash player, flex, image, inch, pixel, resolution, unit
DPI is often confused with screen resolution. Actually when screen resolution changes (in pixel height x width) the DPI rate is not necessarily changed.
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.
When image resolution comes into picture, DPI plays role to consider depth of an Image. More the DPIs, better is the image – depth.
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.
DPI is the somewhat similar concept of mega pixel – the camera term.
This term and its effect came into picture when I started input and output to real wprld from Flex application!
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.
So where the game is?
Above simple question puzzles many.
widthInch = widthPixels/DPI is the key!
Say you have image with 500 pixels, width in inch will be 500/DPI. So if DPI is 96, then width is 500/96inches.
In case of flash player, DPI rate is 96.
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.
Also, this bug post is strange upto my knowledge. Flash Player’s DPI seems constant, ignoring screen DPI.
Simple solution to a complex problem – customized Rich Text Editor
April 18, 2009 at 5:38 PM | In Flex / AS, Programming | 3 CommentsTags: control, customization, editor, flex, flex sdk, rich text editor, richtexteditor
Apparently, creating customized RichTextEditor component in flex was looking time consuming. The rich APIs that flex provides made this task easier.
I retrieved reference of different styling controls from a hidden richTextEditor object, arranged them as per my requirement, and its done!
I thought to make a custom editor with customized control positions is a big task, but is not what I thought!
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
<![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);
}
]]>
</mx:Script>
<mx:VBox id="controls" width="250" height="100">
<mx:HBox id="font" />
<mx:HBox id="effects" />
</mx:VBox>
<mx:Panel id="editor1" x="300" width="300" height="300"/>
<mx:RichTextEditor id="rte" visible="false" />
</mx:Application>
3 ways to get control in Flex over user input through Keyboard
February 10, 2009 at 6:10 AM | In Flex / AS, Programming | Leave a CommentTags: actionscript, flex, input text, text input, unicodeRange, validation
1. Use of restrict property. The following example allows only numeric input
<mx:TextInput id="textInput" restrict="0-9\-" />
2. Use of unicodeRange style property inside CSS (stylesheet) while embedding fonts. The following example restricts all special symbols except period sign(.).
@font-face
{
src:url("../assets/myFont.ttf");
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 [.] */
}
3. Use of Flex built in validator components. Following example calls handleValid and makes it sure that user does not leave inputComponent blank.
<mx:Validator id="reqValid" required="true" source="{inputComponent}" property="text" valid="handleValid(event)" invalid="handleValid(event)"/>
Parameter sequence disturbed : Web Service in Flex
January 31, 2009 at 12:05 AM | In Flex / AS, Programming | 1 CommentTags: actionscript, flex, flex builder, NuSOAP, parameter sequence, php, Programming, web service, wizard, WS
I implemented an application in Flex that used web service, written in PHP with NuSOAP library. The WSDL file that was available for Web Service is as under:
<?xml version="1.0" encoding="ISO-8859-1"?> <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://server" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://server"> <types> <xsd:schema targetNamespace="http://server" > <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> </xsd:schema> </types> <message name="saveImgRequest"> <part name="id" type="xsd:string" /> <part name="data" type="xsd:string" /> <part name="emailId" type="xsd:string" /> <part name="notes" type="xsd:string" /></message> <message name="saveImgResponse"> <part name="return" type="xsd:boolean" /></message> <message name="purchaseRequest"> <part name="id" type="xsd:string" /> <part name="data" type="xsd:string" /></message> <message name="purchaseResponse"> <part name="return" type="xsd:boolean" /></message> <portType name="purchasePortType"> <operation name="saveImg"> <input message="tns:saveImgRequest"/> <output message="tns:saveImgResponse"/> </operation> <operation name="purchase"> <input message="tns:purchaseRequest"/> <output message="tns:purchaseResponse"/> </operation> </portType> <binding name="purchaseBinding" type="tns:purchasePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="saveImg"> <soap:operation soapAction="http://server/webservice.php/saveImg" style="rpc"/> <input><soap:body use="encoded" namespace="http://server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> <output><soap:body use="encoded" namespace="http://server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> </operation> <operation name="purchase"> <soap:operation soapAction="http://server/webservice.php/purchase" style="rpc"/> <input><soap:body use="encoded" namespace="http://server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> <output><soap:body use="encoded" namespace="http://server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> </operation> </binding> <service name="purchase"> <port name="purchasePort" binding="tns:purchaseBinding"> <soap:address location="http://server/webservice.php"/> </port> </service> </definitions>
After carefully considering the sequence of parameters in web service method call, I tried to import Web Service through Flex Builder’s Import web service wizard.
Surprisingly, methods that are served by the Web Service have been detected with all parameters. But, with a surprise:
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!
Can anyone give reason?
Ignoring unwanted sequence through import wizard, I finally implemented Web Service with parameters as are there in WSDL, and it worked fine for me!
private function initAndCallWS():void
{
saveImageWebService = new WebService();
saveImageWebService.wsdl = "http://server/webservice.php?wsdl";
saveImageWebService.saveImg.addEventListener("result", resultHandler);
saveImageWebService.saveImg.addEventListener("fault", faultHandler);
saveImageWebService.addEventListener(LoadEvent.LOAD,loadHandler);
saveImageWebService.loadWSDL();
}
private function loadHandler(event:LoadEvent):void
{
saveImageWebService.saveImg("userID","image_content", "email@server.com", "notes");
}
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

