mxml

How would I include an MXML file inline another MXML file?

一曲冷凌霜 提交于 2019-12-05 10:38:22
I would like to include an MXML file in my MXML file in the same way you can include an external file in AS3 using the include directive. Using the include directive brings the code from the external file into the original file at compile time placing it in the same scope. For example, Application.mxml: <Application> <source="external.mxml"/> </Application> External.mxml: <Styles/> <Declarations> <Object id="test"/> </Declarations> I need to keep this code/mxml/xml in the external file in scope with the original. Do not ask me why I want to do this. Another example. Here is my current code

communication between two flex apps

最后都变了- 提交于 2019-12-05 07:02:09
I have 2 flex apps on the same page. I want them to be able to call each other's public functions. I am thinking of using either externalInterface calls or FaBridge to do so. Is there a better way to do it? David Verhasselt The best way to go is to use LocalConnection . It allows you to call methods from a separate SWF without having to go through Javascript or a server. Tip: if you're going to be sending arguments that are greater than about 20KB in size, you will want to split them up in two or more calls. In my experience LocalConnection calls have a limit of around that size for data. 来源:

How to delete part of a string in actionscript?

倖福魔咒の 提交于 2019-12-05 02:29:31
问题 So my string is something like "BlaBlaBlaDDDaaa2aaa345" I want to get rid of its sub string which is "BlaBlaBlaDDD" so the result of operation will be a string "aaa2aaa345" How to perform such thing with actionscript? 回答1: I'd just use the String#replace method with a regular expression: var string:String = "BlaBlaBlaDDD12345"; var newString:String = string.replace(/[a-zA-Z]+/, ""); // "12345" That would remove all word characters. If you're looking for more complex regular expressions, I'd

Why isn't the swfloader working?

柔情痞子 提交于 2019-12-04 06:15:07
问题 I am trying to use the mxml swfloader component to load the external flash from the following url, but it doesn't load anything. I'm using FlashBuilder 4.5. http://somesite.com/en/interface.swf?token=123 I have no idea why it isn't working. 回答1: My guess is that you have a Sandbox Security violation. You can't load a swf from another domain/port without having a crossdomain xml. 回答2: if swf is from another domain, u should probably add into your code System.security.allowDomain("domain"); 回答3

How to inherit states with mxml?

梦想与她 提交于 2019-12-04 02:41:11
I have the following panel component called AdvancedPanel with controlBarContent: <!-- AdvancedPanel.mxml --> <s:Panel> <s:states> <s:State name="normal" /> <s:State name="edit" /> </s:states> <s:controlBarContent> <s:Button includeIn="edit" label="Show in edit" /> <s:Button label="Go to edit" click="{currentState='edit'}" /> </s:controlBarContent> </s:Panel> I created a second panel, called CustomAdvancedPanel based on the AdvancedPanel since I don't want to redeclare the controlBarContent <!-- CustomAdvancedPanel.mxml --> <local:AdvancedPanel> <s:Button includeIn="edit" label="Extra edit

How to delete part of a string in actionscript?

霸气de小男生 提交于 2019-12-03 20:17:39
So my string is something like "BlaBlaBlaDDDaaa2aaa345" I want to get rid of its sub string which is "BlaBlaBlaDDD" so the result of operation will be a string "aaa2aaa345" How to perform such thing with actionscript? I'd just use the String#replace method with a regular expression: var string:String = "BlaBlaBlaDDD12345"; var newString:String = string.replace(/[a-zA-Z]+/, ""); // "12345" That would remove all word characters. If you're looking for more complex regular expressions , I'd mess around with the online Rubular regular expression tester. This would remove all non-digit characters:

How do I attach camera to Spark.components.VideoDisplay

£可爱£侵袭症+ 提交于 2019-12-03 16:32:14
I'm using Flash Builder and created a spark-application Flex project that will stream video from the local camera. If I use mx.controls.VideoDisplay ; there is no problem since it has attachCamera(camera) method. But Spark's VideoDisplay component does not have that method. I know I can use mx controls inside a Spark app but I want to know: What is the real difference between spark.components.VideoDisplay and mx.controls.VideoDisplay ? How do I attach camera to spark.components.VideoDisplay ? Is there any advantages if I go with spark (since it's newer to mx library)? thanks. EDIT : In the

Javascript error on calling flex-AS function

妖精的绣舞 提交于 2019-12-03 09:11:27
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="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"> </EMBED> </OBJECT> <script> function

Flex - Problems in accessing static variable on another mxml page

橙三吉。 提交于 2019-12-02 15:01:10
问题 First.mxml - Contains a Datefield control as follows: <mx:DateField id="G2_CRTLoadDate" width="150" selectedDate="{modelProxy.G2_CRTLoadDate}" change="{modelProxy.G2_CRTLoadDate = event.currentTarget.selectedDate;changeManagerStatus()}"/> I'm assigning this Datefield value to a static variable CERT_LOAD_DATE as follows( First.mxml ): [Bindable] public static var CERT_LOAD_DATE:String = ""; private function changeManagerStatus():void { CERT_LOAD_DATE = G2_CRTLoadDate.selectedDate.toDateString(

Flex - Problems in accessing static variable on another mxml page

隐身守侯 提交于 2019-12-02 08:43:16
First.mxml - Contains a Datefield control as follows: <mx:DateField id="G2_CRTLoadDate" width="150" selectedDate="{modelProxy.G2_CRTLoadDate}" change="{modelProxy.G2_CRTLoadDate = event.currentTarget.selectedDate;changeManagerStatus()}"/> I'm assigning this Datefield value to a static variable CERT_LOAD_DATE as follows( First.mxml ): [Bindable] public static var CERT_LOAD_DATE:String = ""; private function changeManagerStatus():void { CERT_LOAD_DATE = G2_CRTLoadDate.selectedDate.toDateString(); } Second.mxml -Here, I have a Combobox as follows: <mx:ComboBox id="General_Release_Dates"