actionscript-3

How do I reference an object, add a tween to it and put this in an Eventlistener in AS3?

I'm having quite some trouble to try and get an app I wrote in AS2 to AS3. The reason I need to go to AS3 is something icky, so I won't go into detail about it. I've got 90% of the application running with the new code. Now I've come to the point where I have to convert this code from AS2, function setAnimation(theObject,id) { theO...

How do you print all Elements on the Stage with ActionScript 3.0?

I have a flex/as3 project in which I have a bitmap background, and then draw Sprites over top of that background. It creates a map and a route to locations on the map. I am implementing a print function to print that map(the flash screen) and then adding other information to the same page. The map displays with a width of 800px and a hei...

calling a Flash ExternalInterface with JavaScript

I'm trying to call a function declared with ExternalInterface in a Flash swf, using JavaScript. It worked once, but all of a sudden, it stopped working. I have a debug version of the Flash Player, but no errors occur in Flash. Not even a "Security Sandbox Error" or something. The only error I get is the following error in JavaScript Er...

How can I permit tab characters in a textfield in Flash?

I am working on an AS3 Flash game that initially takes a input from a barcode scanner. The data that it scans comes in as one long string using tabs to separate the data segments. The scanner acts as a keyboard and inputs the string into a hidden textfield so that I can grab the string and split it apart to get the data. The input and...

Flash Compiler/Interpreter Optimizations

I started working with ActionScript 3 / Flash 9 fairly recently, coming from a "real" programming background, and I have become a bit curious as to exactly what kind of machine code it ends up with at the end of the day. I would like to know what kind of optimizations the compiler makes when putting together the SWF with the optimize fl...

Adding an as2 swf to the stage in an as3 swf

I have a menu control (as2), that is completely self-contained and doesn't rely on any interaction with the parent (as3). The menu control does load an external xml file that is in the same directory as the swf. The menu control works fine when I run it on its own. But when I import it into the Library of my as3 fla, add it the stage a...

How to parse an ISO formatted date in Flex (AS3)?

How can I parse an ISO date string into a date object in Flex (AS3)? e.g. 2009-12-08T04:23:23Z 2009-12-08T04:23:23.342-04:00 etc... ...

What are the options and best practices for PV3D inspired modeling.

The studio I work at is currently developing the Tony Hawk XI website and I am responsible for the flash/AS3 development. As part of the pitch, I entered an augmented reality skateboard example to be shown which impressed the client very much. After a few weeks of getting stronger with Papervision3D, and getting to know the Flar Toolki...

Release/Debug Configurations with Flash + AS3

I recently ran into an embarrassing situation with some Flash coding where I had to accidentally sent clients a build where not all my debugging flags and variables were unset. (It was sending requests to the debug instead of release server, etc...) Part of this was poor code organization on my part; I've resolved that. However, Flash ...

Where does ASDoc get its intrinsic class definitions from?

I mean that of the built-in ECMA objects: String, Number, Object, Function, RegExp, Error, Boolean, etc.. ...

Alternative AS3 doc gen?

Can anyone recommend an AS3 code documentation generator other than ASDoc? Preferably a lighter, more portable, or standalone app that isn't bolted to such a big framework? ...

How to Draw a circle displaying a number in flex .

Hi , I am flex newbie , so please forgive me if i am not using the right words to ask the following question. I want to know if there is a way to draw a circle which shows a number , like for ex. Graduated Circles representing its radius to show it's relevance. Is there a component which already do so , if not what is the best way to do ...

Problem with BasicView and CameraType.SPRING

Working with the BasicView class in Papervision 2.0, I'm getting an error when compiling: 1119: Access of possibly undefined property SPRING through a reference with static type Class. If I comment out the access of that static property and add the constant value manually, it works as expected: case "Spring": //CameraType.SPRIN...

Actionscript indexOf problem

When I create a TextField in AS3 with multiline set to true and equate the text to say: "Hola \r hola" I am unable to retrieve the index position of \r using indexOf function, it always returns -1 Does anyone know what I'm doing wrong? var txt:TextField; txt.multiline = true; txt.text = "Hola \r hola"; //txt now renders fine with t...

How to determine if an associative array has a key?

In ActionScript 3, is there any convenient way of determining if an associative array (dictionary) has a particular key? I need to perform additional logic if the key is missing. I could catch the undefined property exception, but I'm hoping that can be my last resort. ...

Get IP address using Action Script?

Is it possible to get client IP address through Flash (swf) Action Script 3 and then pass it to php file to store it in database? ...

Is there an way to load external swf into a sandbox in flash?

I'm loading flash ad-banners inside my all flash site with Loader. I have no control over the code inside the banners as they come from advertisers. I'd like to load them so that there is no way they can mess up the mouse events on the site outside their limited area. Sloppy code on advertisers banner should not kill my site's function...

Flex compiler metadata "DefaultProperty"

Hi, Given the following: <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2009/mxml"&gt; <mx:Panel title="blah"> <mx:Button /> </mx:Panel> </mx:Application> Can you tell me where child elements (ex. mx:Button) are assigned in parent elements (ex. mx:Panel) by default by mxmlc. You can set the "Defaul...

Returning an md2's animation channels with Papervision 3D in actionscript 3?

I am currently working on a FlarToolkit / Papervision3D / Quake2 model parsing, that I have successfully loaded, textured, and animated. That being said, the animation calls are merely a guess to me and so far all I know is that "jump" and "run" are available. When i use the built in getAnimationChannels() of the MD2 class, it merely r...

Actionscript sound playback accuracy in Flash 10

.We have an AS3 player that requires Flash 10 (to overcome old issues with 9 and playback offsets) to handle clipping of audio. However when I select start and end points to playback from, many times what is played back doesn't match the same clip as what is played in Audacity. Here are some details on my test mp3 (results from ffmpeg) ...