apache-flex

How do I retrieve the node name from XML in Flex / Actionscript

耗尽温柔 提交于 2019-12-23 04:20:49
问题 I have some data xml data that looks like this <root xsi:noNamespaceSchemaLocation="test1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <configuration> <CLICK/> <KLT/> <DETd/> </configuration> </root> I get a list of the configurations using var results:XMLList = xml.configuration.*; Now I want to loop over the XMLList and output CLICK, KLT, DETd etc. but how in XML do I get the node name as such 回答1: XML: <root> <parentNode> <childNode1>1</childNode1> <childNode2>2</childNode2>

URLLoader loads multi files and the result order is the same as call load()

守給你的承諾、 提交于 2019-12-23 03:21:42
问题 Since URLLoader is async, how to make sure the order of data from server side is the same as the loader.load() call? In other words, the data order in totalResults is the same order of url-related content? Following is code snippet: 1.for each(var url in urls) { loadData(url); } 2.private function loadData(url:String):void { var urlLoader:URLLoader = new URLLoader(); urlLoader.addEventListener(Event.COMPLETE, completeHandler); var request:URLRequest = new URLRequest(url); urlLoader.load

Get ActionScript Classes that Implement an Interface

谁说我不能喝 提交于 2019-12-23 03:12:27
问题 In ActionScript (AS3) how do I find all the classes that implement a particular interface? 回答1: In OOP terms, you never want to be able to do this: the primary characteristic of interfaces is they are terms of a contract. Any class can choose to fulfill that contract and be able to say "I implement this interface". Any code that references an instance of the interface don't care what class actually implements it: they don't have to; that's the really cool part of interfaces. But if you want

Flex mobile project does not support mx:Canvas?

时光总嘲笑我的痴心妄想 提交于 2019-12-23 02:43:08
问题 In Flash Builder, if I new a Flex Mobile Project, and paste the following code: <?xml version="1.0"?> <!-- Simple example to demonstrate the Halo Canvas layout container. --> <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:Group/> <mx:Canvas/> </s:Application> The "Canvas" line fails to compile. However it's OK in a Flex Project. My question is, is there any way to use Canvas or other halo

How to determine what files MXMLC compiles

泪湿孤枕 提交于 2019-12-23 02:25:08
问题 I need a way to programmatically record what source files are consumed in an MXMLC compile. Ideally there would be a flag to pass to MXMLC to have it report the complete list of source files it is compiling, but there doesn't seem to be such a flag. It seems generally you just pass a main.mxml file to MXMLC and it goes off and compiles everything it needs to without telling you what it's doing. As far as I can tell, you also cannot explicitly list the files for it to compile; it will resolve

What overhead is there of using an MXML file in Flex vs. a plain actionscript class?

时光怂恿深爱的人放手 提交于 2019-12-23 02:01:57
问题 I find it much easier to write MXML classes with embedded Script than trying to make an actionscript file. I was wondering however what kind of overhead there is of using an MXML file - in terms of file size. I'm not especially concerned about performance, but if that is relevant would be interested in any findings. Obviously I'm talking about UI components that have layout. MXML is MUCH easier to visualize and modify but I'm unclear exactly what it compiles down too. I'm hoping there is a

Adding the replaceAll method to the ActionScript String class

北城余情 提交于 2019-12-23 01:53:02
问题 I need some help in adding the replace all functionality into my Flex project. I would prefer doing this in a way that is as natural as possible. What I want to achieve is to be able to run this code (with the Flex compiler) "aabbaaba".replaceAll("b","c") and get "aaccaaca" . Also I want to chain replaceAll calls. Note: I won't be actually replacing b s with c s, but various string that will not be known at coding time! What I don't want: 1. Use regular expressions with the global flag. The

In flex, is there a way to capture and optionally cancel a row selection event in a DataGrid?

假如想象 提交于 2019-12-22 23:00:34
问题 This should be trivial, but I can't seem to figure out a way to do this. I have a DataGrid, and what I would like to do, is when a user clicks on a row to select it, check a certain condition, and if it's met prevent the row from getting selected and keep the old selection intact. Thanks! 回答1: I didn't test it, but it should work using event.preventDefault() and/or event.stopImmediatePropagation() on the GridSelectionEvent.SELECTION_CHANGING event. //stupid function but used for example

In flex, is there a way to capture and optionally cancel a row selection event in a DataGrid?

我的未来我决定 提交于 2019-12-22 23:00:27
问题 This should be trivial, but I can't seem to figure out a way to do this. I have a DataGrid, and what I would like to do, is when a user clicks on a row to select it, check a certain condition, and if it's met prevent the row from getting selected and keep the old selection intact. Thanks! 回答1: I didn't test it, but it should work using event.preventDefault() and/or event.stopImmediatePropagation() on the GridSelectionEvent.SELECTION_CHANGING event. //stupid function but used for example

Difference between calling stage.width and stage.stageWidth?

核能气质少年 提交于 2019-12-22 21:11:26
问题 In as3 What is the difference between calling stage.width and stage.stageWidth I read somewhere that if we have nothing on stage then the value of stage.width is 0 , but what happen when I have nothing on stage but loading contents dynamically on stage? I have tried this and when i have loaded content dynamically on stage then i have got stage.width=value; // where value is dynamic number Can anyone explain this?? thanks. 回答1: According to the Adobe Reference for the Stage Class: stage.width