actionscript-3

Flex Combobox strange problem

I am facing a strange problem with the combobox in Flex. In the following code : public function rollCombo(cmb:ComboBox,value:String):void { if(value=='') return; var i:int=0; cmb.selectedIndex = 0; var dp1:XMLListCollection = (XMLListCollection(cmb.dataProvider); trace(value); while(dp1[i]!=valu...

Flash CS4 AS3 horizontal movieclip scrolling with mouse move

I'm new to AS3 and have been working on an XML driven navigation system written in AS3. At present, I've imported the contents of an XML file and plotted it inside a containing MovieClip created at root level dynamically on the stage. This MovieClip is called 'container'. What I want to accomplish is a smooth, accelerating / decelerati...

ActionScript: When are event handlers executed?

When, in ActionScript, an event is dispatched: foo.addEventListener("some event", someHandler); foo.dispatchEvent(new Event("some event")); At what point are the event handlers executed? I ask because I caught this at the end of an Adobe developer guide: Notice that some properties are assigned to the [AsyncToken] after the call ...

Styling a DataGridRow based on dynamic cell content?

Hi, I have a DataGrid that is populated by an xml response of a web service. Currently, I poll every 5 seconds against the web service to maintain data freshness, as such is essential. Now, this polling can can change the data in one of the columns of the DataGrid, and I would like to style the rows with colors based on the content of a ...

'chain' a series of functions together in actionscript 3

Hi All, I'm calling a function and adding a listener for when the function returns some data. when the data is returned i need to call another function and so on. Is there an easy way to 'chain' these functions together so that the first one fires - waits for the listener then fires the second one creating a listener for that and so on...

ActionScript event handler execution order

I have been trying to understand the way ActionScript's events are implemented, but I'm stuck. I know that AS is single threaded, which means that only one event handler will be executing at a time, and also means that handlers will be executed in a deterministic order*. For example, consider the following code: 1: var x = {executed: ...

Actionscript [Error #2036: Load Never Completed] with dynamic generated images

I'm working with an image caching system that generates different images based on a url route. The source images live outside the document root and cached versions are added to /cache in the webroot. Long story short, in Flash, if I point a Loader to the route, I get a "Load Never Completed" error the first time (if the cached image has ...

Flex return back the result after the event complete

I have two functions in a actionscript class, they are: private function loaderCompleteHandler(event:Event):void { _loader = Loader(event.target.loader); selectedBitmap = Bitmap(_loader.content); } public function byteArrayToBitmap( byteArray:ByteArray ):void { _loader.contentLoaderInfo.addEventListener( Event.COMPLETE,...

Change column width in Flex Grid

I'm using a mx.containers.Grid to layout some data, and the last column is a set of checkboxes. MXML Code snippet: <mx:Grid width="95%" height="50%"> <mx:GridRow id="row1"> <mx:GridItem> <mx:Label id="label1" ... /> </mx:GridItem> <mx:GridItem> <mx:Label id="textValue1" ... /> </mx:GridItem> <mx:GridIte...

Is it possible to secure swf files?

If we create an online SWF application, is there any way to secure it so that someone else doesn't download it and put it on their site? For instance, Webkinz is made with Flash, yet nobody is pirating it on their servers with the whole game unlocked. What is Webkinz doing that we can do? Thanks! ...

Flex 3 Dynamic RemoteObject Class

I have a class which I want to use throughout my projects. It essentially would allow me to easily work with a RemoteObject so that I don't have to define it throughout all of my projects. It works when not passing "args" to sendRequest(..). But when I want to call the cfc function with parameters and try passing "args" in I get the foll...

Why is my AS3 SimpleButton not showing?

I'm very new to flash. I'm trying to show a simple button for my simple flash app (with adobe flex builder 3). The main project file, Client2.as: package { import flash.display.Sprite; [SWF(width="600", height="600", frameRate="31", backgroundColor="#00FFFF")] //set project properties public class Client2 extends Sprite ...

Am I writing AS3 the right way?

I'm very new to flash and actionscript 3. I've been reading a lot about it and this is also my first aprouch on object oriented programming. So far, I created an application with a login button, that's all. However, I would like to know what kind of things I am doing wrong or should be doing different (or better). I am using Adobe Flex ...

datagrid multiple components in one column

Hi I wanted to ask if there is a possibility to have both strings and radiobuttons in one column depending on the value of another column perhaps |column1 | column 2 | |r | radiobutton| |s | string | If there is an r in column 1 in column2 should appear a radiobutton, otherwise column 2 just shows a string. Thanks ...

Get the type in flex

Hello community, can someone tell me how I can identify the type of an object in flex? In particular I have an array where I store multiple types in (but all UIComponents) now as I evaluate the array I want to find out whether I have a TextInput Control or a RadioButton. Does someone have an idea? Thanks in advance ...

Loader Object doesn't dispatch Event.COMPLETE

I am using this class to load multiple images synchronously. Somehow the loader doesn't trigger any event (Event.COMPLETE, ProgressEvent.PROGRESS), strangely I also don't get any errors (using FlashDevelop and Flex3 SDK). package { import flash.display.Loader; import flash.display.Sprite; import flash.events.*; import ...

Flash/Flex error 1067: can't make a custom TextFormat object?

Because I want to avoid repetive code, and I'm using a lot of text formats, I created a CustomTextFormat class in Flex Builder. Another class, called CustomInputBox.as is using this object to create a format: package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; public cla...

flex textflow dyniamic height

Hi, In my flex application I have scenerio like this: parent to child Vbox->Canvas->Sprite->Textflow In this scenerio now I need to have dynamic height of the textflow & its parents. Here the root parent is the itemrenderer of the datagrid I have. I need the heights of rows to be adjust according the content in it. Right now I am imp...

as3 I'm lost, how can I move different text objects?

Dear StackOverflow, I recently started fiddling around with as3, which look pretty good, problem is I come from as2 and I'm completely lost. I'm tring to import text from 4 text files then move them on on top of the other: text1 x = 100, text2 x=150 text3 x=200 etc.. Here is where I'm stuck: import flash.display.MovieClip; import f...

Is it possible to change the point which as3 considers when setting the x,y position of a textField?

I have one textfield and I set it's position to for example x=5, y=5. So I have it like this: 1-2-3-4-5-6-7-8-9-x 2 3 4 5 6 TEXT 7 8 9 x Is it possible to set the textField in a way that the x y value are applied to the bottom corner of the textField like this 1-2-3-4-5-6-7-8-9-x 2 3 4 TEXT 5 6 7 8 9 x...