Apache Flex

Apache Flex is a highly productive, open source application framework for building and maintaining expressive web applications that deploy consistently on all major browsers, desktops and devices (including smartphones, tablets and television). It provides a modern, standards-based language and programming model that supports common design patterns suitable for developers from many backgrounds. Flex applications can be deployed to the Adobe Player in the browser, Adobe AIR on desktop and mobile devices or to native Android, iOS, Windows or Mac applications.

Share tech news, updates, or what's on your mind.

Sign up to Post

i need to work with a flex application based on sdk 3.2 using Flash Builder 4. The compatibility mode compiler setting does not work, i assume because it does not actually use the 3.2 libraries.

i need to know if Flashbuilder 4 can work with specific older flex sdk-s such as 3.2, and if yes, what are the detailed procedures to set it up correctly.

Any help would be much appreciated!
Hi all,
I'm using the following code the search for a specific date in the xml and it works fine
but what I need is something more tricky.

Image.source = pics.pic.(date == datechooser1.text).imageurl;

I've added 2 DateField's.
DateField1 is the from date and DateField2 is the to date.
So now I have 2 dates.
I have a node in the xml called date and looks link this: <date>10/05/2010</dates>
I need to modify the code or some sample code of how to do this please?

Hi all,
I have a flex project that reads an xml file.
I'm currently using loadXML(); where it will load the whole xml...?
Is there a way where I can specify a search where I could get it to load a specified number of nodes or result?

I am sure i asked this before and couldnt find it the answer. I will check again.

to pass a variable in a custom event I need to create a custom class and override a clone function?

i want the event picked up by parent class
 dispatchEvent(new Event("introClicked")); //from

 dispatchEvent(new Event("introClicked",a)); //to
Hello all,

I made one project in which i am handling custom events.it successfully works in flex builder 3.0 version.
But when I write same code (with custom events) in flash bulider ver 4.0 it will not give any output and also no errors.

Do you guys have any why it is behaving like that.

Dear Experts,
                     I workig Flex4 and i coding in Actionscript3. my problem is how will find child controls of the datagrid in Flex4, especialy dynamic child controls?
Hi all,

