apache-flex

Flex Menu Control - Click a button and a menu is displayed. How can I click that button a second time and hide that menu?

大兔子大兔子 提交于 2019-12-24 07:04:55
问题 Basically, I have a button and on click it displays a menu. I want to click that menu a second time and the menu closes. Currently, every time you click the button, the menu reopens. I pasted the Flex livedoc example below. If you click the button, the menu keeps reopening. Now, I rigged it up by setting a var to open and closed, so when clicking the button it does a check. However, if you click away from the screen, the HIDE event gets dispatched, and the menu closes. This messed up the open

SWFLoader starts to play SWF without the loading being complete

一笑奈何 提交于 2019-12-24 06:45:04
问题 I need to play SWF files in my project. These SWF files have background music in them. The which Sound Sync Options of this music in Flash is set to "stream". This is done so that if you pause the Flash movie, the music will pause as well. Now I have a problem when I am loading these SWF files. For this I am using an SWFLoader. When I load it, the audio of the SWF starts playing already, but no visuals of the movie are shown for a certain time. The slower your connection is, the longer it

Change style of tabs in Flex 3

为君一笑 提交于 2019-12-24 06:42:32
问题 I am new to Flex 3.4. I want to change style of few tabs (highlight them) on click of a button. I came from a javascript background and not able interpret in Flex's way. 回答1: Styling tabs in Flex is sort of tricky - the TabBar and TabNavigator classes have a style called tabStyleName , which is the name of another separate style that defines the look of your tabs. Here's an example which changes a set of tabs from a red background to blue by changing the tabStyleName style on the TabBar -

Flex3: Custom Item Renderer does not listen to events dispatched by parent

偶尔善良 提交于 2019-12-24 06:21:05
问题 I have a List with a custom ItemRenderer. The ItemRenderer contains a Checkbox and a Label. The component with the List has a 'select all' checkbox. When the 'select all' checkbox is checked, it dispatches an event that each item should listen to in order to select its own checkbox. The eventlistener is added on creationComplete of each item, and the event is dispatched correctly when the 'select all' checkbox is selected, but the listener in the custom ItemRenderer does not listen. How do I

Problem with handling keyboard events inside a Canvas using Flex

匆匆过客 提交于 2019-12-24 06:04:29
问题 For some reason, the event listener I define never seems to receive any events, although I believe it should. Here's a very short description of the MXML code I'm using: WindowedApplication VBox (root box) MenuBar TabNavigator VBox (first tab) Canvas VBox (second tab) If I add a listener for KEY_DOWN events to WindowedApplication or the root VBox, the handler receives the events just fine. But if I add the listener to the Canvas or the first tab VBox, the handler never seems to receive any.

Flash Builder AIR Project Background Image

三世轮回 提交于 2019-12-24 05:45:25
问题 I'm very new to Flash Builder and am trying to create an AIR app with a custom background. How can I put a background image in my project? I've tried just placing the image in the design view but it never shows up when I run the project. 回答1: Fixed it myself, by adding @Embed(source='/path/to/file.jpg') instead of what the browse function put: /path/to/file.jpg I got the idea from seeing how the icon on a button (which showed up) was written. Edit: After some more tinkering, it seems that

Flex 3 equivalent of '<fx:Declarations>'?

你。 提交于 2019-12-24 05:38:15
问题 I'm trying to migrate a Flex 4 project backwards to Flex 3, and I need to move stuff mapped in a <fx:Declarations> block in MXML. Does Flex 3 have something similar to this? It's been a while since I've done Flex 3. 回答1: There is no equivalent in Flex 3. You can declare things alongside your other components. The difference in Flex 4 makes the separation between visual and non-visual items (including things like effects, validators, formatters, data declarations, and RPC classes) clearer. For

Flex: DataGrid column formatting of numbers

老子叫甜甜 提交于 2019-12-24 05:26:09
问题 I'm trying to format some numbers in a column of a DataGrid. I'm getting an error in my simplified test program below when I run it. All the examples I've seen so far have column data that are strings. Is there a way to do it using numbers? How to modify the code below to format the checking values? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Script> <

How do I call a Flex SWF from a remote domain using Flash (AS3)?

非 Y 不嫁゛ 提交于 2019-12-24 04:36:07
问题 I have a Flex swf hosted at http://www.a.com/a.swf. I have a flash code on another doamin that tries loading the SWF: _loader = new Loader(); var req:URLRequest = new URLRequest("http://services.nuconomy.com/n.swf"); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoaderFinish); _loader.load(req); On the onLoaderFinish event I try to load classes from the remote SWF and create them: _loader.contentLoaderInfo.applicationDomain.getDefinition("someClassName") as Class When this code

Spark DropDownList Custom ItemRenderer Issue

浪尽此生 提交于 2019-12-24 04:08:32
问题 I have a Spark DropDownList that has a custom ItemRenderer. The ItemRenderer, upon creation, checks the label text and if it matches certain criteria, then the label text color changes. The label text color is changing, however it is for the wrong label. What appears to be happening is that the label color that is actually being changed is in reverse order of how the labels are displayed in the drop down list. For example, the list contains the text labels: One, Two, Three, Four, and is being