apache-flex

Flex PopUpManager: How can I detect the existence of a modal popup?

孤人 提交于 2019-12-12 11:48:19
问题 My Flex 3 application has some modal dialogs displayed via the PopUpManager, but there are times when I'd like other view components to know there is popup displayed. The PopUpManager doesn't have any method for actually checking the existence of popups. Is there any other way to detect this in flash/flex without writing my own global manager? (also systemManager.popUpChildren.numChildren == 0 even when there's a modal popup) Cheers. 回答1: I think it depends on the way you are adding the popup

flex: how to prevent PASTE (ctrl+V) in a flex3 textinput?

眉间皱痕 提交于 2019-12-12 11:42:37
问题 Hello I need to disable pasting text in a textinout (flex3) : CTRL+V Any idea ? reagrds 回答1: This only block pasting more than one letter, but it does work for most purposes: <mx:TextInput textInput="if (event.text.length > 1) event.preventDefault()"/> and for spark: <s:TextInput change="if (event.operation is PasteOperation) (event.target as SkinnableTextBase).text = '' " /> 回答2: I'm afraid you can't with the TextInput : TextField objects do not dispatch clear, copy, cut, paste, or selectAll

How do you convert a String into a Boolean in ActionScript?

心不动则不痛 提交于 2019-12-12 11:15:11
问题 I have the following code: var bool:String = "true"; Without an if block or switch statement, how can this be converted into a Boolean object? 回答1: You can use: var boolString:String = "true"; var boolValue:Boolean = boolString == "true"; // true var boolString2:String = "false"; var boolValue2:Boolean = boolString2 == "true"; // false Edit A comment below suggests using var boolValue:Boolean = (boolString == "true") ? true : false; This is just complicating the code for no reason as the

How to create “Browse for folder” dialog in Adobe FLEX?

亡梦爱人 提交于 2019-12-12 10:46:37
问题 Know someone, how to create "Browse for folder" dialog in Adobe FLEX? And it is possible? Thanx. 回答1: If it's an Air app you can do : var f : File = new File; f.addEventListener(Event.SELECT, onFolderSelected); f.browseForDirectory("Choose a directory"); If it's a pure As3 app, you cannot Browse for folder, you can just browse for file via FileReference class. 回答2: in Web, for multiple file upload, (for single file upload, use FileRefernce) private var _refAddFiles:FileReferenceList; private

Flex: Sort — Writing a custom compareFunction?

我是研究僧i 提交于 2019-12-12 10:38:51
问题 OK, I am sorting an XMLListCollection in alphabetical order. I have one issue though. If the value is "ALL" I want it to be first in the list. In most cases this happens already but values that are numbers are being sorted before "ALL". I want "ALL" to always be the first selection in my dataProvider and then the rest alphabetical. So I am trying to write my own sort function. Is there a way I can check if one of the values is all, and if not tell it to do the regular compare on the values?

HTTPService AsyncToken and AsyncResponder example

百般思念 提交于 2019-12-12 10:15:47
问题 Where can I find an example of Flex application which implements an HTTPService asynchronously called by an AsyncToken and an AsyncResponder? Thanks in advance the httpservice send a string like this with a certain frequency: row#column#number#row#column#number#row#column#number#.... EDITED CODE: <?xml version="1.0" encoding="utf-8"?> <mx:Application creationComplete="onCreationComplete()" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.rpc

How to customize highlighted data point circles in Flex charts?

与世无争的帅哥 提交于 2019-12-12 10:14:35
问题 I need to customize a look and feel of standard Flex LineChart with LineSeries. I cannot figure out how to change default circles drawn when the mouse pointer is over a data point. 回答1: If you want to remove those circles, set property showDataTipTargets of chart to false . If you want to customize them, you can: Create your custom dataTipRenderer and perform skinning and drawing there. OR Extend your LineChart and override positionAllDataTips method, which is defined in ChartBase class. Here

Flex HTTPservice and POST, Sending Files?

人盡茶涼 提交于 2019-12-12 10:00:58
问题 I use a basic Post to send data to a Django server. The data consists of a base64 encoded 640*380 PNG image dynamically created by the flex component. <mx:HTTPService id="formSend" showBusyCursor="true" useProxy="false" url="http://127.0.0.1/form/" method="POST" result="formSentConfirmation(event)" fault="formSendingFailed(event)"/> private function sendForm(url:String, message:String, meteo:Number):void { formSend.url = url; var params:Object = { message: message, image_data: getEncodedImage

Flex: Call function from included component

自作多情 提交于 2019-12-12 09:53:28
问题 This is similar to my previous posting. But this time I want to call a function that exists on the main mxml page. This is my main mxml page: main.mxml <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*"> <mx:Script> <![CDATA[ public function changeText(currentText:String):void{ switch (currentText){ case "changeText": lblOne.text = "More Text"; } } ]]> </mx:Script> <mx:HBox x="137.5" y="10" width="100%" height="100%"> <ns1:menu id="buttons"> </ns1:menu>

Specifying a unicode range in an actionscript regular expression

孤街醉人 提交于 2019-12-12 09:47:53
问题 I have been trying to write a regular expression that would match all unicode word character something like : /[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\w]/gi But this completely fails and doesn't match anything. I have tried a variety of expressions and it seems that as soon as I try to specify a range it fails. As anyone been luckier than me? I wish actionscript would offer something like \p{L}, but if there's anything in the like, I couldn't find it in the doc. 回答1: You can use String