flex4

HTTPService/ResultEvent with Flex 3.2 versus Flex >= 3.5

自古美人都是妖i 提交于 2019-12-10 10:28:53
问题 through a design decission or what-so-ever Adobe changed the content of the ResultEvent fired by a HTTPService Object. Take a look at following example: var httpService:HTTPService = myHTTPServices.getResults(); httpService.addEventListener(ResultEvent.RESULT,resultHandler); httpService.send(); /** * Handels the login process */ function resultHandler(event:ResultEvent):void { // get http service var httpService = (event.target as HTTPService); // do something } It works like a charm with

how to show a tooltip on a disabled control?

旧城冷巷雨未停 提交于 2019-12-10 02:28:59
问题 I'm displaying a list of buttons, some of which might be disabled. I need to show a tooltip on the disabled buttons with an explanation of why it's disabled, but it seems I can't disable the button without disabling the tooltip. Is there a simple way around this? 回答1: Wrap the Button in a Group, and apply the toolTip to the group instead. <s:Group toolTip="My toolTip"> <s:Button enabled="false"/> </s:Group> It's a bit ugly, but it works. 回答2: One way to do this is to override the enabled

What are good memory management techniques in Flash/as3

こ雲淡風輕ζ 提交于 2019-12-09 20:44:57
问题 So I am pretty familiar with memory management in Java, C and C++; however, in flash what constructs are there for memory management? I assume flash has a sort of virtual machine like java, and I have been assuming that things get garbage collected when they are set to null. I am not sure if this is actually the case though. Also is there a way to force garbage collection in Flash? Any other tips? Thanks 回答1: Flash bytecode is run by the AVM (Actionscript Virtual Machine). In general terms

Flex 4: State Change Event

∥☆過路亽.° 提交于 2019-12-09 16:11:36
问题 Is there any event in Flex 4 that I can use to detect a state change? 回答1: I know this question is old but by googling for state change events I still get here so for people that want to know: There is a StateChangeEvent.CURRENT_STATE_CHANGE event that is dispatched by the component, so your application can also listen for that. In your listener function you can then acces the StateChangeEvent.oldState and StateChangeEvent.newState properties. 回答2: If you are talking about view states the

Multilined itemRenderer for a spark.components.List - with test case and screenshot

点点圈 提交于 2019-12-09 03:21:28
问题 In the simple Flex 4 web application below - is it possible to change the custom item renderer MyRenderer , so that it wraps the too long lines? TestApp.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"> <fx:Script> <![CDATA[ import mx.collections.ArrayList; private static const MONTHS:ArrayList = new ArrayList([ "1 January is a beautyful month", "2 February

Spark TextArea or RichText autosize

谁说胖子不能爱 提交于 2019-12-08 21:12:01
问题 I have done lots of searching on this subject, but it seems what I am finding is either out of date or just does not seem to work. With TextFields in the past, you could set the TextField to a certain width, set wordWrap to true and you would end up with a textfield that changed height according to the text you added. Now I am trying to do this with either the Spark TextArea or RichText. I tried this HeightInLines = NAN, but that seems to be out of date. I also tried this routine: var

Override Object.toString Error

橙三吉。 提交于 2019-12-08 18:33:30
问题 Why does this produce an error in Flash Builder?: package { public class Foo { override public function toString():String { return "Foo"; } } } Tab completion suggests that this is available for override... Error message: Multiple markers at this line: -public -1020: Method marked override must override another method. -overridesObject.toString 回答1: Remove override on the toString() method. There is a popular misconception among about the toString() method, namely: if one wants to provide a

Skin Flex 4 combobox to look like Flex 3 combobox

心已入冬 提交于 2019-12-08 14:09:25
As I have migrated my application to Flex 4 recently, I want to utilize the <s:Combobox> component in my application rather than <mx:Combobox> . The problem is that the look and feel of both are different. How can I make the <s:Combobox /> component look (all skinning e.g. hover over, click, outline) exactly the same as <mx:Combobox /> ? More specifically, I want to apply the Halo theme to a DropdownList component. Is that possible? You could just set the default skin for your application to Hero instead of Spark. Assuming you're using Flash Builder: Click on Project -> Properties . Click Flex

Flex: get column index in custom itemrenderer for spark datagrid

倾然丶 夕夏残阳落幕 提交于 2019-12-08 13:03:47
问题 I am trying to use the same custom renderer for all the columns in a spark DataGrid . I need to know the dataField or columnIndex based on which I can change state in my custom itemrenderer. Earlier in mx:DataGrid, this can be achieved by extending the MXDataGridItemRenderer which implements IDropInListItemRenderer and hence dataGridListData property is available. But using the spark DataGrid, I am extending the GridItemRenderer which DOES NOT implement the IDropInListItemRenderer and hence

Saving form fields in a MySQL DB usinf Flex

时光毁灭记忆、已成空白 提交于 2019-12-08 12:37:27
问题 I have a MySQL database, and i created a DB and named it 'PERSONDB'. Within that DB, i have created a table and named it Person . This table has 3 fields. id,name,age . Now i need to save some values from my flex website to the mySQL 'PERSONDB' that i created. How can i do this in Flex (Flax builder 4.6) Note: I have added 2 fields name and age, in the Flex project and when the user clicks on the Button i need those values to be saved in the DB. how can i do this. 回答1: asSQL ( http://code