apache-flex

Is it possible to do lightweight REST calls in Flex?

时光总嘲笑我的痴心妄想 提交于 2020-01-01 07:00:08
问题 We are converting a Flex application to use some REST APIs. When adding the mx.rpc.http.HTTPService class to the code, the SWF binary output grew from 175KB to 260KB. This is an unacceptable hit. Is there any better way to do lightweight REST calls from a Flex app? Are we better off using an external interface JS just to make the calls from there? 回答1: flash.net.URLLoader is built into the runtime and won't cause any increase in filesize. I've used it as a JSON client before, so you shouldn't

Why does Flex's ArrayCollection's Contain method look at memory reference?

那年仲夏 提交于 2020-01-01 05:36:08
问题 When using .contains() on an ArrayCollection in Flex, it will always look at the memory reference. It does not appear to look at an .equals() method or .toString() method or anything overridable. Instead, I need to loop through the ArrayCollection every time and check each individual item until I find what I'm looking for. Does anyone know why Flex/ActionScript was made this way? Why not provide a way from people to use the contains() method the way they want? 回答1: Couldn't you just extend

Disadvantages of a Flex project vs an Actionscript project?

折月煮酒 提交于 2020-01-01 05:15:06
问题 I've recently started making a game in FlexBuilder. The game is currently a Flex project. Is there any downside to using Flex as opposed to just Actionscript? A friend of a friend told me that Flex is slower than an Actionscript project. I've been unable to validate this on the internet; is there any truth to that claim? Thanks! 回答1: If you're developing a game, you should be using an ActionScript project. Flex is to be used only for data driven applications and user interfaces. The flex

Pass data between flex components

淺唱寂寞╮ 提交于 2020-01-01 03:39:09
问题 I'm new to flex , so forgive me if this is a dumb question. Right now I'm using custom events to pass data from one component to another. My problem is that events only bubble up. How can I pass data to a component that isn't a parent of the component dispatching the event? Here's the basic layout. I'm trying to get data from component 1 passed to component 3. Application MXML Component 1 Component 2 Component 3 回答1: If a piece of data is required by all components in a graph/tree, your best

ActionScript library to convert Markdown to HTML

徘徊边缘 提交于 2020-01-01 03:15:09
问题 I'm currently working on a Flex 3.0 project in which I have to display some input text with minimum formatting. We are considering to use "markdown" as the chosen way to express this formatting, now I would like to know if there is a library for this purpose. 回答1: You could use my AS3 port of John Fraser's Showdown. // Usage: var text = "Markdown *rocks*."; var html = Showdown.makeHtml(text); // <p>Markdown <em>rocks</em>.</p> 来源: https://stackoverflow.com/questions/820212/actionscript

LoaderContext and ApplicationDomain changes with Adobe AIR?

荒凉一梦 提交于 2019-12-31 22:28:09
问题 I'm currently experimenting with loading external SWF files from both an standard AS3 application, and an AIR application. It seems that the AIR application doesn't act the same way a standard SWF run by the Flash Player does. According to the documentation, the applicationDomain property of LoaderContext is usable in an AIR application too, but it just seems to be not working. I have the following code : package { import flash.display.Loader; import flash.display.LoaderInfo; import flash

LoaderContext and ApplicationDomain changes with Adobe AIR?

断了今生、忘了曾经 提交于 2019-12-31 22:27:25
问题 I'm currently experimenting with loading external SWF files from both an standard AS3 application, and an AIR application. It seems that the AIR application doesn't act the same way a standard SWF run by the Flash Player does. According to the documentation, the applicationDomain property of LoaderContext is usable in an AIR application too, but it just seems to be not working. I have the following code : package { import flash.display.Loader; import flash.display.LoaderInfo; import flash

Adobe AIR - Custom Preloader with Image

泪湿孤枕 提交于 2019-12-31 07:39:45
问题 Folks, I have designed an Adobe AIR application. I want to show some preloader on it, before it opens up. Can anyone guide me with tutorials on preloader aimed for AIR specifically or any already built in ones? Thanks 回答1: With AIR I can think of a couple of ways to achieve that: 1. with native windows Set the 'visible' attribute of your main WindowedApplication to 'false'. On 'creationComplete' event spawn a new Window that contains your splash screen. Perform the necessary logic before

How to insert data from dynamic array to sqlite db getting from WebService Using Loop in action script 3.0 and flex

萝らか妹 提交于 2019-12-31 06:03:49
问题 How can I insert dynamic Array to data base using Loop at the success of the Webservice call first my Webservice which i have Bind to DataGrid <fx:Declarations> <mx:WebService id="ws" wsdl="http://localhost:2690/vtrServices.asmx?wsdl"> </mx:WebService> <vtrservices:VtrServices id="vtrServices" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true" result="vtrServices_resultHandler(event)" /> <s:CallResponder id="SignIn1Result2"/> <s:CallResponder id

How to hide print dialog box in Flex?

∥☆過路亽.° 提交于 2019-12-31 04:41:47
问题 Is it possible to hide the printing dialog in flex? I'm using the class FlexPrintJob. Here's my code: var print:FlexPrintJob = new FlexPrintJob(); print.printAsBitmap = true; if ( print.start() ) { print.addObject( img as UIComponent, FlexPrintJobScaleType.SHOW_ALL ); print.send(); } 回答1: you can use start2() from the printjobs class import flash.printing.PrintJob; import flash.printing.PrintUIOptions; var myPrintJob:PrintJob = new PrintJob(); var uiOpt:PrintUIOptions = new PrintUIOptions();