actionscript-3

wav <> mp3 for flash(as3)

Dear All, I'm wondering about MP3 decoding/encoding, and I was hoping to pull this off in Flash using AS3 I'm sure it'll be a right pain... I have no idea where to start, can anyone offer any pointers? reference material? ----much later--- Thank you all very much for your input... It seems I have a long road ahead of me yet! ...

Triangle Trigonometry (ActionScript 3)

I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians. I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypotenuse and therefore the variable angle of var z? A solution in either AS3...

trouble with scrolling a UIScrollBar component within a class

I'm trying to attach an instance of UIScrollbar component to a dynamic text field inside of an instance of a class that is being made after some XML is loaded. The scroll bar component is getting properly attached, as the size of the slider varies depending on the amount of content in the text field, however, it won't scroll. Here's the...

How can I tab accross a ButtonBar component in Flex?

I have a button bar inf flex along with several other input controls, I have set the tabIndex property for each control and all goes well until I tab to the ButtonBar. The ButtonBar has 3 buttons but tabbing to it, only the first button gets focus, tab again and the focus goes back to the top control... How can I make tabbing go throu...

Accessing .NET Web Service securely from Flex 3

We can successfully consume a .NET 2.0 web service from a Flex/AS3 application. Aside from SSL, how else can we make the security more robust (i.e., authentication)? ...

Google Maps in Flex Component

I'm embedding the Google Maps Flash API in Flex and it runs fine locally with the watermark on it, etc. When I upload it to the server (flex.mydomain.com) I get a sandbox security error listed below: SecurityError: Error #2121: Security sandbox violation: Loader.content: http://mydomain.com/main.swf?Fri, 12 Sep 2008 21:46:03 UTC can...

Referencing back to the parent from a child object

My question is pertaining to the best practice for accessing a child object's parent. So let's say a class instantiates another class, that class instance is now referenced with an object. From that child object, what is the best way to reference back to the parent object? Currently I know of a couple ways that I use often, but I'm not s...

Using Actionscript 3 to connect to a database

I'm looking for advice on how to dynamically create content in flash based on a database. Initially I was thinking that we would export the database to an XML file and use the built in Actionscript XML parser to take care of that, however the size of the XML file may prove prohibitive. I have read about using an intermediary step (PH...

AS3 FTP Programming and the Socket and ByteArray Classes

Sorry for the subject line sounding like an even nerdier Harry Potter title. I'm trying to use AS3's Socket class to write a simple FTP program to export as an AIR app in Flex Builder 3. I'm using an FTP server on my local network to test the program. I can successfully connect to the server (the easy part) but I can't send any comman...

Is there a way to build a Flash 9 SWF from an FLA file without using the Flash IDE?

Two reasons this would be useful, in case there's some other way to achieve these goals: 1) Building in the Flash IDE is really slow; I was hoping a third-party compiler would be faster. 2) It would be nice to be able to build projects on machines that don't have the Flash IDE installed. I'm familiar with other AS3 compilers that are out...

Flex: How to add a tab close button for TabNavigator component

I'd like to have a TabNavigator component that has a close button for some of the tabs. How do I do that? It seems that the TabNavigator component does not allow (or I could not find) extensibility of this form. Help. Thanks ...

Getting multiple file sizes for a preloader

Alright, currently I have my SWF hitting a php file that will go and find all the files I specify to it, add their sizes together and return their combined sizes as one number. I then use this number with a ProgressEvent listener to determine the current percentage of files downloading for that particular section of the website. Pretty ...

Is there a guide I can follow to convert my procedural actionscript 3 to OOP?

I'm wanting to change my movie clips to actionscript classes in AS3. Is there a standard list of things I need to do to make sure the classes work? ...

What Causes Flash Error #2012 (Can't instantiate class)?

I am new to ActionScript 3 and have run into a problem: Using Flex Builder 3, I have a created a project with a few simple classes. If code in class A instantiates an object of class B (class B is in its own source file) then the code compiles fine, but I get the following run time error: ArgumentError: Error #2012: B class cannot be i...

Actionscript 3 - Completely removing a child

I have an array of objects that when another object hits one of them, the object will be removed. I have removed it from the stage using removeChild() and removed from the array using splice(), but somehow the object is still calling some of its functions which is causing errors. How do I completely get rid of an object? There are no eve...

What is the best way to stop people hacking the PHP-based highscore table of a Flash game.

I'm talking about an action game with no upper score limit and no way to verify the score on the server by replaying moves etc. What I really need is the strongest encryption possible in Flash/PHP, and a way to prevent people calling the PHP page other than through my Flash file. I have tried some simple methods in the past of making m...

what is the flex (ActionScript3) syntax for a function valued function's type?

What is the syntax to declare a type for my compare-function generator in code like the following? var colName:String = ""; // actually assigned in a loop gc.sortCompareFunction = function() : ??WHAT_GOES_HERE?? { var tmp:String = colName; return function(a:Object,b:Object):int { return compareGeneral(a,b,tmp); }; }(); ...

.NET and AMF

How can I get a ASP.NET (inc MVC) application talking to a Flex UI over AMF. I am wanting to push approx 100+ records around at a time and AMF would appear to be the way forward, but there doesn't appear to be anything obvious. ...

Best way to get the color where a mouse was clicked in AS3

I have an image (mx) and i want to get the uint of the pixel that was clicked. Any ideas? ...

How to handle errors loading with the Flex Sound class

I am seeing strange behaviour with the flash.media.Sound class in Flex 3. var sound:Sound = new Sound(); try{ sound.load(new URLRequest("directory/file.mp3")) } catch(e:IOError){ ... } However this isn't helping. I'm getting a stream error, and it actually sees to be in the Sound constructor. Error #2044: Unhandled IOErrorEvent:....