mx:TextArea vertical scroll bar disabled - actionscript-3

I have a TextArea component as follows:
<mx:TextArea
id="textArea"
width="100%"
height="100%"
editable="false"
verticalScrollPolicy="on"
/>
My issue is that I populate the TextArea with a huge amount of text that needs to be scrolled through. The vertical scrollbar exists, but is disabled. Even though it is disabled the user can scroll using the mouse scroll.
Note: If I change the text later the scrollbar reenables.

The fix turned out simply using the spark component instead of mx component:
<s:TextArea
id="textArea"
width="100%"
height="100%"
editable="false"/>

Related

How to change label length on AS3 checkbox?

I have a checkbox label that needs to be about 50 characters long, but it's being truncated at 13 characters.
How do I code it to allow longer text in the label please?
Thank you
You can follow two different ways:
The first: Try in your checkBox (s: or mx:) to increase the width property
<s:CheckBox id="myChk" width="100" />
<mx:CheckBox id="myChk" width="100" />
The second: You can wrap your checkbox in a FormItem (s: or mx:) so, you can manage the width of FormItem and your checkbox manage only the tick select.
<s:FormItem id="myItem" label="AAAAAAAAAAAAAAAAAAAAAAAAAAAAA">
<s:CheckBox id="myChk" />
</s:FormItem>

Editable datefield focus issue in iexplorer

I have one textinput and beside that there is datefield which is editable="true".
Now, when i enter something in textinput and press tab then it focus on datefield but, not remove focus from <s:TextInput.
This happens only in internet explorer. Not any other browser having that issue.
I have just simple textinput and datefield.
<s:TextInput width="100" />
<mx:DateField width="100" editable="true" selectedDate="{new Date()}" />
Change that editable part to false and you are good to go , try listening to tab event (Keyboard and then change the focus)

Transition in Spark Components like BorderContainer, List, etc.,

I am developing flex mobile project in adobe air, using flash builder 4.7, i am able to apply Transition in views, How can i apply Transition to Spark components like BorderContainer, List...
<s:BorderContainer id="Login" backgroundAlpha="0" borderStyle="inset" visible="true" >
<s:Label width="100%" height="100%" color="white" text="Logon Details"/>
<s:TextArea prompt="UserName" id="txtuser" />
<s:TextArea prompt="Password" id="txtpwd" />
<s:CheckBox />
<s:Button id="btnlogin" color="white" fontFamily="Book Antiqua" fontWeight="bold"/>
<s:Button id="btnreset" color="white" fontFamily="Book Antiqua" fontWeight="bold"/>
</s:BorderContainer>
I would like to apply Transition for above BorderContainer, like moving BorderContainer to another location in screen on clicking a button.
Thanks in Advance...
Here is a little code to show you how to use a Tween manually, without a Transition.
<fx:Declarations>
<mx:Move id="myMove" target="{login}" xTo="200" yTo="500"/>
</fx:Declarations>
<s:Group width="100%" height="100%">
<s:BorderContainer id="login" />
</s:Group>
<s:Button id="button" click="myMove.play(); button.enabled=false;" />
You may find, for each Tween, some code example in the reference, such as this one.

Flex spark FormLayout on TileLayout columns

I always end up hard-coding things that appear to be so simple...
This is the scenario:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:Form>
<s:layout>
<s:TileLayout requestedColumnCount="2"
verticalAlign="middle" />
</s:layout>
<s:FormItem label="Label with long text">
<s:TextInput />
</s:FormItem>
<s:FormItem label="Label with long text">
<s:Label text="something" />
</s:FormItem>
<s:FormItem label="shortLabel">
<s:TextInput />
</s:FormItem>
<s:FormItem label="shortLabel">
<s:Label text="something" />
</s:FormItem>
</s:Form>
</s:Application>
Is there a simple way to give each tile layout column a FormLayout?
In form layout, all the first items on FormItem containers are aligned.
You have overridden form layout that's why elements are not aligned correctly.
As I understand you need multi columns form. Flex doesn't support such functionality now.
Possible solutions are:
1. Use 2 forms in container. In such case form items would be aligned.
2. Define form items sizes.
3. Write you own new multi column form layout and share it.
Spark FormLayout extends VerticalLayout, changing its inheritance to TileLayout in customLayout class(say FormTileLayout) worked for my project.

Setting button width with fx:Style

I have 4 buttons, all of them have the same width.
<s:Button id="btn1" width="{btnWidth}" />
<s:Button id="btn2" width="{btnWidth}" />
<s:Button id="btn3" width="{btnWidth}" />
<s:Button id="btn4" width="{btnWidth}" />
Is it possible to set their width with Style, something like this:
s|Button{
width: btnWidth;
}
I tried it, but auto-complete isn't working, which leads me to think that there's something wrong with the syntax. Basically my goal is to not have the width property set specifically for all 4.
It won't work out of the box because width is a property of button, not a style. You can only specify styles in your stylesheet.
However, what you can do is extending Button and add a style that controls the width of your button.