apache-flex

Flex Repeaters and EventListeners

风格不统一 提交于 2019-12-12 21:26:02
问题 At first glance, the Repeater control looks extremely powerful, but now I'm having second thoughts. Problem at hand: Adding Event Listeners to the children Repeater object is bound to and iterates through an ArrayCollection creating new Vbox children for each item. Now for each child, the Repeater object will fire off a "repeat" event, where I'm tempted to add the eventlistener (for mouse events). No problems so far, but, what happens when the ArrayCollection changes, how should I remove the

How to get a node from xml not knowing its level in flex?

℡╲_俬逩灬. 提交于 2019-12-12 21:13:26
问题 My question is, that how can I get the node in witch I want to insert: I.e <folder id="1"> <folder id="4"> <folder id="5"></folder> </folder> </folder> <folder id="2"> <file id="4"/> </folder> <folder id="3"> </folder> I want to get folder with id = 4, but that can be on any level. If folders couldn't contain one another than it would be like this myNode = xml.folder.(@id == 4). 回答1: Use the .. operator, it looks for all the nodes with given name and it doesn't matter how deep they are. For

Flex DataGrid with row number column

梦想与她 提交于 2019-12-12 21:03:19
问题 I want to extend the DataGrid component so that there is a (read-only) column for the row number like you see in spreadsheets. I came across this article http://www.cflex.net/showFileDetails.cfm?ObjectID=735 but it depends on the data being unique for each row so that it can index into the array. If the data is not unique (like for an empty grid) it doesn't work. How can I implement that? 回答1: This worked for me: <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[

How can I create a Flex application with dynamic height?

大城市里の小女人 提交于 2019-12-12 20:42:49
问题 Is there a way to allow a flex application to have a dynamic height while embedded in an HTML wrapper? I want the Flex application to grow in height in a way that it will not cause vertical scroll bars. 回答1: The best way should be overriding the Application's measure method like: private var _lastMeasuredHeight:int; override protected function measure():void { super.measure(); if (measuredHeight != _lastMeasuredHeight) { _lastMeasuredHeight = measuredHeight; if (ExternalInterface.available) {

Converting Date with Time in PST into UTC format

北慕城南 提交于 2019-12-12 20:40:14
问题 i am having a variable str(string type)having "28-Nov-2013 09:15 AM" as its value.How to convert it into UTC format(the above mentioned time in str variable is in PST, hence UTC should be 8 hours more than that).I am using flex 2.Find below is following code which is not working:- txtDate.text= formatDateUTC(txtDate.text); //here txtDate.text=28-Nov-2013 09:15 AM private function formatDateUTC(originalDate:String):String { Alert.show('original '+originalDate); var dtValue:Date = new Date(Date

How do I add the SWC file for Cairngorm to my app without FlexBuilder?

瘦欲@ 提交于 2019-12-12 19:30:47
问题 I am not using FlexBuilder, I'm using the free Flex SDK with TextMate. I'm having some trouble figuring out what this FlexBuilder process actually does behind all the nice dialogs and things, so that I can do the same thing by tweaking whatever the relevant file is, but Googling just points me at similar instructions telling me to use FlexBuilder. Anyone able to point me in the right direction? 回答1: mxmlc considers a swc a library (it's actually a zip file that you can examine) so you'll want

Different row styling in datagrid FLEX

旧时模样 提交于 2019-12-12 19:17:32
问题 I'm trying to change the font color of a row in a datagrid if a certain word is found in a datafield. Is there a simple, inline way to do this? Thanks 回答1: You can override your DataGrid 's drawRowBackground method, and check whether it needs custom background or not. If so, pass the new background color to the super call of this method: protected override function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void { if ((dataProvider[dataIndex]

flex datagrid - making grid height dynamic and component that contains it

ぐ巨炮叔叔 提交于 2019-12-12 19:15:06
问题 HI, i want to build a datagrid which will have a dynamic height value because the number of rows will always be different. I also want to communicate the height back to the component holiding it so that it also grows with the datagrid. Can anyone help me out on the best way to create such a dynamic datagrid. Thanks 回答1: The DataGrid's height is controlled by its rowCount property. If you want your DataGrid to always be exactly high enough to show all the contained elements (and, for example,

Detecting (on the server side) when a Flex client disconnects from BlazeDS destination

这一生的挚爱 提交于 2019-12-12 19:14:11
问题 I'd like to know whether it's possible to easily detect (on the server side) when Flex clients disconnect from a BlazeDS destination please? My scenario is simply that I'd like to try and use this to figure out how long each of my clients are connected for each session. I need to be able to differentiate between clients as well (ie so not just counting the number of currently connected clients which I see in ds-console). Whilst I could program in a "I'm now logging out" process in my clients,

How we implement “Please wait …” screen in flex when app is busy

让人想犯罪 __ 提交于 2019-12-12 19:05:11
问题 I have a function that restores all of the default settings of my application. This process can take a bit of time, so I would like to implement a "Please wait..." modal popup to let the user know that everything is alright and the program hasn't frozen. Once the function completes its task, I'd like for it to remove the message, and resume normal behavior. alt text http://www.freeimagehosting.net/uploads/c5906da30c.jpg 回答1: On start: var waitingpopup:TitleWindow = new TitleWindow()