actionscript-3

ActionScript 3.0 Preloader Issues

First off, I greatly appreciate any help, as always.... I have created a preloader from Jarrod's Advanced AS3 Preloader Tutorail. I searched elsewhere and this seemed like my best option as it was the only one I understood that did not require 2 SWF files. My code is really in 2 classes, my preloader class and my program class. My pro...

Does ActionScript 3 require an error event handler for XML?

In a Flash game I am developing, there are some settings that are set by an external XML file. When I run the SWF file through the Flash IDE, it loads fine. If I run the same file as a projector (.exe) or the independent SWF file, it does not load the XML file. My (unexpected) fix was to assign an error event listener to the loader ob...

Rotate an AS3 Dynamically created object

I'm building a site that requires an audio file to be played with an equalizer. I don't know alot about AS3 yet so this might be a simple question. I've found an example that I would like to use Demonstrated here and the source files here The code to add the equalizer object to the stage (from the tutorial) package { import flash...

Flex/ActionScript3: keyword "with" hides misspelled property names

In Flex 3, var anInstance : MyClass = new MyClass(); with (anInstance) { property1 = "fred"; property2 = 5; propert3 = 7; } does NOT flag "propert" as a non-existent property name. I thought this was a remainder of the evil JavaScript object behavior (referring to a property name of an object implicitly creates it), but i...

Flex AdvancedDataGrid: MXML ItemRenderers are not defaulting to the default style

I know AdvancedDataGrid has a styleFunction callback, but I don't want to change the style; I want the itemRenderer to get the global style that everything else (including normal columns) uses. My in-line item renderers use the default style, but not the ones I created as separate MXML classes (they extend Canvas). Any handle I need to...

How to display an image in flex with Content-Type: image/jpeg ?

I have an .aspx page that generates thumbnails. It takes an ID and returns an image with response Content-Type: image/jpeg. How do I display this image in Flex? ...

Flex Repeaters and EventListeners

At first glance, the Repeater control looks extremely powerful, but now I'm having second thoughts. Problem at hand: Adding Event Listeners to the children Repeater object is bound to and iterates through an ArrayCollection creating new Vbox children for each item. Now for each child, the Repeater object will fire off a "repeat" event,...

What is the best/easiest way to use nested switch/case statements?

What is the better practice of the following two switch/case statements? Is there an easier way (less code) to do this? switch (myValue) { case 1: { methodFor1(); break; } case 2: case 3: { methodFor2or3(); if (myValue == 2) methodFor2(); if (myValue == ...

What is wrong with this SQLite query?

I'm creating an AIR application which connects to a SQLite database. The database balks at this insert statement, and I simply cannot figure out why. There is no error, it simply does not move on. INSERT INTO Attendee (AttendeeId,ShowCode,LastName,FirstName,Company,Address,Address2,City,State,ZipCode,Country,Phone,Fax,Email,BuyNum,Prim...

Logging causing XML Parsing to break?!

I'm seeing something very very strange happening in a Flex app I'm maintaining. I've been going through it removing all calls to trace() and replacing it with calls into the logging framework (using the built in mx.logging stuff). After doing so some XML parsing code suddenly broke, and I can't for the life of me figure out why. here'...

After grouping a flat data collection, what is the structure of a itemRenderer's data ?

So I want to have the tree behavior in a grid, and use item renderers in the top-level (aka summary) rows. Once I've applied grouping, the data object is much changed. Here is the code to add grouping to an ADG: var tripCollection : TripSearchMatchCollection = TripSearchMatchCollection(value); var theGroupingCollection : GroupingColl...

Hand cursor on hover over texfield

I know about the buttonMode property on a MovieClip (to get the hand cursor on hover) and I'm looking to do the same with a TextField, but it doesn't seem to implement this property. Does anyone know if there's anything similar or, failing that, another way to control the cursor for the textfield? Thanks for any ideas :) ...

Check component initilaze before add events in actionscript 3

How can I check component (move clip or button) isInitilazed before add event (release or click) for it in actionscript 3? ...

Can you use Adobe's Alchemy to execute a batch file?

I was going to make an AIR application but I need to execute an external application and because of the security restrictions in Adobe AIR... I was thinking why not try and bypass it by writing some C code that does something like System("file to execute"); and then use Alchemy to change it into a swc and us that in my application... ...

Simulating ByteArrays using ActionScript 2?

Any replacement for the AS3 ByteArray where you can read raw binary data via any medium? Maybe load a TXT file and access the characters byte-by-byte? Any ideas? ...

loosely coupled Flex 3 sibling components

I am creating an application in which I have two mxml components, MainPanel.mxml and TextPanel.mxml, that are contained in a parent application called index.mxml. When I type something the textbox that exists in TextPanel.mxml, I want to be able to bind this data to a label that exists in TextPanel.mxml. I know this can be accomplished b...

Flex: Dynamically create a preview image for a video....

I'm using the VideoDisplay to play flv's, mov's, and mp4's and everything is working great. They are all being loaded via progressive download and are not being streamed. What I'd like to do is to grab a single specified frame (like whatever is being shown at the 10 second mark), convert it to a bitmap and use that bitmap as the previe...

Action Script 3.0 - How to control a dynamically loaded SWF

I have a flash piece that loads external SWF files. I need to be able to move the loaded swf file to the next frame in the main timeline. How can I do that with ActionScript 3.0 Update: Here's the code snippet: var request:URLRequest = new URLRequest(file); loader.load(request); var swfTimeline:MovieClip = loader.content as MovieC...

Is there a workaround for the missing ExternalInterface.objectID in ActionScript 2

I'm downporting some ActionScript 3 to ActionScript 2 (some ad agencies sadly still refuse to embrace the future) and I've run into the issue that in ActionScript 2 ExternalInterface has no objectID property, as it does in ActionScript 3. The code I'm working on calls a lot of JavaScript, and some of that code requires the script to kno...

Upload arbitrary data in HTTP Post in Flex

We currently have a Java applet that generates a lot of data and uploads it to our servers. One of the upload methods we have is to use an HTTP POST to our server, the contents of which are just the raw data (no multipart encoding or anything). I'm looking at implementing a Flex app that does the same thing, but I don't see a way to du...