actionscript-3

Need help converting a script from Java to AS3. Any help appreciated.

I'm currently working on a Flash typing game, where you have to re-type some text from one text box to another, then the game detects all the various types of errors you made (inverted characters, inverted words, added, missing or wrong characters and lower/uppercase errors) and displays the text back to you with the errors highlighted w...

Insane Graphics.lineStyle behavior

Hi all, I'd like some help with a little project of mine. Background: i have a little hierarchy of Sprite derived classes (5 levels starting from the one, that is the root application class in Flex Builder). Width and Height properties are overriden so that my class always remembers it's requested size (not just bounding size around con...

How to insert complex strings into Actionscript?

How to insert complex strings into Actionscript? So I have a string -vvv -I rc w:// v dv s="60x40" --ut="#scode{vcode=FV1,acode=p3,ab=128,ch=2,rate=4400}:dup{dt=st{ac=http{mime=v/x-flv},mux=mpeg{v},dt=:80/sm.fv}}" How to insert it into code like public var SuperPuperComplexString:String = new String(); SuperPuperComplexString = ...

How to save a string into file in applicationdirectory and get its real location? (Adobe Air)

How to save a string into file (file.superlongextention) in applicationdirectory and get its real locationon Hard drive (like C:/files/...)? ...

where should damage logic go Game Engine or Character Class

I am making a game and I am trying to decide what is the best practice for exchanging damage between two objects on the screen. Should the damage be passed directly between the two objects or should it be pass through a central game engine that decides the damage and different criteria's such as hit or miss or amount dealt. So overall w...

Find the point with radius and angle

Hi, I'm not a genius in geometry, I'd like to find a point in as3 with the radius and a angle but I don't remember the rule, I know this should be simple! Here's an example: ...

Drawing an honeycomb with as3

Hi, I'm trying to create an honeycomb with as3 but I have some problem on cells positioning. I've already created the cells (not with code) and for cycled them to a funcion and send to it the parameters which what I thought was need (the honeycomb cell is allready on a sprite container in the center of the stage). to see the structure ...

What's the PHP equivalent of ASP.NET ashx handlers ?

I need to return a JSON encoded response to a flash http get request. In ASP.NET, I do this with a ASHX handler. What's the PHP equivalent ? I mean in order that I only get JSON back, and not the <html> etc. ...

Actionscript blur/shadows/glows how heavy are they on the processor?

Hi, I have say 10 items in a particular space, If I apply glows and drop shadows to all of them and all of these items are usually static. Other characters do move around them too. So I'm just wondering would it be wise to use vectors with actionscript blurs and glows. Or to have a PNG? and if I cannot have a PNG and have to work with v...

ActionScript Binding Array Objects?

i would like to update the numbers i've added to an array from variables, when those variables change. is it possible change these variables and have the array update automatically? var first:Number = 1; var second:Number = 2; var myArray:Array = new Array(first, second); first = 3; second = 4; trace(myArray) //outputs 1,2 ...

Strange error when compiling an AIR 2.0 SWF

I am doing a project at the moment using the AIR 2.0 RC SDK. As far as I know, I created a new class for my project, and added a constructor to the main class file. At least it wasn't too serious: creating a new class for a project is quite commin I guess. But after I did so, I suddenly got the following output when compiling the movie: ...

Styling buttons of Flex TabNavigator

I created a TabNavigator with a bunch of NavigatorContent inside it, and want to skin just the buttons of the tabs themselves. So I added a skinClass, but looks like in the documentation, there's no skin part to target the button specifically. Do I have to style the mx:TabNavigator itself to accomplish this?...

ActionScript Drawing Gradient Line With Transparency

i'm attempting to draw a simple gradient line with some transparency, but the portion of the line that receives 0 for the alpha draws black. var lineMatrix:Matrix = new Matrix(); lineMatrix.createGradientBox(500, 1); var line:Sprite = new Sprite(); line.graphics.lineStyle(1, 0, 0, false, LineScaleMode.NONE, CapsStyle.NONE); line.graphi...

ActionScript Comparing Arrays

how can i evaluate whether my test array is equal to my static constant DEFAULT_ARRAY? shouldn't my output be returning true? public class myClass extends Sprite { private static const DEFAULT_ARRAY:Array = new Array(1, 2, 3); public function myClass() { var test:Array = new Array(1, 2, 3); trace (test == DEFAULT_ARRAY); } //traces f...

Keeping the number of objects and event-listeners on stage as low as possible

Hello. I am creating a site with lots of big scrollable text-boxes in it. Each text-box object contained some text, and two buttons to scroll up/down with. The scroll buttons each had an event listener so the text moved when you clicked them. These text-boxes were stacked on-top of each other with all except one having an alpha of 0. I...

How to create an object from 2 arrays?

So I hava array Links and array Params with same langth N So what I need is to create an object where for each link from Links I will be able to see param from Params And than for example to be abble to call something like for each( item in object) if (item.param == "some value") { // some code } else... How to do such thing (C...

How to properly use .SWC packages in Flash CS 4

Hi! I've googled a lot trying to find how to properly import and use .swc files in Flash CS 4, tried lots of different methods but none seem to work. What I've done is: 1. Placed it in my "D:\Program Files (x86)\Adobe\Adobe Flash CS4\en\Configuration\Components" folder. It does however not show up in the component inspector. 2. Added i...

Override existing AS3 classes

For a custom derived class "Vector2" from flash.geom.Point, when trying to override the clone() method (similar to add(), subtract() methods that will return the type itself), it will always complain about incompatible overriding 'cuz the return type has been altered from "Point" to "Vector2". import flash.geom.Point; public class Vect...

Sorting an array of objects in ActionScript 3

Hi, I'm trying to sort an array of objects with ActionScript 3. The array is like this: var arr:Array = new Array (); arr.push ({name:"John", date:"20080324", message:"Hi"}); arr.push ({name:"Susan", date:"20090528", message:"hello"}); can I do something with Array.sort(...) method? ...

how to play FLV stream from any part of it? (in Flash using AS3 and MXML )

Ao my server sends me FLV stream. the problem is it does not send me FLV header. So I get from my server something like raw FLV stream from some point. I know that it contains video 640x480 sound and Video. Its like you take .FLV file somehow delete its part and try to play it. How to play such stream from Flash? (I use Flash builder...