flex4

Flex 4.5 JSON check for existence of key before exception?

对着背影说爱祢 提交于 2019-12-13 04:34:25
问题 Is it possible to check for the existence of a key before Flex 4.5 JSON throws an exception for key not found? I have some json data where some keys are not always present. I am using CallResponder... The issue is that when you try accessing callResponder.lastResponse.key - and, say, key is not always present in your json, Flex won't be able to parse it. This happens even if you check if (callResponder.lastResponse.key) - the error occurs on the if line, in that case (See old error dump here)

in Flex how do I make a window not resizable?

好久不见. 提交于 2019-12-13 04:23:31
问题 So I'm trying to open a second window that is meant to be a fixed size window. I've set resizable property to false but that doesn't seem to have any effect. here's my sample code Main app <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" height="600" creationComplete="onCreationComplete()"> <fx:Script> <![CDATA[ import foo.TestWindow; protected function

XML, TypeError: Error #1088: The markup in

拈花ヽ惹草 提交于 2019-12-13 02:26:36
问题 Can anyone see whats wrong with either the code to grab the XML or the XML file itself? It looks well formed to me and I don't see the cause of the error: A TypeError has occured: TypeError: Error #1088: The markup in the document following the root element must be well-formed. var file:String = 'config.xml'; var loader:URLLoader = new URLLoader(); var request:URLRequest = new URLRequest(file); loader.load(request); loader.addEventListener("complete", onComplete); loader.addEventListener(

Making a flash country map

陌路散爱 提交于 2019-12-13 00:24:38
问题 Hello I want to make a flash map of Europe where when you mouse over or out of each country something will happen, like changing the color of the country. See this image If I roll over Norway and then Sweden, Sweden will not be set to blue because Norway's bounding box is on top of Sweden, so I have to go a bit lower to roll over Sweden where it does not instersect with Norway. Is there a better way to achieve the same functionality? Like using Bitmap pixels. I have a sprite sheet of all

Multiple consumers per StreamingAmf connection?

可紊 提交于 2019-12-13 00:06:46
问题 I have an Adobe Air 2.0 application that is also utilizing Spring BlazeDS integration. Inside this application I have a couple of data grids. The design was for each grid's model to register a Consumer to listen for changes pushed from BlazeDS. The first grid instantiated works correctly, however each subsequent grid causes the following warning in BlazeDS [WARN] [Endpoint.StreamingAMF] Endpoint with id 'streaming-amf' received a duplicate streaming connection request from, FlexClient with id

how to specify height and width of flex alert box in css?

风格不统一 提交于 2019-12-12 22:58:56
问题 In my Flex 4 app I would like all my alert boxes to be a specific width and height, how do I specify that in the CSS? I want to avoid having to specify the width and height every time I want to show an alert, that's why I'd like to set it in the CSS, but does not look like there's a way to.. Something like this does not work: mx|Alert { height: 100; width: 300; } 回答1: You can do it Using Style + Code like this Define Style Properties as Alert { height:300; weight:300; } Note: height and

How to tell if the mouse cursor is over a component using the mouse coordinates?

余生颓废 提交于 2019-12-12 18:14:32
问题 I'm trying to determine with the help of a mouse event if I'm over a specific component. So right now I have two components, let's say buttonA and buttonB. ButtonA has a listener on it already listening for the mouse out event. ButtonB is flush against the edge of ButtonA. I need to find out the code for it. Here is more details: protected function _mouseOutHandler(event:MouseEvent):void { if (data.subCategories.length>0) { if (MOUSE IS NOT OVER BUTTONB) { } if (MOUSE IS OVER DROPDOWNB) { } }

Flex 4 - DataGrid with Button in cells

六眼飞鱼酱① 提交于 2019-12-12 12:15:34
问题 How can I add a button control in cells of a datagrid? I'm looking to have a button in each row of one column in the datagrid. The datagrid control rows don't need to be selectable in any way. 回答1: It's really quite simple. Just define a custom item renderer for the column <mx:DataGrid width="100%" height="100%" dataProvider="{this.someData}"> <mx:columns> <mx:DataGridColumn headerText="Buttons" > <mx:itemRenderer> <fx:Component> <s:ItemRenderer width="100%"> <s:Button label="{data.buttonName

How can I copy an ArrayCollection of transfer objects in actionscript?

假如想象 提交于 2019-12-12 09:19:01
问题 public function create():ArrayCollection{ var index:int = 0; var data:ArrayCollection = new ArrayCollection(); var length:int = originalData.length; for(index; index < length; index++){ data.addItem(originalData[index]); } return data; } originalData is the original state of my data from database. data is a copy of originalData used to be manipulated as the provider for my List component. There's a button I use to call the create() function above, that would mean, I want to revert all changes

MaxCharLimit on the TextInput according to it's width

旧巷老猫 提交于 2019-12-12 07:04:19
问题 I am using Flex 4.5 and I want to set the maximum characters limit according to the textinput width means if user enter more character then the textinput width it should not accept those extra characters. 回答1: unfortunately, i have no flex in front of me right now. You should know, how many space e.g. 20 characters needed and set this value to your textinput.width. Check out the widthInChars-property for the spark Textinput. Maybe you can work with a litte offset. When it works, you just have