I'm loading some online images and it works fine but when i use the slider to scroll the images it jumps from one to the other.
How could I avoid that please. Either preloading or any other way.
Here is the current code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="loadXML()">
      <mx:Image source="{pics.pic[Math.floor(picSlider.value)].imageurl}"/>
      <mx:Label text="{pics.pic[Math.floor(picSlider.value)].title}"/>
            private var pics:XML;
            private function loadXML():void{
                  var loader:URLLoader = new URLLoader();
                  var request:URLRequest = new URLRequest("http://mydomain.com/flash/pics.xml");
                  loader.addEventListener(Event.COMPLETE, onComplete);
            private function onComplete(event:Event):void {
                  pics = new XML(event.target.data);
      <mx:HSlider id="picSlider" minimum="0" maximum="3.9" value="1"/>

And the xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>



Hi all,
I'm looking for a simple sample in flex with the following.

1. An image component
2. A HSlider
3. An xml with the following info:
<imageurl> and <title>

That's all.

I just need to be able to move the HSlider and it will show the different images.

Can anyone help please? I've been googling for days and found nothing yet.

Hope someone can help.

I cant load an image from a class.
I have main.as which calls  Classplayer.as  Classplayer calls ClassMisiile.
I cant load an image from ClassMissile .

I can load the image in Classplayer and dont know why the image in ClassMissile doesnt appear and it is spelt right and in the correct directory.
I dont get an error and the functions work but no image.
  myplayer=new ClassPlayer(480);
		   myplayer.addEventListener ("variableReached",variable_Handler);
           addChild( myplayer);

package  {
	    import flash.display.*;
		import flash.display.Bitmap;
		import flash.display.Loader;
		import flash.display.Sprite;
		import flash.events.Event;
		import flash.net.URLRequest;
		import flash.text.*;
		import flash.events.MouseEvent;
		import flash.events.KeyboardEvent;
		import flash.ui.Keyboard;
		import flash.text.TextField;
  		import flash.text.TextFieldType;
		//import flash.
		import Globalvars;
	public class ClassPlayer  extends Sprite{

		private var imgStr:String;
		private var myx:int;
		private var myy:int;
		private var img2:String;
		private var myx2:int;
		private var myy2:int;
		private  var sp:Sprite=new Sprite();
		private   var sp2:Sprite=new Sprite();
		private   var img1:Bitmap;
		private   var bmp:BitmapData;

Open in new window

Tie this code to a virtual piano keyboard which is a mx:button.

I tried to press the button repetitive as fast as I can, it will throw an error exception and cause the AIR application to hang.

I found that it would not throw an error if I stop the sound channel when it completely fade out. However, I wish the function could fade out and stop the sound individually, not stop o1_1 together. How do I do that?

private var s1_1:Sound = new Sound();
private var o1_1:SoundChannel = new SoundChannel();

private static const a1_1:String = "1.mp3";

//button press would execute p1_1
private function p1_1():void{
s1_1 = new Sound();
s1_1.load(new URLRequest(a1_1));

//Button not press would execute fade1_1
private function fade1_1():void{
TweenMax.to(o1_1, .35, {volume:0, onComplete:stop1_1});

private function stop1_1():void {
//if I add, this code would only stop the sound altogether rather than individual. I wish to have each of the instance to fade our and stop itself should the user press and release.

Open in new window

My error exception in Flex builder 3 using SDK 3.5 and AIR 2.0:
[SWF] snd.swf - 1,022,361 bytes after decompression
TypeError: Error #1009: Cannot access a property or method of a null object reference.
     at snd/st1_1()[...snd.mxml:44]
     at snd/___snd_Button1_mouseUp()[...snd.mxml:67]
I am looking for some code sample (prefer in flex or AS3)...anywhere I have been given a set of images in a url and I need some code that has a slider and reads the url images in a and when you use the slider it shows the different images.
Hope I'm explaining myself properly, if not please let me know.

The url (data) I get looks like this:

"url": "http://www.myhost.com/dev/image1.jpg", "label": "15th June 2010 @ 00:00-03:00 UTC"
"url": "http://www.myhost.com/dev/image2.jpg", "label": "15th June 2010 @ 00:00-03:30 UTC"

So, the code would read the different images and when I move the slider i would see the different ones.

hope someone can help.


I'm using Flex, but I think this question applies to anyone who is well-versed in Actionscript, which means you could be using Flash or Flex.

Let's say ContainerA has a child which is also a container, which we'll call ContainerB. Now ContainerB has a child which is not a container, which we'll call Child. So ContainerA contains ContainerB, which in turn contains Child.

If I get Child's x,y coordinates, I will get its position within ContainerB. But what if I want its position within ContainerA instead? How do i get that?

Any help on this would be immensely appreciated. Thanks.
My code doesnt detect 2 kest at once.

I want to press an arrow key and spce bar.

In .net the below code does do this but in flash if I hold down an arrow key and press space bar the arrow key event will stop working.

 private function doSomething(e:KeyboardEvent):void {
   var  mybackList:Array ;
   mybackList=mybackground.getbackground ;
    if (e.keyCode==39) {    myplayer.moveright(mybackList);     }// Right
    if (e.keyCode==32 && myplayer.jumping ==false) {

i regularly get a situation when repeated send requests on the same HTTPService object work but suddenly stop functioning without triggering an exception or faultEvent. Send methods are called but Wireshark shows that no requests actually go out. Seems to happen intermittently during periods of overlapping requests.

Problem reproduces on both action script or mxml constructed objects. On both FLEX SDK 3.5 or 4.1  

(The situation is made worse by that my preferred workaround would require to get the HTTPService object instance from the fault handler (i.e. on request timeout) so that the object could be destroyed and re-created - so that the resend would work. Unfortunately it is a  known issue that one can't obtain the instance from event.result and the rootURL kludge that i see being used is a bit too much for me...)

Any help would be greatly appreciated!!

The object parameters and usage is fairly basic, see below

var newServiceItem: HTTPService = new HTTPService();
newServiceItem.url = url;
newServiceItem.contentType = "application/x-www-form-urlencoded"
newServiceItem.method = "POST";
newServiceItem.resultFormat = "text";
newServiceItem.concurrency = "multiple";
newServiceItem.requestTimeout = 1;
newServiceItem.addEventListener(ResultEvent.RESULT, resultHandler );
newServiceItem.addEventListener(FaultEvent.FAULT, faultHandler );
I have a platform game where a character  jumps in the air and lands on the ground.
Now my issue is that I cant use the HitTestObject function below.

I need to test a situation where  where the object will move first and test to see whether an image collsiion occurs. I cant test when the image has actually collided or else the character will bounce on  the ground.   I can get this to work with HItTestPoint .

Is there a way to specify HitTestOBjects coordinates?

 if (el2.img .hitTestObject(myplayer.img)==true)
On a site's homepage I have a simple code that on the first frame adds a movieClip from the library (called mcHome) which contains video player. (flvplayer)
      var mcHome:mcHomeMain = new mcHomeMain();

now, on the 10th frame, I want to clear the video to show other content so I wrote:
which works just fine. (or at least it look like it working...)

now, I have a button to go back to the home page (first frame)

The problem is that I've noticed that the memory is increasing every time I go back to the first frame and placing again the video mc. (like it wasn't deleted and cleaned from memory at all the last time). after several times of this loop - the memory usage is multipled and the video is starting to play very slow.

I've found several places online that says this problem is well known, but I havn't found a decent solution.

btw, I've also tried to replace the FLVplayer with NetStream code, with no success - the same results. and also check on flash Player / firefox / explorer with no difference.

Please help. Thank you.

If I want
 to pass a list of objects to another class function in AS3, I use an array of vector.
My code does work as this is what you do in .net. I am assuming AS3 this is how you pass object  arrays?

public function moveleft(mybackList:Array)

                   for each (var el:ClassBackGroundTile  in mybackList) {
                          if (mycollision.CollisionWalk(this,el)==true)
public function CollisionWalk(myplayer:ClassPlayer ,bk:ClassBackGroundTile):Boolean
How can I duplicate or copy a dictionary in Flex Actionscript I don't want any connection with original.
I'm researching a way for us to create a offline application for our publication. Just wanted to know if anybody has any input on a few questions.

1. Does the end user have to have coldfusion installed on their computer?
2. I see Coldfusion has Air Offline application support but can Coldfusion run in a self contained adobe air application? (Doesn't it need a coldfusion server installed?)

Thanks for any feedback.

Hi I wonder if someone could help. At present I load via http some xml representing a whole bunch of formatting options that ultimately control how text is displayed using a richeditabletext control and TextLayoutFramework. The text frequently changes and consequently so do the formatting options represented.

At present due to the fact that up to 5 seperate classes need access to these variables (ie the same formatting option)in different places at the same time, they are currently stored as private static vars with getter and setter methods, which works fine

However I am sure that I have read somewhere that this useage is bad, and being fairly new to oop and As3 I was wondering if using static vars in this way is good practice.

If it is not which is the best way!!! pseudo examples would be greatly appreciated as I can be a but dumb lol. I have thought of binding but keep hitting a brick wall when it comes to try and implement a suitable solution.

Hello Experts

I am trying to integrate Facebook API with my Flex application. Every time Flex application connects with facebook and if user is not logged into facebook account then user is directed to facebook log in page.
Is there any way i can log in from my Flex application without redirecting and connect to facebook.

Thanks in advance
I need to create an app that runs in Flash Projector on a Mac. This app plays flv files on a timed schedule. That part is no problem. What I would like to do is to have the Flash app check online for updated versions of the videos and download them locally, replacing the existing ones. How can I accomplish this task? Also, are there permissions that must be set so that this process can happen without user intervention?
I know that when an instance of an object has an event listener attached to it and the event listener is not removed, this object will continue to exist in memory and will never go through garbage collection. I am now wondering how this applies to popups generated by PopUpManager.createPopUp().

I feel uncomfortable with PopUpManager not having the ability to allow me to reuse the same popup instance. Instead, each time you invoke createPopUp, it creates a new instance of the popup. So if I had added an event listener to the popup, I'm guessing all these instances of my popup will accumulate in memory.

This normally isn't an issue because I could remove the event listener in the CloseEvent of the popup. But my current application involves a popup that is NOT supposed to disappear until I get the results from the server. This result is determined in a DIFFERENT class, and hence, I find myself having to pass a reference of the popup to that other class just so I could remove the event listener and then invoke removePopUp().

But does anyone know for sure if removePopUp not only removes the popup off the DisplayList, but also removes all event listeners attached to the popup?
How can I get the stage height in AS3

For some reason when placing trace(stage.stageHeight ); in some class definitions the below code gets a

Cannot access a property or method of a null object reference.

 import flash.display.Stage;
   import flash.display.StageAlign;
   import flash.display.StageScaleMode;
   import flash.display.StageQuality;
   import flash.display.StageDisplayState;

   trace(stage.stageHeight );

Apache Flex

Apache Flex is a highly productive, open source application framework for building and maintaining expressive web applications that deploy consistently on all major browsers, desktops and devices (including smartphones, tablets and television). It provides a modern, standards-based language and programming model that supports common design patterns suitable for developers from many backgrounds. Flex applications can be deployed to the Adobe Player in the browser, Adobe AIR on desktop and mobile devices or to native Android, iOS, Windows or Mac applications.

Top Experts In
Apache Flex