flex-spark

Embending images on CSS for an extended spark button (IconButton)

孤街浪徒 提交于 2020-01-16 18:25:12
问题 I have this IconButton: Class package extra { import spark.components.Button; import spark.primitives.BitmapImage; public class IconButton extends Button { private var _icon:Class; [SkinPart(required="false")] public var iconElement:BitmapImage; public function get icon():Class { return _icon; } public function set icon(val:Class):void { _icon = val; if (iconElement != null) { iconElement.source = _icon; } } override protected function partAdded(partName:String, instance:Object):void { super

Flex TextArea and TextInput on mobile not positioning correctly

纵饮孤独 提交于 2020-01-14 14:21:06
问题 I've had two issues when working with TextArea and TextInput on mobile components I don't know how to solve. The first is that the TextArea text does not position correctly and the second is that it overlaps other components. The issues occur when the TextArea is in a Scroller (or the soft keyboard activates and moves the TextArea position). You can see this if you add the code below to a mobile Application: <s:Scroller width="100%" height="100%" top="100" bottom="100"> <s:VGroup width="50%">

Spark datagrid with checkbox does not update correctly

孤街醉人 提交于 2020-01-13 07:19:27
问题 The checkboxes are updated correctly when I select one or more datagrid rows but when I select a checkbox for the first time the checkbox does not refresh until the pointer moves out of the datagrid row. How can I fix this? <?xml version="1.0" encoding="utf-8"?> <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:DataGrid id="dg" x="344" y="48" selectionMode="multipleRows" requestedRowCount="4"> <s

scrolling interval in a Spark List with Tilelayout oversized while using mouse wheel after scrolling with mouseclick

末鹿安然 提交于 2020-01-06 14:27:16
问题 I have a spark List with an item renderer and a tile layout. If I scroll by clicking with the mouse on the scroll bar and trying to scroll with the mouse wheel after that, there is a problem: The interval of the scrolling is oversized, instead of scrolling one item down (or up) the List scrolls 4 items down (or up). <s:List dataProvider="{myDataProvider}" itemRenderer="MyRenderer" left="11" right="11" bottom="3" top="10" useVirtualLayout="false" > <s:layout> <s:TileLayout columnAlign=

scrolling interval in a Spark List with Tilelayout oversized while using mouse wheel after scrolling with mouseclick

我怕爱的太早我们不能终老 提交于 2020-01-06 14:27:09
问题 I have a spark List with an item renderer and a tile layout. If I scroll by clicking with the mouse on the scroll bar and trying to scroll with the mouse wheel after that, there is a problem: The interval of the scrolling is oversized, instead of scrolling one item down (or up) the List scrolls 4 items down (or up). <s:List dataProvider="{myDataProvider}" itemRenderer="MyRenderer" left="11" right="11" bottom="3" top="10" useVirtualLayout="false" > <s:layout> <s:TileLayout columnAlign=

How do I make sure that there is always something selected in a Spark List?

佐手、 提交于 2020-01-06 08:33:10
问题 I have a spark list, which is based on a dataProvider. As the application runs, the data in the dataprovider can change, and also the dataProvider can be swapped for a different one What I need to do is make sure that something is always selected in the list (unless it is empty) 回答1: You simply have to set the property requireSelection of your list instance to true . In MXML, it would be: <s:List id="myList" requireSelection="true"> 回答2: After setting its data provider ( or whenever is

How to prevent an item from be selected in a List

a 夏天 提交于 2019-12-25 04:54:13
问题 How do I prevent an item from being selected in a List? Let's say you want to use it for display or other reasons. 回答1: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Solution 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Call preventDefault in the changing handler like so: <s:List id="list" dataProvider="{myCollection}" changing="list_changingHandler(event)"/> The List change handler: protected function list

Adobe Flex: toolTip of a spark component with enabled=false

不羁的心 提交于 2019-12-25 03:14:32
问题 I have a Spark Component (a Group) which doesn't behave as wanted. The tooltip is only shown when the component is enabled=true which the following example shows: <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" creationComplete="init(event)"> <s:layout> <s:HorizontalLayout /> </s:layout> <s:Group toolTip="test" enabled="false"> </s:Group> <mx:Canvas toolTip="test" enabled="false"> </mx:Canvas> </s

Flex: parentDocument inconsistent between SDK version 4.1 and 4.5

雨燕双飞 提交于 2019-12-24 07:48:50
问题 I'm seeing some inconsistencies with parentDocument between Flex SDK 4.1 and 4.5. In a nutshell, existing code that works in 4.1 is broken in 4.5 (and 4.6). Here's a small example to demonstrate: TestProject.mxml <?xml version="1.0" encoding="utf-8"?> <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" minWidth="500" minHeight="500" xmlns:local="*"> <local:SubComponent x="50" y="50"/> </s:Application>

How can I get the ItemRenderer of a Flex Spark List from its DataProvider Object?

試著忘記壹切 提交于 2019-12-23 12:28:58
问题 In Flex I can create an ItemRenderer to represent each item in the Lists DataProvider but how do I access the instance of the ItemRenderer via the DataProviders Object? Something like myList.getItemRenderer(dp.getItemAt(10)); 回答1: public function getItemRenderer(list:List, item:Object):ItemRenderer { var dataGroup:DataGroup = list.dataGroup; var n:int = dataGroup.numElements; for (var i:int = 0; i < n; i++) { var renderer:ItemRenderer = dataGroup.getElementAt(i) as ItemRenderer; if (renderer