mxml

1120: Access of undefined property

二次信任 提交于 2019-12-11 10:52:31
问题 Why I'm getting a 1120: Access of undefined property arrMonth. error at the line arrMonth.push and how to correct it? <fx:Script> <![CDATA[ [Bindable] public var arrMonth:Array = new Array(); arrMonth.push({label: "January"}); ]]> </fx:Script> 回答1: The reason for that error is that your logic (the push statement) is not inside a method, hence it is considered to be at class level (i.e. static) instead of at the instance level. Which means there are two ways to fix it : 1/ Make the variable

Flex 4 - Vertical layout problem on TitleWindow

試著忘記壹切 提交于 2019-12-11 10:05:53
问题 This must be a simple problem, but I can't get my head around it. I have a resizable title window. Inside I just want a VGroup to hold the contents of the form and an HGroup to have a few buttons at the bottom. Very standard stuff. <!-- Content --> <s:VGroup id="content" height="340" width="100%"> ...more stuff in here... </s:VGroup> <!-- Buttons --> <s:HGroup id="buttonGroup" width="100%"> ...buttons in here... </s:HGroup> Horizonal resizing works fine. However, I want it to behave such that

Compiling swf from php using mxmlc and “exec” - loading config file but no swf in browser

人走茶凉 提交于 2019-12-11 06:21:04
问题 I'm on a RedHat server, with a simple PHP page that has a form, with inputs for name, phone, and url. When the form is submitted, I run a command to compile a swf using mxmlc. The command is this : $generate_command1 = "export _JAVA_OPTIONS=\"-Xms32m -Xmx64m\"; /opt/flex/bin/mxmlc -define+=NAMES::Name,\"\'$name\'\" -define+=NAMES::Phone,\"\'$phone\'\" -define+=NAMES::Website,\"\'$url\'\" -output /path/to/my/webserver/httpdocs/swfbuilder/generated.swf DynamicTextTest.as"; $last_line = exec(

Using HTML formatting to output variables in Flex/MXML

眉间皱痕 提交于 2019-12-11 03:54:31
问题 I'm trying to output a sentence containing 4 variables, with their values emboldened using the following code: <mx:Text width="100%" y="307"> <mx:htmlText> <![CDATA[Showing data from <b>{labelStartTime.text} {labelStartDate.text}</b> to <b>{labelEndTime.text} {labelEndDate.text}</b>]]> </mx:htmlText> </mx:Text> However, this just outputs the variable names, rather than their values. I'm sure I'm missing something simple, but I'd appreciate any pointers. Cheers. 回答1: I know of a workaround:

Looping over elements inside an element in Flex

浪子不回头ぞ 提交于 2019-12-11 03:42:02
问题 I have the following function in Flex 4: protected function initEventHandlers():void { imageContainer.addEventListener(DragEvent.DRAG_ENTER, acceptDrag); imageContainer.addEventListener(DragEvent.DRAG_DROP, handleDrop); img_1.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag); img_2.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag); img_3.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag); img_4.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag); } I didn't like the look of this code

Flex mxml custom component - how to add uicomponents?

青春壹個敷衍的年華 提交于 2019-12-11 02:13:14
问题 how to I pass in a uicomponent to a mxml custom component? ex: I want to pass in any number of buttons, and I want my custom component to lay them out in a certain order. MainApp.mxml: <?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="955" minHeight="600" xmlns:local="*" > <local:myComp > <s:Button label='Button1' /> <s:Button label='Button2' /> <!--I

Click-outside event on custom components in flex

牧云@^-^@ 提交于 2019-12-10 18:16:30
问题 Is there a way to write a custom event that gets triggered when the user clicks outside of that custom component instance? Basically anywhere else in the main flex app. Thanks. 回答1: You can use the FlexMouseEvent.MOUSE_DOWN_OUTSIDE event. For example: myPopup.addEventListener( FlexMouseEvent.MOUSE_DOWN_OUTSIDE, function(mouseEvt:FlexMouseEvent):void { PopUpManager.removePopUp(myPopup); } ); 回答2: stage.addEventListener( MouseEvent.CLICK, stgMouseListener, false, 0, true ); ... private function

Programatically enable/disable menuBar buttons in Flex 4

我是研究僧i 提交于 2019-12-10 16:38:31
问题 I have the following XML in my Flex4 (AIR) project that defines the start of my menu interface: <mx:MenuBar x="0" y="0" width="100%" id="myMenuBar" labelField="@label" itemClick="menuChange(event)"> <mx:dataProvider> <s:XMLListCollection> <fx:XMLList xmlns=""> <menu label="File"> <item label="New"/> <item label="Load"/> <item label="Save" enabled="false"/> </menu> <menu label="Help"> <item label="About"/> </menu> </fx:XMLList> </s:XMLListCollection> </mx:dataProvider> </mx:MenuBar> I am

use actionscript file in flex library

穿精又带淫゛_ 提交于 2019-12-10 11:44:28
问题 i want make own flex library and in this library use own actionscript file which will i use in more component in this library..this file contents eg only code public function computeSum(a:Number, b:Number):Number { return a + b; } but when i can this create just when i click File-New-Actionscript File (filename - OK) is in Problem view Error: A file found in a source-path must have an externally visible definition. If a definition in the file is meant to be externally visible, please put the

Javascript error on calling flex-AS function

 ̄綄美尐妖づ 提交于 2019-12-09 07:57:07
问题 I am trying to call call action script function from JS but i get the following error Error: getFlashMovie(swfobjectID).sayWhat is not a function Can any body let me know what am i doing wrong here <html> <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="myMovieName" WIDTH="225" HEIGHT="200"> <PARAM NAME="movie" VALUE="ax.swf" /> <PARAM NAME="quality" VALUE="high" /> <PARAM NAME="bgcolor" VALUE="#FFFFFF" /> <EMBED href="ax.swf" src="ax.swf" quality=high bgcolor=#FFFFFF NAME=