actionscript-3

Can I change the 'Default Application' class of AS3 projects in Flex Builder 3?

When creating an Actionscript Project in Flex builder 3 an application class is automatically created and dropped in the root of your source folder. In my case my source folder is called src/. Is it possible to change the default application class to a class which is not directly in the root of the src folder? It seems when right-clicki...

Actionscript 3: Walk through/read object variables, possible?

For an open source project I am looking for a way to send multiple variables to methods. These variables are, for example, variables I want to directly pass onto an object I'm creating. I figured an object would be a good way to go, as I can send as many variables as I like without having to think about every possible variable beforehan...

Exposing static properties in your Flex class

Hi. I have an actionscript class in my flex app that looks like this: package Assets { public class AppIcons { public function AppIcons() { } [Bindable] [Embed(source="assets/ico_16.png")] public static var Icon_16:Class; [Bindable] [Embed(source="assets/ico_32.png")] public static var...

Edit PDF files dynamically from Flash or Flex

I am planning to do a CD-ROM in either Flash or Flex, possibly using the Adobe AIR runtime. This CD interactive will have a bunch of forms on it for the user to fill out. After they fill in a form, they will have the option of saving or printing a PDF that is based on there information. I am trying to find a way of editing the content ...

Routing Mouse Events through a Sprite in Actionscript 3

In a pure Actionscript 3 project, I have a sprite that overlaps another sprite. The lower sprite normally handles mouse clicks. The lower sprite no longer processes mouse events when it is overlapped by the higher sprite. I understand that this is normal behavior. I would like the lower sprite to handle mouse events when it is over...

Apply Filter to Everything in AS3

I'm trying to add a filter in AS3/Flex SDK. I can add a filter just fine to any one single object - but I want to apply the filter to everything that is a child of a certain object. Think a pause window pops up, and everything below the pause window goes blurry. Applying a filter to each individual object (eg: iterating through a list)...

Speex-encoded SWF?

A project that I'm working on requires being able to dynamically create sound-asset SWF files (using DefineSound tags). Even though I've been able to successfully create DefineSound tags using raw pcm, I haven't been able to do so with Speex. The SWF format spec (pgs 202-204) specifies that you can use Speex in a DefineSound tag, but i...

as3 object serialization (to as3 code)

Hello what i'm trying to do is walk an object that is also a complex tree of objects and output the actionscript 3 code it took (or takes) to create instantiate and populate that object and all its children. so for instance if you saw something like this in your debugger myObjectToParse (ParseMe@173e239) ----------[0]someBlob (SomeBlo...

Receiving the Event.COPY event in Flash

Hello, My goal is to know when a user presses the cut, copy, paste, or select all keyboard shortcuts and do some processing for each one. I tried listening for the keypresses, but only some keys are fired when the control key is down (apparently it would work only in the browser, except for IE). Then I was reading the Flash docs and ca...

How do I programmatically associate a RadioButton with a RadioButtonGroup in ActionScript3?

I have a UI component that, for various reasons, I have to construct programatically. The component is a table of radio buttons grouped by column. Right now, I'm constructing the column groups like so: private function createGroupsForItemList(items: XMLList): void { for each (var item: XML in items) { var rbGroup: RadioBu...

Flex CategoryAxis with non-unique values

I have a BarChart that compares different user interactions with a program we have. Obviously some users will have multiple sessions and depending on what the filtering is, a single user may have multiple entries displayed at once. The problem comes in with the Category Axis, which uses the username as the categoryField. This is fine an...

calling a static method of a class with only an instance

If all I have is an instance of an object, can I call a static method of its class? For fun, let's say I don't know what the name of the class is, only the name of the static method. Can I do this? How do I do this? ...

mxmlc with both linked and not linked rsls?

On the mxmlc command line, I can include paths to RSL files. I can choose to link these RSLs at runtime by setting -static-link-runtime-shared-libraries=false What if I need to link to some rsls and embed (static-link) other rsls? Is there a way to set the link settings for each rsl? ...

dynamic xml reading in flash

Hi all, i want to read an xml file in flash that is returned from a php script. i have it all sorted apart from one thing the attributes that are returned in each row vary (anything from 1 to 100). below is the code to explain what i mean for(var ii:int = 0; ii < tempXML.record.length(); ii++) { for(var b:int = 0; b < numAttributes;...

Flash AS3 Best way to communicate independent classes?

Hello, what would be the simpliest way to communicate between independent classes? I have been searching for two days and couldn't find nothing, isn't there a way that one class has a dispatchEvent and the other an addEventListener, with a custom Event?? I could only find solutions within the same class o with a parentchild relationship,...

Line number constant in Actionscript 3.0?

Is there a line number constant or way to dynamically trace the line number in actionscript? Does actionscript have the equivalent of __LINE__ in PHP? ...

Adding flex components using xml

I have a dozen different custom components in my flex app. I want to use an external xml config file to load the components at run-tine. Can someone tell me whats the best way to architect this? I want to load these components and add dataProviders and event liseners to them at runtime. A brief example will greatly help. ...

Add own watermark to flex chart

Hi community, does someone know how to add a watermark to a charting component in flex? Maybe to a Line Chart or just simple to a canvas. Thanks in advance Sebastian ...

Limiting the values in an array collection

I have an array collection that I would like to limit to say 100 items. I tried setting up a filter function where the return was: return (myAC.getItemIndex(item) > 100); but the value was always -1. For whatever reason it couldn't find the item, even though the item is definitely there. I'm able to do this with a while loop: while...

Flex profiler isn't showing me what I expect... Am I doin' it wrong?

I'm trying to profile the performance of my Flex code, but I'm not getting the results I expect: the wall clock says that my application takes about 30 seconds to load, but when I sort the profiling* results by cumulative time, the numbers don't add up: there is one method, [enterFrameEvent], which has a cumulative time of ~8000ms, then ...