actionscript

Flex best practices ?

I have the feeling that is easy to find samples, tutorials and simple examples on Flex. It seems harder to find tips and good practices based on real-life projects. Any tips on how to : How to write maintainable actionscript code How to ensure a clean separation of concern. Has anybody used an MVC framework such as cairngorm, puremvc o...

How do I get flash to reload the parent HTML page it is embedded in?

I have a flash app (SWF) running Flash 8 embedded in an HTML page. How do I get flash to reload the parent HTML page it is embedded in? I've tried using ExternalInterface to call a JS function to reload the page but that doesn't seem to work... ...

Grab a ProgressEvent from a POST upload in as3

Is there any way to track the status of a posted upload in AS3? There is a ProgressEvent, but it gives data back about the response, not the actual POST upload. I'm posting binary data for an image, so it's usually in the 50-100kb range. The image data was generated inside Flash itself, so I can't use the upload method - at least as fa...

Flex: Custom Item Renderer For Combobox controls truncates text

I've implemented a custom item renderer that I'm using with a combobox on a flex project I'm working on. It displays and icon and some text for each item. The only problem is that when the text is long the width of the menu is not being adjusted properly and the text is being truncated when displayed. I've tried tweaking all of the obvio...

How to play a sound in Actionscript 3 that is not in the same directory as the SWF?

I have a project with a bunch of external sounds to a SWF. I want to play them, but any time I attempt load a new URL into the sound object it fails with either "Error #2068: Invalid Sound" or raises an ioError with "Error #2032 Stream Error". // Tried with path prefixed with "http://.." "file://.." "//.." and "..") var path:String = ...

How do I access cookies within Flash?

I'm looking to grab cookie values for the same domain within a Flash movie. Is this possible? Let's see I let a user set a variable foo and I store it using any web programming language. I can access it easily via that language, but I would like to access it via the Flash movie without passing it in via printing it within the HTML pag...

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. ...

QTVR-like Panorama in Flash/ActionScript?

It has been a few years since I used Actionscript. Back in the day, I made a project that emulated a QTVR panorama (at the time I was using Flash, you could only embed very basic mov files) by simply moving a very long flattened pano image left or right behind a mask. The effect was okay, but not as nice as a real pano, since the perspec...

Is there a better way to get hold of a reference to a movie clip in actionscript using a string without eval

I have created a bunch of movie clips which all have similar names and then after some other event I have built up a string like: var clipName = "barLeft42" which is held inside another movie clip called 'thing'. I have been able to get hold of a reference using: var movieClip = Eval( "_root.thing." + clipName ) But that feels bad...

How to do Automated UI testing for Flash

I have an actionscript 2 application that I'd like to write automated UI testing for. For example I'd like to simulate a mouse click on a button and validate that a movie-clip is displayed at the right position and in the right color... Basically, UI testing. What are the best tools available or what is the desired approach? In JavaScrip...

Can I use DoxyGen to document ActionScript code?

How do I Configuring DoxyGen to document ActionScript files? I've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there. ...

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 ...

Best Practices for Internationalizing a Flex Appliaction?

I am looking into internationalizing a Flex application I am working on and I am curious if there are any best practices or recommendations for doing so. Googling for such information results in a handful of small articles and blog posts, each about doing it differently, and the advantages and disadvantages are not exactly clear. Edite...

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...

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...

Actionscript 2 functions

I'm an experienced programmer but just starting out with Flash/Actionscript. I'm working on a project that for certain reasons requires me to use Actionscript 2 rather than 3. When I run the following (I just put it in frame one of a new flash project), the output is a 3 rather than a 1 ? I need it to be a 1. Why does the scope of the ...

Do I have a shot at learning Objective-C?

I do mostly ActionScript development, plus a bit of C# (and historically Lingo, Java and VB). What are my chances of learning Objective-C? I'd love to have a go at iPhone development, but the language just looks so insanely different to everything else. ...

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? ...

Training path to become an expert in Adobe Flash and ActionScript

Hi, I would like to become skilled developing applications in Flash. What is more, I would like to grasp a better understanding (doing instead of only reading) of the Flash ecosystem and their real potential to apply that knowledge in my own projects. Which resources (books, tutorials, exercises, etc) do you recommend to learn in dept...

Find top 3 closest targets in Actionscript 3

I have an array of characters that are Points and I want to take any character and be able to loop through that array and find the top 3 closest (using Point.distance) neighbors. Could anyone give me an idea of how to do this? ...