apache-flex

Is there a SVG to MXML Converter?

 ̄綄美尐妖づ 提交于 2020-01-03 01:45:39
问题 I'm trying to use an SVG file in my Flex app - but it seems the best way to do that is to convert it to MXML. However, I cannot find an SVG to MXML converter. There seem to be a number of SVG to XAML converters (for Silverlight/C#), but I can't find anything analogous for Flash/Flex. Any help would be appreciated. Thanks, Karthik 回答1: You should be able to Embed the SVG directly, without a converter. 回答2: yes, there are few libraries but i haven't come across any mature one- - http://code

Is there a SVG to MXML Converter?

时光总嘲笑我的痴心妄想 提交于 2020-01-03 01:45:19
问题 I'm trying to use an SVG file in my Flex app - but it seems the best way to do that is to convert it to MXML. However, I cannot find an SVG to MXML converter. There seem to be a number of SVG to XAML converters (for Silverlight/C#), but I can't find anything analogous for Flash/Flex. Any help would be appreciated. Thanks, Karthik 回答1: You should be able to Embed the SVG directly, without a converter. 回答2: yes, there are few libraries but i haven't come across any mature one- - http://code

Resize images in Flex using as3

跟風遠走 提交于 2020-01-02 21:51:07
问题 I am loading an image using a Loader. Once loaded, I can get the bitmap data using Bitmap(event.target.loader.content).bitmapData . However since the images I am loading are quite large (around 2000 x 1600), I would like to reduce the size and create a new smaller bitmap maybe 200 or 300 pixels wide, sort of like a thumbnail. I think it has to do with creating a new BitmapData with the new size. However I am not able to get that working properly. Any ideas? 回答1: Not tested, but this should

Connecting any database directly from flex

徘徊边缘 提交于 2020-01-02 19:37:10
问题 Is it possible to connect any database from flex directly? 回答1: Not unless you use Adobe AIR for desktop at which time you'd be using the SQLLite api's to create/connect to a sqlite database file. http://livedocs.adobe.com/flex/3/html/help.html?content=SQL_01.html Anything else is going to require a back end service to handle such transactions. 回答2: You can use asSQL as mentioned by michael, or use the Adobe Air runtime. However, this must be said about using this library: It is EXTREMELY

Actionscript Compiler directive

寵の児 提交于 2020-01-02 18:39:13
问题 I have an established pattern for lazy loading data from a server via AMF. private var _XeventDispatched:Boolean; private var _X:ArrayCollection; public function get X():ArrayCollection{ if(!_XeventDispatched && (_X==null || _X.length==0)){ var evt:Event = new Event();//whatever event is need for this data member dispatcher.dispatchEvent(evt); _XeventDispatched = true; } return _X; } public function set X(ac:ArrayCollection):void{ return _X; } This way the data is not loaded from the server

Custom “context menu” in flex

戏子无情 提交于 2020-01-02 10:33:17
问题 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

Synchronous calls using RemoteObject

南楼画角 提交于 2020-01-02 09:59:25
问题 Is there a way to make synchronous calls using RemoteObject in Flex? 回答1: All IO in Flex is asynchronous. The typical pattern to deal with this is to use an AsyncResponder. For instance: var t:AsyncToken = remoteObject.methodCall(); t.addResponder(new AsyncResponder(resultEvent, faultEvent)); 回答2: think twice when u want it to be synchronous. Do u know what synchronous mean? it will FREEZE your application until it receive data. Unless u are pretty sure that your remote calling can receive

Flex: How to call an actionscript function from htmlText anchor

元气小坏坏 提交于 2020-01-02 08:39:08
问题 Is there any way to call an action script function from an anchor which defined in TextArea component's htmlText property. Thank you 回答1: If this anchor is an href from an tag, you can dispatch events and handle them like that: <mx:Script> <![CDATA[ private function linkHandler(e:TextEvent):void { if (e.text == "test") trace("test called") } ]]> </mx:Script> <mx:creationComplete> <![CDATA[ textArea.htmlText="<a href='event:test'>Link!</a>"; ]]> </mx:creationComplete> <mx:TextArea id="textArea

Flex / AIR, how to set focus on a UI Control, Button, etc?

南楼画角 提交于 2020-01-02 08:19:48
问题 So, I'm trying to set focus on a specific button when the app launches (or later based on certain events), so that the user can simply hit return to press the button. None of the following approaches work however. protected function group1_creationCompleteHandler(event:FlexEvent):void { //btnBrowse.setFocus(); focusManager.setFocus(btnBrowse); } 回答1: Try: protected function group1_creationCompleteHandler(event:FlexEvent):void { callLater(btnBrowse.setFocus); } 回答2: Flex doesn't have focus on

Flex formitem label aligment oddity

ε祈祈猫儿з 提交于 2020-01-02 07:20:16
问题 I have paid a decent hair tribute to this one Why in the world, Label 1 and Label 2 have different vertical alignments? <s:Form width="100%"> <s:FormHeading width="100%" label="Heading" /> <s:FormItem width="100%" label="Label 1"> <s:HGroup verticalAlign="bottom"> <s:Label text="Size" fontSize="40"/> <s:Label text="Mb"/> </s:HGroup> </s:FormItem> <s:FormItem width="100%" label="Label 2"> <s:HGroup verticalAlign="middle"> <s:VGroup horizontalAlign="center"> <s:Label text="Set1" /> <s:Label