Cleanly merge two arrays in ActionScript (3.0)?
What's a nice way to merge two sorted arrays in ActionScript (specifically ActionScript 3.0)? The resulting array should be sorted and without duplicates. ...
What's a nice way to merge two sorted arrays in ActionScript (specifically ActionScript 3.0)? The resulting array should be sorted and without duplicates. ...
I've got a long regex in AS3 / Flex which finds one of a couple dozen words. The Regex looks like: word|wordup|wordly|wordster when I do "wordup wordster!".match(regex) I'm getting undefined maches! the match array that's returned has matches: [0] 'wordup' [1] undefined array length: 2 Is there a known bug in AS3's grouping ma...
Any idea how to return multiple variables from a function in ActionScript 3? Anything like VB.NET where you can have the input argument's variable modified (ByRef arguments)? Sub do (ByRef inout As Integer) inout *= 5; End Sub Dim num As Integer = 10 Debug.WriteLine (num) '10 do (num) Debug.WriteLine (num) '50 Anyt...
How do I get AS3 and/or Flex/AIR applications to communicate with CORBA apps? ...
How do you get/set the absolute position of a MovieClip in Flash/AS3? And by absolute, I mean its position relative to the stage's origo. I currently have this setter: class MyMovieClip extends MovieClip { function set xAbs(var x:Number):void { this.x = -(this.parent.localToGlobal(new Point()).x) + x; } } This seems to wor...
The Flex 3 docs are fairly basic. Can someone post a more complete example that uses the control's events? I'm still trying to get my head around ActionScript events. ...
I have a Flash app made up of AS3 components that I am trying to run in Flex. In Flash, after the main component is added to the stage, the loader object (loaderInfo.loader) is null which is fine and I handle that. In Flex, on the applicationComplete event I add the the main component to the stage and the loader object's getter throws...
Any idea how I express 'implements' in UML? I'm trying to write some actionscript classes in starUML with the help of this handy little template tool: http://blog.flashmech.net/2008/09/generate-actionscript-3-with-staruml/ I want the tool to generate 'implements Iblah' in the classes but am not sure what connector to use, Aggregation? D...
Hi flexers, I have a list control where i want to show a string (thats fine) but a colored square as well. Imagine i have a "add player" button a text input with a color picker. I want to see the color + player name in the List. How could i do this ? [Bindable] public var data:ArrayCollection = new ArrayCollection(); <mx:List id="...
I've worked on several flash projects so far. I know my way around AS3 but I also started becoming curious about how other flash programs are written, so I decompiled a few swf files to see how they were made. (I have also read through open source projects, but I don't say that because I feel guilty about decompiling swf files or anythin...
I want to build a LineChart component where the color of the line is indicative on how high the value is. I should be able to do this buy just using a gradient stroke (see below) but for some reason the gradient only goes from left to right and the "angle" property is being ignored. How could i do this? <mx:PlotChart id="bpChart" wi...
Hi, I was wondering i can call an as3 function defined in script from mxml code just like this: <mx:Line x="translateX(xmin);" .. > <mx:Script> <![CDATA[ // do some basic math private function translate ... If not possible do i have to convert everything to as3 ? Thanks ...
So I'm trying to take a bilinear interpolation algorithm for resizing images and add in alpha values as well. I'm using Actionscript 3 to do this, but I don't really think the language is relevant. The code I have below actually works really well, but edges around "erased" regions seem to get darker. Is there an easy way for it to not i...
Could someone simply explain the 3 phases in the Flash Event framework, please? By event phases, I mean: CAPTURING_PHASE AT_TARGET BUBBLING_PHASE To be clear, I'm talking about flash.events.Event and subclasses. An in-depth example would be fantastic. What happens when you click on a nested MovieClip? ...
Hi, I am doing some float manipulation and end up with the following numbers: -0.5 -0.4 -0.3000000000000000004 -0.2000000000000000004 -0.1000000000000000003 1.10E-16 0.1 0.2 0.30000000000000000004 0.4 0.5 The algorithm is the following: var inc:Number = nextMultiple(min, stepSize); trace(String(inc)); private function nextMultiple(...
I'm building a shell application that will load other swf's inside of it based on which chapter and which section the user is in. The shell is written in actionscript 3 and it's loading various AS3, AS2 and AS1 swfs inside of it. I'm using LocalConnection after the AS2 and AS1 swf's have been loaded to set the correct variable for flash ...
Is there anyway in a flex application to figure out (in runtime) when the running swf was compiled? I'd like to compare this with the latest file version of the swf on the server and detect if there's a newer version on the server and if so force the user to reload their browser to get the new version. I need this to also work with sw...
What's the best way to implement a classic curry function in actionscript with a nice syntax? I've tried: Function.prototype.curry = function() { return "helloWorld"; } trace((function():void {}).curry()); ...approach but that didn't work. I guess I'm stuck with a ugly approach such as: FunctionUtils.curry(fp, ... args) ??? ...
Do you write createSomething() or addSomething()? Do you write readSomething(), getSomething() or fetchSomething()? This is totally a petty gripe. In the meeting room we refer to it as CRUD, but in actual code, it's becoming AGUD. What's your naming convention of preference? Does it matter? thnx. ...
I am having no problem converting a string to a byteArray of UTF-16 encoded characters, but the application I am trying to communicate with (written in Erlang) only understands Latin-1 encoding. Is there any way of producing a byteArray full of Latin-1 character codes from a string within Actionscript 3? ...