actionscript-3

Getting static data for Flash app with JSON or XML - caching or not?

Hey, I've flash app and i've static data (like ~18.0KB) for it which aren't changed often so I was wondering how to better get them. The static data may be in XML or JSON. One of my ideas was to put the static data in .js file within a function which would return them in JSON list and the other one was to return them in XML (as I like to...

What is the regular expression (used in actionscript) to find the first newline (\n) in a text?

What is the regular expression to find the first newline (\n) in a text (used to find and delete the newline)? I'm using the regular expression in ActionScript and tried ta.text = ta.text.replace(/\n*/,'') but it doesn't seem to work Thanks ...

Rotate a sprite using ActionScript3

I want to rotate a sprite in 3d using AS3. The example below, tells how to do rotate an image using MXML and AS3, however, I want to do it through pure AS3: Example thanks ...

create a simple live drawing board/whiteboard application using flash as3, and flash media server 3.5.

How do I create a simple live drawing board/whiteboard functionality using flash as3, and flash media server 3.5. ...

How to rename an attribute in XML ?

i have XMl like <record id="1" name="CustomerInfo"> <field name="id" index="1" type="String"/> </record> i want to rename "name" attribute to "match" like <record id="1" match="CustomerInfo"> <field match="id" index="1" type="String"/> </record> ...

How do you load a folder full of png files to construct an AS3 movie clip?

I see plenty of AS3 examples of loading 1 image file into a 1 frame movieclip, but how can you take a folder full of images, load them and treat each image as an individual frame of a single movieclip? The essential problem I seem to keep running into is how to create a keyframe during runtime... ...

help converting this as3 code to pixel bender code

Hi, I'm looking for some help converting as3 code to pixelbender code in an attempt to improve the performance of my application. This as3 code goes as follows. I scan through the Number values of a bytearray in chunks. Lets say this chunk lenght was 100 numbers I read 2 numbers (left and right) and try find the maximum values. The numb...

What are the things need to taken care while working with flash playeres?

Hi all, I have been working since a long time on a particular flash(Action Script 3.0) project and did all the test and development under the Flash itself(tested by Ctrl+Enter) . But It should be compatible with the browser, so i exported all these to my localhost, and its working fine. But unexpectedly I got many more errors from swf ...

Background Image in Flex

Hi, I'm using Flash Builder 4 to create an application. I need to set an background image for the app. I've pulled through the data from XML. I am using an <mx:Image> for the background-image. But I need elements to then be added inside it. How do I achieve this? I considered using Layers, but dont know how you achieve this. Any help ...

How to handle Unhandled #2044 errors from Flash tilelist when changing dataprovider?

Hi all - I have a tilelist component using a custom ImageCell based item renderer. I know that at times some of the images it is trying to retrieve will not be found and I am able to handle this via an IEOrror listener on the custom ImageCell loader. However, if I set the data provider, then it is changed before all images have comple...

How should an element get references to elements further down the tree without hardcoding in Flex?

I have a custom Flex Container component written in AS3, called StatisticsContainer. When used in the application, it contains various custom Label components called StatisticsBoxes. So there might be a StatisticsContainer containing 3 StatisticsBoxes: "averageAge", "divorceRate" and "infantMortalityRate". The StatisticsContainer needs ...

Focus Out event for TLFTextField

Hi Everyone, I'm having an issue where I don't get a "FOCUS_OUT" event called when I click around the stage. I do get the "FOCUS_IN" event when I click the TLFTextField. Not sure what the problem may be, any hints or ideas would be great. I did already do some Google searches, but didnt quite find anything useful. Here is some of the c...

indexing depth animation, AS3

Hi, I have three balls. What do I do? They should look like they are being juggled when animated, but I'm not indexing them correctly. Please help. Thanks Edit Maybe I should just use an array. getChildAt sort of works, but it's not looping though perfectly. It moves one or two balls, not one by one... //JUGGLING ANIMATION WITH 3 BALL...

Flex/AS3 Setting default value for empty form

Currently I have a form in a window like this: <mx:Form> <mx:FormItem label="Reference"> <mx:TextInput id="reference" width="100%"/> </mx:FormItem> <mx:FormItem label="Command"> <mx:TextInput id="command" width="100%"/> </mx:FormItem> <mx:FormItem label="Command Field"> <mx:TextInput id="commandField" wid...

sequencial movieclip name in AS3

I'm pretty unexperienced with Action Script but searched the forums extensively to try and find a solution to this simple problem. I'm creating several copies of a MovieClip but I need them to have different names. // this array gets several cities var cities:Array = new Array( { nome:"london", pos_x:20, pos_y:10 }, { nome:"nyc", pos_x...

Key Value Pairs in AS3

I have a back-end PHP script sending info to an as3 app. What I have it sending is Json info, what I did to make it a key value pair was stick a key and an equals sign in front of it, and send it off. It works on smaller values, but for some reason, it's not working with this, heres the code, I hope you guys can help. Thanks :) c3po=[{"...

Mixing different audio files and exporting to mp3 in ActionScript 3

Hi all, i was wondering if it is possible to mix different audio files and export them into an mp3 file for the end user to download to his computer. Actually, I know it can be done because they do it in various sites (http://aviary.com/tools/Myna , looplabs , audiotool , remixgalaxy the last 3 ones are dot coms, but I can't post them b...

Interview Questions for ActionScript 3 / Flex Programmer

What could be good question to decide if candidate has strong or atleast fair knowledge working with Flex and ActionScript. ...

multiroom video chat

So I am learning to develop a video chat with multirooms/groups and I know basically what to do for a simple live video chat application. For example: public function setupconnection () { youRtmp ="the URL for your rtmp"; nc=new NetConnection(); nc.connect (rtmpNow); nc.addEventListener (NetStatusEvent.NET_STATUS,Con...

Flex 4 - 9scalling is not working at runtime (although working in Flash)

Hi I created a 9-scalled background in Flash CS5 which is working fine in Flash CS5 But when i imported it as embeded graphic in Flex, and change dimensions in runtime, 9-scalling doesnt work. Here is my code. <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librar...