actionscript-3

flash cs4 , dynamic text field

Usually i am pretty good at working my way round as3 but this one is really giving me a headache I have this code below and everything works fine i can trace the output but still the text is not showing up on stage any clues?? import flash.display.Sprite; import flash.text.TextField; import flash.display.MovieClip; var xmlLoader:URLLoa...

Flex/AS3 : Automatically instanciate package classes in an array (plugin classes)

Hi, This is my first time here, but I already found some good answers here, so I'd like to thank. I'm developping a small Flex application and I want to instanciate every class from a package into an array, so I can parse it afterwards. To clarify, I'm trying to ease a plugin management system for my application, with the old canProces...

Mapping a 2D object to 3D space, maintining 2D size

I have a papervision3d sphere primitive that I am adding to a scene. The sphere is being sized with a radius of 285. However, because of my camera properties (zoom, focus and z) the sphere is rendering at 206px instead of 570px which is what I want (2 * radius). A while back I found a blog post concerning this very issue and it was ...

dynamically generate ComboBox name

I have a script that parses some complex XML. When the XML element is of a certain type, it generates a comboBox using the XML element's children to populate the box. I then want to check all of the values of the all the generated ComboBoxes against their correct answers (which is also info stored in the XML file). When creating the Comb...

How to detect when video is buffering?

Hi guys, my question today deals with Flash AS3 video buffering. (Streaming or Progressive) I want to be able to detect when the video is being buffered, so I can display some sort of animation letting the user know to wait just a little longer. Currently my video will start up, hold on frame 1 for 3-4 secs then play. Kinda giving the...

psuedo threaded json parsing?

Adobe's JSON serialization library is very helpful, but it can lock up the UI if parsing a large string. I am wondering if it makes sense to parse JSON in a psuedo-thread (aka "chunking"). I am wondering if anyone has implemented, has suggestions for implementing, or arguments against this approach. ...

Convertion bitmapData

I'm trying to load several jpeg images dynamically XML into bitmapdata object in fla. I can see them on the stage of this .swf file. However, I load it into another .swf which is my main to call while clicking on one of menu option. I got this error: Error #1034: Type Coercion failed: cannot convert com::Fashion@1daf4ca1 to flash.displ...

AS3: Game development

Hi! I am looking a game framework for flex/AS3. I want to use it to create simple 2d games, such as tower defense, etc. Maybe someone can suggest something? ...

Internal Drag and Drop in Tree Control

I have written a custom Itemrenderer for my Tree control, i.e., MyTreeItemRenderer. However, once i am providing this custom renderer for my tree control do I have to handle the drag and drop functionalily separately myself as i am getting an error, null object reference while dragging and dropping within the tree control. ...

Image manipulation in ActionScript 3.0 : realistically editing faces

I am a flash developer who has worked mostly on small ActionScript projects, in particular websites, but I am dipping my toes into image manipulation with AS3. I have a project I'm working on to develop an application which would allow a user to upload their own picture into a swf, and then, using a slider, they can alter the image to ma...

Copy XML array from one XML Object to another xml Object.

Hi all , how to copy one xml object values from one xml object to another empty xml object. I have one xml object from the xml array and need to copy that to another xml object. How can i copy xml from one object to another if am parsing the XML object with for loop and i get the nodes var myXML:xml = new xml(); for(...) if(xmlObj.pro...

Tree Drag and Drop Functionality

label1 | |_*label2 |label3 |___label4 |___label5 I want a tree in this structure, having line between the nodes, also, instead of Open and Close Folders, I have added my own graphic there with label. I did by extending TreeItemRenderer Class. Now, I if iam dragging and dropping a child node ex:label5, and try i drop it above label1 ...

Simplify AS3 binding/event-dispatching code

There are 3 properties (example 1): [Bindable] public var name:String; [Bindable] public var email:Number; [Bindable] public var address:Boolean; I needed to have 3 helper methods that will be bindable too (example 2): [Bindable] public var name:String; [Bindable] public var email:Number; [Bindable] public var address:Boolean; publi...

Flash Actionscript

Hi all, It is my first time to code an actionscript for flash. I want to write a flash clip which works as a parent of another flash clip. I want to write a function in the parent flash, and call that function in the child flash clip. For example I wanna create an actionscript which sends game score to "submitscore.php". The parent is ju...

Actionscript: Sorting ArrayCollection by date: YYYY-MM-DD

I have an ArrayCollection of Objects. Each Object has the following keys/values: {date: 2009-12-01, visits=13555, bouceRate=45} {date: 2009-12-05, visits=46955, bouceRate=45} {date: 2009-12-06, visits=13685, bouceRate=45} {date: 2009-12-02, visits=13685, bouceRate=45} {date: 2009-12-04, visits=68755, bouceRate=45} {date: 2009-12-03, vis...

Illegal cyclic loop between nodes?

I am trying to loop through an XML file. As for the first loop everything works fine, but when the program enters the second loop it gives an error saying that TypeError: Error #1118: Illegal cyclical loop between nodes. at XML/http://adobe.com/AS3/2006/builtin::appendChild() Can anyone help me regarding this issue and suggest how to ...

Advantages of ActionScript3 over actionscript2

Anyone can explain the Advantages of As3 overAs2. ...

Story of a mysterious bug Flex/ Actionscript

Suddenly Flex seems to dislike variable declaration. For example I write (on the script part of a mxml component) <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; var i:int = 1; while(i< 9) i++; [Bindable] public var evolution:ArrayCollection = new ArrayCollection(); ]]> ...

URLStream & OSX laggy

I'm using URLStream to download 30-80mb files over HTTP. It downloads fine on Windows XP, but is extremely laggy in OSX. Anyone had similar issues? Here's some snippets of the code. function startDownload():void { //opening file var FileWriteStream:FileStream = new FileStream(); FileWriteStream.openAsync(DownloadingFile, ...

Creating a "true" HashMap implementation with Object Equality in ActionScript 3

I've been spending some of my spare time working a set of collections for ActionScript 3 but I've hit a pretty serious roadblock thanks for the way ActionScript 3 handles equality checks inside Dictionary Objects. When you compare a key in a dictionary, ActionScript uses the === operator to perform the comparison, this has a bit of a na...