mxml

How to include an actionscript function from an external file in flex4/MXML/Spark?

感情迁移 提交于 2019-12-13 04:34:07
问题 It turns out that’s it’s impossible to declare a class inside a embedded <fx:Script><![CDATA[ so it turns I need to put and include the actionscript code inside an external Sourcefile. The error is commented out <?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" minWidth="1955" minHeight="1600"> <fx:Script source="URLRequest.as" /> <s:layout> <s:BasicLayout /> </s

Get ids in Action script/mxml

≡放荡痞女 提交于 2019-12-13 04:06:17
问题 Io the following code how to get all the ids for fruits image onlcick of the button.Is there like a class attribute and get the ids then.... <?xml version="1.0" encoding="utf-8"?> <mx:Application layout="absolute" xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import mx.effects.easing.Quadratic; public function clickhandler(event:Event):void { //How to get all the ids of fruits.jpg image only } ]]> </mx:Script> <mx:Move id="fruitAnimation1" target="{fruitImage}" xTo="100"

how to call mxml application from action script

与世无争的帅哥 提交于 2019-12-13 03:45:03
问题 I've one main.mxml which has login button which looks like below - <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#C4D4EF" layout="absolute"> <mx:HTTPService id="serverCall" method="POST" url="http://localhost:8080/LDAPService/reg" result="on_Result(event)" fault="on_Fault(event)" /> <mx:Script> <![CDATA[ private function on_Result(event:ResultEvent):void { // How to write here } ]]> </mx:Script> <mx:Panel x="414" y="145" width="355" height="200" layout="absolute"

Weird Behaviour-CheckBoxes as ItemRenderer within Flex DataGrid - FLEX 3

十年热恋 提交于 2019-12-13 02:28:49
问题 I'm having this weird behaviour in a datagridColumn which I've customized to have its cells rendered as checkBoxes rather than the dafault itemRenderer (i.e. strings). The relevant code is as follows: <mx:DataGridColumn sortable="false" textAlign="center" headerText="" width="20" dataField="colCB"> <mx:itemRenderer> <mx:Component> <mx:CheckBox selected="true"> <mx:Script> <![CDATA[ import mx.controls.Alert; public function change():void{ //TODO } ]]> </mx:Script> </mx:CheckBox> </mx:Component

How to know if there are sub items/nodes in an AdvancedDatagrid

我们两清 提交于 2019-12-12 04:37:46
问题 To summarize: How can I remove a node branch (level 1) if it has zero Data items? And in turn also remove Node at higher level 0 if it's sub items are (empty or have been) removed? After much searching on the internet I still need to know if how to find out if an AdvancedDatagrid or a "node" contains children. How to know if it's empty or has "something"? With it, I will be able to filter it with my function.. (Expalined below): Firstly I apologize for my bad english. I have an

Show a threshold line in Flex Chart

感情迁移 提交于 2019-12-12 04:32:28
问题 I am stuck with a requirement to display a horizontal line on a ColumnChart to indicate a threshold level. I have the data to the Chart as an ArrayCollection . So my question here : Is it possible to get the location of a value that is shown on the y axis? I think I will be able to place a line or 1px high canvas on top of the Chart to achieve this. Or better, is there any built in functionality that i may have overlooked or is there some open library that can achieve something like this? 回答1

How do I access the root element of an MXML document if I can't set an id?

夙愿已清 提交于 2019-12-12 04:04:45
问题 If I wanted to do something like this: <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" horizontalScrollPolicy="off" verticalScrollPolicy="off" xmlns:view="com.foo.bar.view.*" > <mx:Script> <![CDATA[ myWidth = 100; myHeight = 200; myCanvas.width = myWidth; myCanvas.height = myHeight; ]]> </mx:Script> </mx:Canvas> How would I get a handle on myCanvas (where I'd want myCanvas to be the root )? 回答1: To access the component specified by the root node from within an mxml file, you can use this

how to I make my flash AS3 game save progress

匆匆过客 提交于 2019-12-11 23:19:21
问题 I have this flash game that I've been working on that works out of the browser, and I'm looking to get it to save it's progress. I've seen multiple flash games that have accomplished this, and It appears as though they've done this client-side, and I'd like to do the same. My game consists of 1 mxml file and a number of .as files and I compile it from the command line using flex sdk. What do I have to do to be able to save save my game's data? 回答1: As others have mentioned, SharedObject is

pass data to child swf after swf loading completed

元气小坏坏 提交于 2019-12-11 16:48:07
问题 I am loading one swf file inside a main swf by using swfloader and i want to pass the parameters to the loaded swf. How can i get the loaded child reference to pass data. My sample code is as follows TestFile1.mxml public var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, myFun); loader.load(new URLRequest("/view/flex/TestFile2.swf"), new LoaderContext(false, ApplicationDomain.currentDomain)); viewId.addChild(loader); public function myFun(event:Event)

RadioButton functionality in custom component

耗尽温柔 提交于 2019-12-11 15:00:11
问题 I am trying to create an xmxl component which contains an image and a radio button. The main application script will use several of these components. I am having problems trying to get the RadioGroup to function properly. I have binded a variable on the RadioButton groupName attribute in the component mxml file so I can set this in the main application script. This functions properly as when I tab through each RadioGroup, only the first radiobutton of each group gets the focus. But when I