actionscript-3

Flex: Copy UI elements on click

Hi, I have a panel with several canvases and buttons on it. I want to implement a feature: when I click next button I want the whole Panel and canvases to be copied and placed below the current one. Also I want to make it possible to do this operation several times. How do I dynamically generate UI elements? (and maybe I will need some...

How to externally configure logging in a Flex app?

Hi, I was wondering what people are using for externally configuring logging in a Flex app. Are there any ready baked solutions out there, similar to Log4J's configuration via properties files for instance? If there are, do these work directly with the Flex logging API or are they part of a separate logging library? ...

Tooltip placement setting

My flex app has various Custom components. I want the tooltips for all of them to show at the top-right corner. Is there a Application setting that I can do this with? Or do I have to do this at the component level. Either ways, how will it be done? ...

Action Script Modify Sound Data Real-Time

var sound:Sound = new Sound(); var req:URLRequest = new URLRequest(url); sound.load(url) I want to modify the sound data (an mp3) as it comes in. Specifically, the mp3 will be encrypted using a stream cipher and I want to decrypt the data as it comes in. Is this possible using some type of event? ...

How to make URLLoader return an AsyncToken?

Hi all, I was trying to retrieve binary data over HTTP for my Flex application, and was running into some stumbling blocks. HTTPService did not seem to deal with binary data well, people said to use URLLoader. But URLLoader does not have the nice AsyncToken/IResponder interface that HTTPService provides. So, I did some searching and ...

Programatically Altering Font Face, Size, Weight & Color Of A Flex Label/Text Component

I can change the color of the label in Flex Builder, I can even BIND the color to a variable and that works, but I can't find the Color PROPERTY in order to change or reference it programatically! What is the ActionScript 3.0 code to change the font or color of a piece of text in a Flex RIA - or is caring in what color your text appears...

Drag a point in flash, and have lines, connected other points move

Hi, I have a set of dots displayed on the canvas (key bits of code pulled out): // Drop points based on x y coords for (var i = 0; i < 50; i++) { itemPoint[i] = new mcDot(); itemPoint[i].x = 500*Math.random(); itemPoint[i].y = 500*Math.random(); // Set up drag & drop initDragger(itemPoint[i]); itemPoint[i].butt...

How to draw to a sprite outside of a class

Hi there, I'm wondering (based on scoping rules) how I might do the following: I want to draw to a sprite that exists on the main stage in which I have a class instantiated. So something like public function MyClass(reference:String){ this.reference = reference; } public function drawToOutsideSprite(){ this.parent.getChildByNam...

Make Objects with key names from variables

Hello, I would like to make an Object that has key names taken from a variable. Probably this is not clear enough, so let me make an example. I have two variables var str1:String = 'firstKey'; and str2:String = 'secondKey'; How can I make an object that would look like: var obj:Object = {firstKey: 'some value', secondKey: 'some other...

Flex PNG/JPG decoder

Hi, Now, I run the following code in Flash to get the raw binary data of one PNG file. var fr:FileReference = new FileReference; fr.browse(); fr.load(...); After loading complete, I think I can access the PNG file binary data from fr.data, now, I want to display this PNG picture in my application, could you please tell me, is there a...

FileReference.load() does not as excepted

I used Flash player 10, and Flex SDK 3.4. The code as followings: // Following comes callbacks function imageLoadOpenCallback(evt:Event):void { trace("in--open"); } function imageLoadCompleteCallback(evt:Event):void { trace("in--load"); var fr:FileReference = evt.target as FileReference; trace(fr.data); } function ima...

Alternate Gothic No. 2 not embedding properly

I'm writing a Pure AS3 app, embedding a font using the Embed metatag like so: [Embed(source="assets/fonts.swf", fontName="AlternateGothic No2")] public static const ALTERNATE_GOTHIC_2:Class; This has always worked for me, but Alternate Gothic No. 2 gives me issues. In Flash, the font is labeled as AlternateGothic and the style is No2. ...

Actionscript 3 array scope / multidimentional array questions

I seem to have an array scope issue. I have a global variable; var itemConnect:Array = new Array(); Which is initialized at the start. I then have a function to populate it as a 2-d array: // Draw connections function initConnections() { for (var i:Number = 0; i < anotherArray.length; i++) { for (var j:Number = 0; j < anotherArray...

Flex doesn't build anymore?

I have been working on a project for a long time now and there have been numerous situations in which I cannot seem to build. I try 'clean', then I try building again. Whether I do this manually or 'automatically' via saving it doesn't help anything. This particular time I have no idea what to look for. Can anyone shed some light on wh...

Can ActionScript and Flash handle complex dynamically-loaded modules and architectures?

I'm looking to start learning ActionScript and Flash to write a potentially very complex game engine. I come from a background in relatively advanced software architecture and as such am wondering if a few things (which I consider important for my engine) are possible with Flash: First, I want to modularize my game so that it can be bo...

How do I Get Started Using Flex and Ecplise Without Using Flex Builder?

Hello All, I am a ASP.NET web developer who wants to learn Flex and Actionscript. I want to first learn how to develop web applications using Flex without having to pay for Flex Builder. From what I have researched so far there is a way to get Flex working with Eclipse and I did stumble upon this website: http://systems.tinuum.net/?p=5...

Something to allow "Writing flex without ActionScript", or "Java to AVM2 compiler", or "Write Flex using Java" exists?

There are many dynamic languages that target Sun's JVM (Groovy, Scala, Jython, Jruby etc) and I was sure there are many that target Adobe's AVM as well. But I was surprised to find only haXe do something similiar. related question on this site I think the eclipse e4 SWT project doesn't compile to ABC (ActionScript Byte Code) directly, ...

as3: xml loads but doesn't seem to be coerced to native flash xml

I have a class that loads some xml data via php scripting. I am trying to grab the formatted xml (which i have verified is formatted correctly), and stuff it into a number of variables. I try: package utils.php { import flash.events.Event; import flash.events.EventDispatcher; import flash.net.URLLoader; import flash.net....

as3: usage of this keyword

Hey there, I am just wondering when it's necessary to use the keyword this.somevar instead of just somevar. I usually don't use this under the following circumstances: i have made a var private for a class i refer to it in order to use it as a local var for that class correct? or is this not just a style thing? ...

Is there an actionscript extension for visual studio?

I prefer the VS IDE over flex builder. ...