actionscript

Restrict AS3 FileFilter to directories only

I have a flex app that needs to import and export flies. The filefilter needs to restrict to only directories for output. The input can be filefilterlist, making it able to select multiple files. ...

How can I access the implicit event dispatcher of a bindable Flex object?

If I create an object like so: class Foo { [Bindable] public var property: String; } The class Foo has an implicit event dispatcher to handle property change events. How can I access that without making Foo explicitly extend EventDispatcher? ...

What is the best book to learn Action Script 3 and Flex 3?

I am interested in learning ActionScript to work on Flex Applications. I would like to know what books would be recommended for this. I am coming of a C# background ...

How do I allow smoothing in externally loaded images?

In Flash, I can go into the properties of an image in the library and check 'allow smoothing' to enable resampling when the image is scaled or rotated. How can I achieve the same effect for images loaded dynamically by the SWF from an external URL? ...

Get size of ActionScript 3 Dictionary

var d:Dictionary = new Dictionary(); d["a"] = "b"; d["b"] = "z"; How to get the length/size of the dictionary (which is 2) ? ...

AS3 Class Extending Sprite

I am new to ActionScript so excuse me if this is a stupid question. So, I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both...

Need to traverse matrix-like graph in expanding concentric squares...

Ok, I've a data structure that consists of a matrix of linked nodes, lets say 10x10. I would like to be able to choose any of these nodes arbitrarily, and - from there - process a number of the surrounding nodes following the pattern of expanding concentric squares (I used less nodes below for illustration purposes). As far as specifics ...

actionscript switch statement not working in flex

Hey all, I have a students xml from a database. The student_state column can have a value of "passed", among other values (hence the need for switch statement). When the list_changeHandler function is called, depending on the value of student_state, I want a form to display different fields. So I tried to dynamically create the form in ...

Loading Facebook ActionScript library in an HTML Adobe AIR app

I'm writing an Adobe AIR app using plain HTML which needs to upload photos to Facebook. I don't think Facebook's JavaScript/Connect library includes photo uploading functionality, but their ActionScript library does. However, I'm having trouble loading the ActionScript library into the HTML page. Adobe's documentation describes the proc...

[as3] Movieclip.width returns higher value than Movieclip stage on Width.

I have a Movieclip on stage with nested movieclips inside. All referenced at 0,0. None of the child movieclips load any dynamic content, animate or have Masked Layers. It does have an input textfield in one of the child MCs. The parent MC shows 280 px width, while it returns 313 px with a .width trace. There is no code that alters the .w...

ActionScript instanceof for dynamic interface

interface If { ... } class Impl implements If { ... } function test(type:Class, obj) { return obj instanceof type; } test(If, new Impl()); The call to test on the last line returns false, but it should be true. How can I do this check right, with the requirement that it must be inside the function? Real code: public function...

How do I fix this warning in my mx:request tag?

I'm running an HTTPService with the following request: <mx:request xmlns=""> <view>{myViewStack.selectedChild.name}</view> </mx:request> The idea being to pass which child is selected on the viewstack to the php page, and then get that back so I can run some logic based on which child of the viewstack was selected at the time. Ev...

ActionScript 2.0 - Passing numeric data in via Flashvars results in losing zeros

Hey guys, I'm modifying someone's old AS 2 Flash application and I need to pass numeric data in as a string OR have a properly formatted USD currency string in the end. Currently, I might pass something like Data1=$34,000.00&Data2=$12,344.18&etc... in via FlashVars. Assuming I show Data1 in a dynamic input field, I'd get something...

As3 Movieclip loaded in container reports exaggerated .width value

I am trying to load a swf(as3) into another As3 Swf with the Movieclip loader. After loading however Loader.width/loader.content.width returns an exaggerated value than the actual width of the swf being loaded. Any pointers on where to begin looking for the discrepancy? Thanks in advance. More Details (if it helps) The swf being loaded...

AS3: How to dynamically load movieclip from library without exporting in frame 1?

I have some fairly large movieclips in the library which need to be dynamically loaded at runtime. I don't want to export them all in frame 1, because that would slow down initial loading of the movie. I tried putting an instance of each of these clips later in the timeline where they wouldn't normally be encountered. When I then trie...

"Link" against a SWC in Flex

I'm trying to do a very simple app in Flash/Flex, that loads an image embedded in the swf itself and then shows it. The thing is I'm trying to do it using the command line only (mxmlc and compc) and without using @Embed, and failing miserably. I have a very simple Main.as : package { import flash.display.*; import flash.utils.*...

How to make returned from PHP Data fill MXML Flex mx:List (Using actionscript and PHP)

I am Using Flex 3 and apache with PHP 5.2. I am searching for simple as possible way to fill my mx:List with data using POST URLRequest. In Flex builder I am using the next code public var variables_se:URLVariables = new URLVariables(); public var varSend_se:URLRequest = new URLRequest("DataProvider.php"); public var varLoader_se:URLL...

Actionscript 2.0, Having a SendAndLoad() function Issue

I have this code: btn_jouer.onRelease = function () { verif = txt_email_user.text; if (txt_email_user.text == "") { txt_erreur.textColor = 16724736; txt_erreur.text = "Champ(s) manquant(s)"; } else if (verif.indexOf("@", 0) == -1 || verif.indexOf(".", 0) == -1) { txt_erreur.textColor = 167...

How to access children of children recursively?

I have a Canvas which has many components inside it and those again, have many components inside them. getChildren() returns only the top level children. What is the best way to retrieve all the children (children of children of children and so on). Well, I sorta know how to do this by iterating through the children, but the code is ...

Text field methods such as getLineLength returning 0 chars in actionscript

I am creating a TextBox class that extends textArea in actionscript in adobe flex. Let's say I create an instance of this TextBox class called textBox1 and set the text equal to a textArea called textArea1 that contains a sentence: textArea1.text = "Jack and Jill went up the hill"; textBox1 = new TextBox; canvas1.addChild(textBox1); ...