actionscript-3

Flash Develop - Publishing

Hi, I am using Flash Develop, and I have created an ActionScript 3.0 project. It starts and read an xml file, which contain urls to images. I have left the urls relative to the same folder as the swf. OK, so I publish and I have a compiled SWF and this is inside the bin folder. If I then copy this folder, e.g. to by publish folder, ...

Flex app embedding and communicating with older Flash 8 app

I currently maintain an application that's written in Flash 8 (AS2) which is used to embed and control some auto-generated SWFs. The auto-generated SWFs are also Flash 8 (actually, they work at least in 7, possibly even older), so my current app is able to directly reference variables and functions within the embedded SWF. We're now wo...

'glasspane' for as3 to intercept events to everything on stage?

Is there something like the java 'glasspane' in as3? The glass pane is useful when you want to be able to catch events or paint over an area that already contains one or more components. For example, you can deactivate mouse events for a multi-component region by having the glass pane intercept the events. Or you can display an image ov...

Flex Date() constructor is mis-converting Unix time stamps argh

This is seriously killing me. I'm trying to convert a Unix timestamp (1236268800, which equates to Thu, 05 Mar 2009 16:00:00 GMT) to a Date object in Flex. var timestamp:Number = 1236268800; trace(new Date(timestamp)); Output: Wed Jan 14 23:24:28 GMT-0800 1970 Also tried this: var timestamp:Number = 1236268800; var date:Date = new D...

FMS:Flash action script 3.0: How to get the bitrate of a mp3 file being streamed from FMS.

Hi, I need to get the bit rate of a mp3 file which is being streamed as a netstream object in flash action scripting. I am using Flash Media Server 3.2. I need the bitrate to calculate the duration of the mp3 file using the formula: Duration = file size in bytes / bitrate ...

Action Script 3

I am new to AS3. When learning AS3, I get the below code from adobe example and try to run it giving a error like "1037: Packages cannot be nested." What is this mean? Please tell me how to execute? or any problem in this code? package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFi...

Loading ISO8851 text file to TextField()

How can I load .txt ( ISO8859-1 ) text file to TextField() from flex? file is located in same folder with .SWF file ...

TextField() does not show the begin of content when has a lot of text

How Can I force TextField to show a specific part of text on it, when its having multiple lines? Now it seems to show just last line always without user interaction ...

Rectangle doesn't get drawn on root object on refresh in IE

I have an swf file which behaves strangely on IE. The thing is that a certain rectangle doesn't get drawn when viewing the page after the first load. It only appears in IE and a quick fix is to make the path to the swf unique on every request so it doesn't get cached. The rest of my objects gets drawn every time. The code is very simple...

AS3 string util to convert to x-www-form-urlencoded ?

Is there a library for converting strings in as3 into the application/x-www-form-urlencoded format? Specifically, I am looking for the same functionality as the java URLEncoder http://java.sun.com/javase/6/docs/api/java/net/URLEncoder.html Unfortunately, as3's escape and encodeURIComponent functions don't do it. For example, lots of %...

Static Actionscript code analysis?

I want to see class, function and variable/property, dependencies visually, like NDepend, but for ActionScript 2 or AS3 code. Any programs or ideas? Use Doxygen in some way? FlexUnit? ...

Papervision Render to Bitmap

Does anyone know of a way to render a 3D scene to a bitmap using the Papervision renderer? I would like to take a freeze-frame of my scene that I can display while I change the scene in the background. ...

Flex: Tree component: keeping state when data provider updates

How would I go about keeping the state of a tree control? I'd like to keep the state of the tree when it's data provider gets updated, instead of it collapsing. ...

Duplicate MovieClip in AIR/AS3

Has anyone noticed how creating new instances of a MovieClip (and likely other objects as well) in AIR causes some strange effects? If you use Senocular's method by grabbing the object constructor and creating a new instance of the MovieClip, you end up with a new MovieClip with 0 frames. I don't want to draw bitmapData's of every frame ...

ActionScript 3: How to get host name from URL?

Hi, I am trying to set a path to an XML file, which differs when run locally or on server. How do I determine if the Flash is running locally? (I am thinking to check if the URL contains "http://localhost" but how do you get the window URL?) Thanks in advance ...

ActionScript 3: How to expand DynamicText automatically?

Hi, How do you make a DynamicText spans into 2 lines when the text (dynamically-assigned) is too long. I want to keep the width, but the height should adjust automatically. Thank you in advance. ...

Mysql Real Escape String and normal string

"I am using flash as3, php and mysql" What is the difference between: $username = $_POST['username']; $password = md5( $_POST['password']); and $username = mysql_real_escape_string( $_POST['username']); $password = mysql_real_escape_string(md5( $_POST['password'])); I am sending and retrieving variables from flash AS3 to ...

Disable rows in Flex DataGrid

Unless I'm missing something obvious here, there is no way of disbabling one or more rows in a DataGrid. I would expect a disabledRows or disabledRowIndidices property on the DataGrid or List component but that doesn't seem to exist. I found a "rendererArray" property which is scoped to mx_internal and contains all itemrenderers of all ...

TextField() sometimes stays BOLDING even when HTML style was reset with setTextFormat()

any ideas why TextField() sometimes keeps BOLDING ( even when format was reset with setTextFormat() like this: myFormat.bold=false; defaultTextFormat =myFormat; defaultTextFormat.bold = false; setTextFormat(myFormat); htmlText("this is bold even when should not") PS: Textfield is editable and problem occurs when its edited by user ...

escaping characters in as3 as javascript does

I am having trouble escaping special characters in as3. trace( escape("who are ü?") ); returns who%20are%20%uFFFD%3F or trace( encodeURIComponent("who are ü?") ); returns who%20are%20%EF%BF%BD%3F while in javascript this alert( encodeURIComponent("who are ü?") ); returns who%20are%20%C3%BC%3F and alert( escape("who are ü?")...