actionscript-3

how do i add project references to swcs in FlashDevelop

I am trying to add a project reference or swc to papervision in FlashDevelop but intellisense isn't picking it up. I've done it before but i forgot how. Thanks. ...

Why are a DisplayObject's child's .name property and the results of getChildByName() sometimes different?

Can anyone explain the difference between the "name" property of a display object and the value found by getChildByName("XXX") function? They're the same 90% of the time, until they aren't, and things fall apart. For example, in the code below, I find an object by instance name only by directly examining the child's name property; getC...

Flash: Coming back from another tab in browser, can flash listen to return to tab event of some sort ?

I got this flash application where you can click a link while watching a video. It will open a new tab and pause the video. Now when you come back to the flash application it would be nice if the video would start playing again. Is there a way, an event or so to do this ? ...

Good Resource Loading System

I'm currently looking for a resource management system for actionscript3. More specifically in this case, I'm looking for opinions on off-the-shelf resource loaders/managers from people who have used them, are they clean/simple to use? are they designed to be extended? I plan on using this with an MVC like system, Mate is next on the...

How to know Flash Player Version from Action Script 3.0

There is a way to know the flash player version installed on the computer that runs our SWF file with Action Script 3.0? ...

What happens when a Flex App can't run at the specified framerate?

In our application (a game), in some cases it can't run fast enough. Obviously we'd like to speed it up, but in the mean-time when this happens it causes many problems (or if it's not causing them, the two are related). The one which is least related to our own functionality is that the built in Alert.show() method stops working. Typical...

Is it a bad idea to implement a timer loop in Flex?

In our game project we did have a timer loop set to fire about 20 times a second (the same as the application framerate). We use this to move some sprites around. I'm wondering if this could cause problems and we should instead do our updates using an EnterFrame event handler? I get the impression that having a timer loop run faster than...

Flex: Loading assets into externally loaded modules...

So, I have Flex project that loads a Module using the ModuleManager - not the module loader. The problem that I'm having is that to load an external asset (like a video or image) the path to load that asset has to be relative to the Module swf...not relative to the swf that loaded the module. The question is - How can I load an asset i...

How do I make a custom Flex component for a gap-fill exercise?

The purpose of this component is to test knowledge of a student on a given subject - in the example below it would be geography. The student is given a piece of text with missing words in it. He/she has to fill in (type in this case) the missing words - hence this kind of test/exercise is called gap-fill.There could be several sentences ...

Converting string to uint in actionscript / Flex

I am creating a component and want to expose a color property as many flex controls do, lets say I have simple component like this, lets call it foo_label: <mx:Canvas> <mx:Script> [Bindable] public var color:uint; </mx:Script> <mx:Label text="foobar" color="{color}" /> </mx:Canvas> and then add the component in ...

What is the best way to implement a singleton pattern class in Actionscript 3?

Since AS3 does not allow private constructors, it seems the only way to construct a singleton and guarantee the constructor isn't explicitly created via "new" is to pass a single parameter and check it. I've heard two recommendations, one is to check the caller and ensure it's the static getInstance(), and the other is to have a private...

Ruby to Actionscript3 Bytecode

Hi I was looking into Ruby to actionscript 3 bytecode compilers and found a mention of a project called Red Sun but can find very little information on it. So my Question is ... what tools are available to convert Ruby source into AS3 bytecode ...

how do I get a handle to a custom component in Flex?

I have a custom login component in Flex that is a simple form that dispatches a custom LoginEvent when a user click the login button: <?xml version="1.0" encoding="utf-8"?> <mx:Form xmlns:mx="http://www.adobe.com/2006/mxml" defaultButton="{btnLogin}"> <mx:Metadata> [Event(name="login",tpye="events.LoginEvent")] </mx:Me...

Flash: Listen to all events of a type with one eventlistener

It's not a matter of life or death but I wonder if this could be possible: I got a couple of events from one type of custom event (FormEvent) now I got a FormListener that listens to all those events and handles them according to the event type. Instead of adding one eventListener at the time I wish to add all events at once. so now it...

Suggestions on using Flex with WCF and Linq to Entities.

So I am working on a project that uses a ASP.NET server and we have entities being passed over WCF from LINQ-to-Entity queries. I have already overcome the cyclic reference issue with WCF. Now that I am looking toward the next step, the Flex UI, I am wondering what things people have already faced either with dealing with WCF from Flex o...

merge custom skin & custom class into SWC

If I have an *.as file that is my custom component, a SWC class that contains the custom components skins and a css file that tells the custom class how it should look (references the SWC skin file), how do I set up a library project (using flexbuilder 3) to generate a single SWC file that will contain everything? ...

ActionScript3 User Interface Components?

After using AS2 for several years, I'm getting started with writing applications in AS3 (Flash9/Flash10). I've come to the point where I need some full sets of GUI components, and I need to decide which set I'm going to use. Back in the AS2 days, the built in components included with flash were pretty crappy - bloated filesize, slow, bug...

Possible to use Flex Framework/Components without using MXML?

Is it possible to use the Flex Framework and Components, without using MXML? I know ActionScript pretty decently, and don't feel like messing around with some new XML language just to get some simple UI in there. Can anyone provide an example consisting of an .as file which can be compiled (ideally via FlashDevelop, though just telling h...

Flex Post Event Screen Updates

I came across this topic today while investigating something very strange. Doing certain things in our Flex app can cause the number of frames rendered to rocket, from 12fps to ~30fps: loaded animations start playing at high speed and the GUI starts to lock up. Since everything I've read on Flex/Flash hammers home the point "the frame r...

Unit testing in flex

Are there any unit testing solutions for Flex? or actionscript 3? If so, what are their features? Any UI testing abilities? Functional testing? Any pointers, examples, libraries or tools that you can share? ...