actionscript

Floodfill in ActionScript 3

Hi guys, I'm trying to write my own floodfill function in ActionScript3, because the one provided by Adobe isn't flexible enough (you can only give one target color, I would like to give a range of target colours.) So, the terrible code I came up with so far is this: private function beginAlgortime(xx:int,yy:int):void { if (bmp.bi...

Flash TextField, dynamic size

I'm building text balloons to display variable length messages in Flash. My question is pretty simple, though the answer may not be. I have: The string I want to display. The font information. The width/height ratio I want the text field to have. How do I calculate the width and height of the text field it needs to display the text ...

Web-based Music and Sound synthesis - Survey

My question is threefold What cool web-based examples have you seen that generate music dynamically by the user? Either based on samples with an interesting interface, by sound synthesis or similar methods. Example: http://acko.net/blog/javascript-audio-synthesis-with-html-5 Has any serious web-based dynamical sound synthesis been done...

Can I add a node to a tree without adding it to the dataProvider?

I've got a couple trees that I allow a user to drag and drop from one to another, works great except one apparent limitation. I'm picking up where they drop it in the list and adding it to the dataProvider manually. The user can drop it everywhere except after the last child of any particular node it seems, since it reads that position a...

Label dataChange event not getting fired

<mx:Label id="myLabel" dataChange="{trace('changed!!');}" /> I change the text in the above label: myLabel.text = "new text"; But nothing is traced as it's supposed to. Am I using a wrong event? I thought dataChange is fired when text in the label is changed. ...

Is my flash game local or on the internet?

I'm currently developing a flash game and I need to be able to test it on my local machine and also on the web. When running locally I use some dummy test data and when online it is joined to an API. While in development I would like to be able to detect where I'm running so I can switch between these automatically. Is there a way to d...

Adobe AIR: How to play local mp3 file ?

Hi, I'm testing Adobe AIR with flex, and I wanted to play a mp3 via an open file dialog, I did that : import flash.filesystem.*; import flash.events.Event; import flash.media.*; import mx.core.SoundAsset; public var loadedFile:File; public var channel:SoundChannel; public var song:SoundAsset; private function loadFile():void { loade...

Actionscript 3D how to rotate around 3d coordinates

I wanted to write a simple 3d image rotating around the y-axis as the Image carousel. I can place all the photo around the axis but I can't get the main image facing towards the screen. I mean the z-axis isn't pointing towards the screen. Instead, the z-axis is towards the top left corner. How do i make the z-axis pointing perpendicula...

Flash lineStyle rounds thickness?

The sprite which contains all element in my game world uses the real-world meter as distance unit, it doesn't know what pixels are. I then apply a scale to this sprite to make it appear correct on screen. Currently I use 1 meter = 100 pixels, so scale = 100. If I try to draw a line inside this sprite it appears lineStyle(thinkness) roun...

Adding a link to a Button in Flash/Actionscript

How do I make a link on a button which is in a Flash movie clip? ...

Papervision 3D: How can I force dimensions on a collada file

Hey everyone, I'm working with Collada files and I need them to be a certain size. When instantiating them in pv3d you set the filename, materials, and scale. Scale works like a percentage, and there's no way to get the width, height, or depth of the DAE once in flash. I want to be able to specify the size of DAE in 3D space relative ...

Why are my component's unscaled width/height zero?

Why are unscaledWidth and unscaledHeight tracing to 0 when the calling component doesn't explicitly set a width and height? (If calling component does set width and height, they are tracing to the set value.) Shouldn't measure() force the minimum width and height? package { import flash.display.Graphics; import mx.core.UIComponent; ...

Problem with caret return character added to string taken from Adobe Flash input text field

I have encountered strange problem. I have created simple Flash text field control and I wanted to compare its content with some other string. This comparison in triggered when user is pressing the button. In Action Script 2.0 code I noticed that a caret return character (\r) was added at the end of the string coming from the input text...

Is there an AS3 Minify? How do I minify actionscript3?

I've found several javascript minify tools however they do something weird with open and close braces, even though ActionScript is based on ECMAScript it doesn't seem to work. Wondering if anyone knows of an actionscript3 minifier that I could use. Anyone? ...

Can I get changeWatcher to fire when XML is appended to?

So I had a requirement to add an undo function to my app and I discovered this nifty ChangeWatcher class, but it's not doing exactly what I want and I'm hoping someone knows how. ChangeWatcher seems to monitor assignments to the variable reference. So when I say: myXML = <xml/> it fires off it's function just fine and dandy, but wh...

Loading special characters in a string loaded via XML in AS3

Hi When I load an XML using ActionScript all the characters inside strings render fine except special characters like: ñ, Ñ, á, é, í, ó, ú In that cases the letter is omitted. I even try with: &ntilde; or &iacute; But in that case show exactly &ntilde; and &iacute; instead of ñ or í. ¿What can I do? Thanks. ...

ADVANCED DATA GRID: Setting properites of individual columns in grid mxml tag

Hi Friends, Is it possible to control the properties of 'advancedgridcolumns' in 'advanceddatagrid' mxml tag. For e.g. suppose the grid data provider has 3 different fields. Out of these 3 fields, one field is 'to_be_decided'. This field should not be displayed initially. Only the remaining 2 columns should be displayed (visible true) a...

Flex: Basic expectations from a flex(actionscript) developer

Hi Friends, Knowledge has no limits but still in your opions, what are the basic requirements for an individual, where he can call himself a flex developer. To make it a bit concrete lets say after having a 2-3 years experience. In my perspective it should be something like below. It is a very (very) rough idea and please let me know yo...

How can I get a datagrid to behave like the ctrl key is active?

I want my data grid to behave by default as if the user is holding the control key down. So when an item is clicked, then another item they are both part of the selection, clicking them again removes them from the selection. I already have allowMultipleSelection = true but I can't seem to find any setting that does this. I'm working on ...

Timeout on xmlsocket (AS2 / Java)

I'm attempting to connect an xmlsocket to a java server using actionscript 2. I can get it to work fine in "Test Movie", but in a browser I'm having problems with the cross domain policy file. The server app receives the request for the policy file and responds to it with the XML content of the file, but when debugging it claims the req...