actionscript-3

Adobe Flex App page file usage going through the roof!

I have been working on an Adobe Flex application for some months now, and the application is meant to run 24/7 for days (weeks!) continuously. However, I'm now seeing that after a few days of running nonstop the computer it runs on tells me that the system is low on virtual memory and gives me an error about Page File usage. Once I clo...

AS3: How to convert ascii code to character actionscript

Hi! I want to create a board class from canvas, which will allow to track click position on it in coordinates like A2, where A...D is Y coordinate in some scale and 1...3 is X coordinate For example see image http://img.skitch.com/20091001-k6ybfehid6y8irad36tbsiif15.jpg What I want to create is a kind of convertor from canvas localX ...

Running the Flash Player over long time period

Hi I'm looking into the issues to expect if the Flash Player (version 10) is run over a long period of time, say 24+ hours. I know that the player has issues with not performing garbage collection properly, and that the weak listener system is buggy. I plan on having the flash app started/monitored using a watchdog/sentinal app written...

Find the total bytes used by a bitmap in Flex.

If I load a bitmap using a loader in Flex, I can use the loaderInfo.bytesTotal to get the size, total bytes used, of a bitmap. If I create a bitmap in run time, how can I find out the size, the total bytes used, by that bitmap. Please advice. Thanks ...

How can I programmatically show the toolTip on a TextInput when a validator returns "invalid"?

I have a form with a TextInput that has a custom Validator. I call the Validator logic and handle the result programmatically. This all works fine, except for one problem. The TextInput gets highlighted when it is invalid, but the toolTip that contains the errorMsg does not display until I roll the mouse cursor over the TextInput. Is the...

Is there a test to see if an Object is an associative Array?

Is there a test to see if an Object is an associative array? Thanks. ...

Emacs Actionscript 3 indentation for functions defined inline in an arglist

I'm using the actionscript-mode-connors.el for indenting Actionscript 3 code in emacs. I have most things figured out, but one thing bothering me is when I use an inline closure as a function argument, the indentation of the interior of the function is screwed up. For example: var foo:int = some_function( bar, baz, function():vo...

How to halt execution in ActionScript

Is there any way to halt execution in ActionScript, such as a sleep() method? I know that there is a setTimeout() method, but setTimeout() just sets up an event for deferred execution. ...

Iam creating a poker game in Flash AS3, what are the best design patterns I can use?

Iam creating a Flash AS3 based Poker game for my company. Some like zynga poker, what are the best design patterns that I can use in my game. All suggestions are welcome, I am looking to create a good designed game which can support huge number of players. ...

How to check if NetStream is playing

Hi everyone I'm working on a flash video player, using Open Video Player. I need to know if the OVPNetStream (which subclasses NetStream) is playing, but i can't find a property or a status eventfor that.. And I don't want to go through the hassle of having the 'play' 'pause' 'stop' buttons to update a boolean var (because other that th...

Flash + Chrome = keyboard blocking?

In one of my flash projects i meet an strange bug. Flash Player in Google Chrome blocking some system keyboard shortcuts. For example such as Alt+Shift & Ctrl+Shift it`s an standart language layout switch bindings. For my project it`s a very big problem, because I need multilingual user input. Someone can help me with this problem? ...

Flex: passing parameters to custom components

Hi I am trying to create a component which can receive an additional value from mxml code: public class Board extends Canvas { public var boardSize:Number; private var cellWidth:Number; public function Board() { super(); } } How can I pass boardSize value from the mxml code. e.g. <MyComp:Board x="22" y="25" width="600" heigh...

How to use Vector in Flex?

I am trying to use the new Vector class introduced in Flash 10. Tried compiling the code using mxmlc but am getting this error message: Error: Type was not found or was not a compile-time constant: Vector. public var selectedRoutes:Vector.<Route>; ^ What could be the problem? What is the general consensus abou...

How to create an object form a string in actionscript 3.0 (as3)

How can I create a dynamic object from a string? Here is my current code with incorrect results: var s1:String = '{x:200, y:400}'; var o1:Object = Object(s1); trace(o1); // result = {x:200, y:400} trace(o1.x) // result = ReferenceError: Error #1069: Property x not found on String and there is no default value. trace(o1.y) // result = ...

implicit conversion of Object to XML in flex 3

when I send an object through an HTTPService to an XML api run by a Rest ruby on rails server.. how does it get converted to XML? I mean, it just works fine for strings and numbers, but for example Date type conversion causes an "unprocessable entity" error on rails log.. Any Idea? ...

What's the fastest way to get the Constructor of an Object in AS3?

Which of these 3 is the fastest (least CPU cycles) on the AVM2 in ActionScript 3? Object(instance).constructor (instance as Object).constructor instance["constructor"] I would do some tests, but I have no idea how to accurately profile that kind of thing. ...

How to use else if { var in AS3 without returning 1083 error?

I have an if/else if/else if/else if/else statment in AS3. It's a calendar that reads in dates from an xml file. The if/else if/else statements controls the look of a date according to whether it has an event, and whether it's past/present or future. The MouseEvent is a tooltip which shows the Event information. The last section is e...

AS3 - Updating Vars

Hello, I have a var to get thumbnails width, and it's set at the beggining of my class code. var thumbW:Number; Then I update that var inside a function that updades with stage resize. function x(){ var thumbW:thumbnails.width; //tracing thumbW here returns the updated value. Perfect! } Then I try to get the thumbW valu...

How Do I Reference a Dynamically Instantiated Object in AS3? (Added a Moviclip to the Stage)

This is something that has been bugging me since I took up AS3 a year ago. Example. I make a class that extends a Movie Clip and call it "LoaderBar" all it is is some text that says "Loading" and below it another movie clip that is a plain rectangle that I call "lBar" When I call a function to load my image I add the Loader to the st...

Best Practices for Suspending Buttons in Actionscript 3

Ok, so my first question here was so well answered I figure I'd try my luck at this little query. Is there a better way to set up a flash project with lots of navigation than having to do this?: bottomNav.contact_btn.addEventListener(MouseEvent.CLICK, changeContent); bottomNav.portfolio_btn.addEventListener(MouseEvent.CLICK, changeCont...