mxml

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

核能气质少年 提交于 2019-12-08 20:59:31
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 negligible difference. If you're going for the same functionality, MXML is not going to make your swf any

Thumbnails for mxml components in Flex

百般思念 提交于 2019-12-08 04:31:37
问题 Is it possible to make some kind of 'dynamic' thumbnails for mxml components which I'm using in my application? By 'dynamic' I mean if I change some layout in mxml component, my thumbnail refreshes according to new layout without any screen capturing, photoshoping or similar =) Edit: I am using a FlexBook component, which makes a 'book' of mxml components (because each page has many independent interactions). I think that problem could be that bitmap data does not exist until I actually start

draw a circular arc in MXML Graphics

浪尽此生 提交于 2019-12-08 02:04:23
问题 Is there a simple way to draw a circular arc in MXML graphics that doesn't involve beziers? Or should I create my own component? thank you ! f 回答1: I ended up creating my own mxml graphics component to draw arcs. I override Ellipse Spark primitive and use AS for the arc math - mostly copying this great post, which points to this code. 回答2: <s:Ellipse height="16" width="16"> <s:stroke> <s:SolidColorStroke color="0x000000" joints="square" caps="square"/> </s:stroke> <s:fill> <s:SolidColor color

Assign variable to MXML component ID

本小妞迷上赌 提交于 2019-12-07 23:58:17
问题 I have my custom component and for example few Label. I want to pass to my component value which will be assign to label's id. Code: <fx:Script> <![CDATA[ [Inspectable] [Bindable] public var test:String = "asd"; ]]> </fx:Script> <s:Label id="{test}" text="etc"/> Error: {test} is not a valid identifier Can I even do something like that? 回答1: No you can't. You have to understand that when you write an mxml component like <s:Group> <s:Label id="myLabel" /> </s:Group> it will generate

Unsupported sampling flex/actionscript

落花浮王杯 提交于 2019-12-07 09:15:04
问题 In action script i need Loading configuration file /opt/flex/frameworks/flex-config.xml t3.mxml(10): Error: unsupported sampling rate (24000Hz) [Embed(source="music.mp3")] t3.mxml(10): Error: Unable to transcode music.mp3. [Embed(source="music.mp3")] The code is <?xml version="1.0"?> <!-- embed/EmbedSound.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import flash.media.*; [Embed(source="sample.mp3")] [Bindable] public var sndCls:Class; public var

Assign variable to MXML component ID

馋奶兔 提交于 2019-12-06 12:31:02
I have my custom component and for example few Label. I want to pass to my component value which will be assign to label's id. Code: <fx:Script> <![CDATA[ [Inspectable] [Bindable] public var test:String = "asd"; ]]> </fx:Script> <s:Label id="{test}" text="etc"/> Error: {test} is not a valid identifier Can I even do something like that? No you can't. You have to understand that when you write an mxml component like <s:Group> <s:Label id="myLabel" /> </s:Group> it will generate ActionScript code like public class MyClass extends Group { public var myLabel:Label; } (Mind you, I grossly

Custom “context menu” in flex

前提是你 提交于 2019-12-06 11:20:01
I would like to add a custom context menu with line separators, but can't really figure out how. What I need: <mx:List id="treeContextFile" visible="false" width="233" verticalScrollPolicy="off" includeInLayout="false"> <mx:dataProvider> <mx:Array > <mx:String>Open</mx:String> <horizontal line here > <mx:String>Cut</mx:String> <mx:String>Copy</mx:String> <mx:String>Paste</mx:String> <horizontal line here > <mx:String>Rename</mx:String> <mx:String>Delete</mx:String> <horizontal line here > <mx:String>Properties</mx:String> </mx:Array> </mx:dataProvider> </mx:List> Here's a blog with an example

How to get response header using ActionScript? (Flash)

孤人 提交于 2019-12-06 07:26:48
So... I have a URL like www.example.com/stream/ I need to make any request to this url and get Http Rewspons header (like this one: HTTP/1.0 200 OK Content-type: video/x-flv Cache-Control: no-cache I do not need reponse body at all. After I get header need to emmidiatly close connection to that url (so stop to obtain data from it) How to do such thing (I use Flash builder) Aparently, that's possible in AIR (I've never tried it): http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLStream.html#event:httpResponseStatus The only other way I can think of is using a Socket

Flex custom item renderer for the displayed item in the combobox

喜你入骨 提交于 2019-12-05 21:03:31
问题 I am using a custom item renderer in a combobox to display a custom drawing instead of the default text label. This works fine for the dropdown list but the displayed item ( when the list is closed) is still the textual representation of my object. Is there a way to have the displayed item rendered the same way as the one in the dropdown? 回答1: By default you cannot do this. However, if you extend ComboBox you can add this functionality easily. Here is a quick example, it is a rough version

Unsupported sampling flex/actionscript

ε祈祈猫儿з 提交于 2019-12-05 16:20:42
In action script i need Loading configuration file /opt/flex/frameworks/flex-config.xml t3.mxml(10): Error: unsupported sampling rate (24000Hz) [Embed(source="music.mp3")] t3.mxml(10): Error: Unable to transcode music.mp3. [Embed(source="music.mp3")] The code is <?xml version="1.0"?> <!-- embed/EmbedSound.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import flash.media.*; [Embed(source="sample.mp3")] [Bindable] public var sndCls:Class; public var snd:Sound = new sndCls() as Sound; public var sndChannel:SoundChannel; public function playSound():void {