actionscript-3

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

Determine if swf is in a “debug” player or mode

久未见 提交于 2020-01-01 03:15:48
问题 Is there a way using Flash (CS3+AS3) to determine if the published swf is running in a debug player or in Flash's debug mode? I'm aware that Flex provides the ability to setup different build targets (release/debug) and that you can use something like CONFIG::debug for #ifdef style inclusion of code at compile time. I'm imagining something like System.isDebug() but can't find anything. I want to use this because there's debug functionality in my app that I definitely don't want to be

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

Best practice for ActionScript 2 events - is there a way to simulate ActionScript 3-style events?

橙三吉。 提交于 2020-01-01 02:51:26
问题 I love the AS3 event model - it helps keep my code clean and lossely coupled. When I used to work on AS2 projects, my code was not so neat and classes were more reliant on one another. Due to AS2's strange handling of scope I never really got on with the AS2 event system. As I still occasionally have to work in AS2, my question is: Has anyone managed to simulate the AS3 event API in AS2, and if not, what is the best practice for listening to and dispatching events and handling scope? 回答1: Its

Flash AS3 EventDispatcher - any way of getting a list of registered listeners?

旧巷老猫 提交于 2020-01-01 02:42:25
问题 Is there any way of getting a list of registered listeners for an EventDispatcher ? I know that EventDispatcher has the hasEventListener method to tell you if any listeners are registered, but is there an easy way of interrogating the EventDispatcher to find out what the listeners are? One way I figured to do this was to subclass EventDispatcher to override the addEventListener method and store the listeners in a dictionary, but this feels clunky to me. Any ideas? 回答1: Ok, so it seems that

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

How to run an external SWF inside a Flex Application?

匆匆过客 提交于 2019-12-31 10:53:11
问题 EDIT: Due to the answer I change the code posted. I've added the Security.allowDomain("*") line and that line throws me an error. So, how can that be made? I want to run an Action Script 3.0 Application into a Flex Application. To do this I've done the following: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication windowComplete="loadSwfApplication()" xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ private function loadSwfApplication() { // The next line throws me

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

Referencing getter/setter functions in actionscript 3

为君一笑 提交于 2019-12-31 07:23:12
问题 How does one get a reference the the getter and setter functions in actionscript 3? if a method is defined on the calls, e.g. public function blah():String { ...} I can get a reference to it by just saying blah or this.blah How do get a reference to public function get blah2():String {} public function set blah2(b:String):void {} Thanks! 回答1: Original response: Unfortunately, you will not be able to store references to those as functions. The getter and setter methods are actually built