actionscript-3

Flex 3 XML fed TileList passing selected item to another component

I have a TileList populated by an xml on creation complete and I would like the image from the selected item to be passed to the source of an image component. This is the main application: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" backgroundColor="#FFFFFF"> <mx:...

should I close() a sound, or stop() the channel? (AS3)

Hi there, I am trying to get a flash application to stop downloading any MP3 when the user leaves the page. So far, I have been using the stop(); command on the channel, however, you can see in the browser activity that the MP3 is still downloading. On the positive, the sound has stopped. Any ideas? I have tried the close(); command b...

ExternalInterface.call() not getting return value

I have a Javascript function that returns the innerHTML of a div. I am attempting to call this function from Actionscript and store the return value. I know that the Javascript function is being called because there is an alert that displays the return data, The data that is returned to Actionscript, however, is null. I am not sure w...

using alchemy generated swc in Flash CS4

I've gone over the Alchemy quick start guide and exported my stringecho.swc successfully, but I don't want to compile in Flex. I just don't know Flex and I'm not very keen on learning it all of a sudden. I tried to do my business in Flash, instead, considering that they both run on AS3. The Flex code they give as an example is package ...

How can I prompt a user to open or save a PDF file returned by a .aspx file?

I have a Flex application that calls a .aspx page on our webserver, which builds a PDF or Excel File. Right now, I am using navigateToURL() to call the file, and this works fine when the output file is built successfully. However, if there is an error, or timeout, there is no way of knowing this in the Flash movie. I am trying to use U...

how to change javascript function to ActionScript 3?

anybody can help me to change that javascript function to AS3? thanks :) function parseURLtoVars(strLocation){ var rArray = new Array(); var key; var urlString = new String(strLocation); if (urlString.search(/\?/)>-1){ var qArray = urlString.split('?')[1].split('&'); if (qArray.length > 0){ for (key in qArray){...

as3/javascript if statement> commas instead of &&

This runs in as3, and javascript. Why? I know how && and || work, but a list? is this as3 specific? Is this in other languages? I'm a mouth breathing PHP/AS2 programmer. Or did everyone already know this and I'm a tool for not reading documentation properly? AS3 if (true, true, true) { trace("true?") }//result - "true?" traced...

try-catch not working?

I'm using a try-catch block in the following Actionscript 3 code: try { this._subtitle = new SubtitleController(subtitlePath, _framerate); this._subtitle.addEventListener(Event.COMPLETE, subtitleLoaded); } catch (e:Error) { trace('subtitle not found'); } The SubtitleController constructor then tries to load the subtitlePat...

flex 3 inline text wrapping

Hi all, I am trying to implement a functionality like: http://henrytseng.blogspot.com/2009/03/as3-intelligent-text-wrapping-or.html or http://dispatchevent.org/roger/dynamic-text-wrapping-in-actionscript-3/ But the difference is instead of text field i have textarea & instead of display object i have images. Thanks in advance. ...

Error on deserialization of Array Collection in Flex: RangeError: Error #2006

I am getting this error during serialization: RangeError: Error #2006: The supplied index is out of bounds. The error occurs in AbstractMessage.as when it attempts to read input of timestamp. After that my fault handler gets this error: faultCode:Server.Acknowledge.Failed faultString:'Didn't receive an acknowledge messa...

Flex 3 ColorPicker changes movieclip in SWFLoader

How would I use a ColorPicker in Flex 3 to change the color of a movieclip which was dynamically loaded from an array into a SWFLoader? ...

Best practice for ActionScript 2 events - is there a way to simulate ActionScript 3-style events?

I love the AS3 event model - it helps keep my code clean and lossely coupled. When I used to work on AS2 projects, my code was not so neat and classes were more reliant on one another. Due to AS2's strange handling of scope I never really got on with the AS2 event system. As I still occasionally have to work in AS2, my question is: Ha...

how do I delete/gc an object in Actionscript 3?

I want to delete/force garbage collection on a class instance from inside itself. Obviously, this = null and delete this don't work. Is it any way I can do that, or am I barking up the wrong tree? I'm basically looking for a destructor of some sort.. I have a class instance that attempts to load an XML file, and if the file is not found...

how to capture mouseclick in actionscript 3.0

How do I capture the position of a mouseclick from the user in my Flash window using Actionscript 3.0? ...

can an actionscript function find out its own name?

given the following function A(b:Function) { } If function A(), can we determine the name of the function being passed in as parameter 'b' ? Does the answer differ for AS2 and AS3 ? ...

Adding many images to HBox causes display problems in Flex

In Flex, I'm using an HBox to hold thumbnails. When more thumbnails are added than can be shown, the HBox becomes scrollable. When I add more than, say, 80 images, when I scroll back to the first image, the images begin "tearing", until I hover my mouse over them. This is how it looks when few images are added: When many images are ...

arsort with Actionscript 3

How would one sort an indexed array and maintain the index association in Actionscript 3.0. The Array.sort(); method seems to reindex the array no matter what. Basically I need to recreate the arsort php function in Actionscript. Possible? ...

How can make column widths bindable in two Flex AdvancedDataGrids?

Bear with me here. I have a strange setup to accomplish what I need. I basically have an AdvancedDataGrid that displays data returned by a WebService. The data is in XML format: <children label="parent 1" value="3100"> <children label="child 1" value="1100"> <children label="grandchild 1" value="200"> </children> ...

Read TIFF file in AIR?

Is there any way to read a TIFF file under AIR? Looks like Flash doesn't have native support for TIFF format, any libraries out there? ...

Refresh SWC in FlexBuilder after publishing

I am using a SWC that was published from Flash CS3 in an Actionscript project in FlexBuider. The problem is that every time I make a change and re-publish the SWC the changes I made are not immediately recognized back in FlexBuilder. In order to have newly published SWC recognized I have to remove the reference to the SWC from the libra...