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

could any one suggest me to read  *.xlsx  file using flex/flash builder

please provide some links or any components available to do this.
0
I am having a hard time "dispatchEvent" from parent to child. Would love it if I can get an example of this. Perhaps an even better alternative like a Singleton Event.
0
I am running trying to access form my local server a remote server.

Error #2044: SecurityErrorEvent  : text=Error #2048: security sandbox : http://localhost/debaton/debaton.swf cannot access data from http://192.168.1.20/~debaton/services/gateway.php.

So I put crossdomain on
http://192.168.1.20/~debaton/crossdomain.xml

    <?xml version="1.0"?>
    <cross-domain-policy>
    <allow-access-from domain="*" />
    
    </cross-domain-policy>

Open in new window


and put

     params.allowscriptaccess = "always";

Open in new window


In my html .

But still has this error !
What am I doing wrong ?
0
I received the error message shown in the graphic.  I didn't see anything in a google search and was wondering what the heck it is.  

err
0
Hello

My client asks me to customized  flex 4 menu (menu and NOT menubar)

I have used soem CSS and some SKINs on other Flex components (buttons), but I have no idea where to start with menu items.


Here is the desired look&feel of the menu
customized menu
Any clue on where to start ?

reagrds
0
Hi

i Am new to the use of flash to make games and i wanted to get together with other game developers to bounce ideas off of and pool some resources

Any Help would be great
0
dear experts ...
i have a question regarding the item renderer in flex for list ...


what is confusing me is the following ..

suppose i have component A has datagrid and this datagrid has item renderer ... if i wan to access any method in component A ... i am using parentDoucment.methodName ();

everything is fine till now ...

but i wanna know when i have item renderer for list and i want to access method in component A
i have ot use parentDocument.parentDocument.mehodName ...


so why i have to use twice the parentDocument when i have list ???
0
I'm having trouble converting output from a web service to an arraycollection or any other type I try to cast.

My output from the webservice is :

results<n:bITESTResponse xmlns:n="http://tempuri.org/wstest" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <n:bITESTResult>
    <n:Streams>
      <n:_WEBOUT contentType="text/xml;charset=windows-1252">
        <n:Value>
          <TABLE>
            <TEST>
              <Name>Alfred</Name>
              <Sex>M</Sex>
              <Age>14</Age>
......


I'm using this function to attempt to cast to an Array Collection:

      public function getResult(event:ResultEvent):void{
                        trace ("results" + event.result);
                        orArray = new ArrayCollection(ArrayUtil.toArray
                              (event.result.Streams._WEBOUT.Value.TABLE.TEST));
                  trace ('got it?' + orArray);
                  trace ('length:' + orArray.length);

However, the length of the arraycollection is 1:

length:1

I don't get anything in the Array....

Any ideas?

Thanks,

John
0
Helo Experts,
 I would like to be able to use "trace" as  "echo" is used in php. In the flex 3 manual examples are also given but it does not work for me:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                     creationComplete= "initApp()" >
      <fx:Script>
            <![CDATA[
                  private function initApp():void{
                              var degrees = 121;
                              var radians = degrees * Math.PI / 180;
                              trace(radians) // 2.111848394913139
                  }                        
            ]]>
      </fx:Script>
</s:Application>
Is there a way to get the trace to work in order to test output for different expressions?
0
Hello,
Any Flex automation test experts in this group?  Any knowledge in Selenium or Silktest?
0
i create an app that makes use of data services.
when i build the app for release - i specify the server properties - (a different computer)
and then i move the database over - when running the app i'm getting the dreaded Channel Disconnected Error.

advice?
0
Helo experts,
Thank y for scouting me into the world of Flash/Flex!
I tried to adapt the Color Circles animation by Eugene using Lee Brimelow Wedge & Math2 scripts. But, only half way, still under the ground ..... Where is my error?!
Sincerely
chrsyl

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
      <fx:Script>
                  <![CDATA[
                        import com.leebrimelow.drawing.Wedge;
                        import com.leebrimelow.utils.Math2;
                        
                        import flash.display.Bitmap;
                        import flash.display.BitmapData;
                        import flash.filters.DropShadowFilter;
                        import flash.geom.Matrix;
                        import flash.geom.Rectangle;
                        
                        import mx.flash.UIMovieClip;
                        
                        private var container:UIMovieClip = new UIMovieClip;
                        
                        
                              var bmd = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0xFFFFFF);
                          var bm:Bitmap = new Bitmap(bmd);
                            var ds:DropShadowFilter = new DropShadowFilter(2, 45, 0x000000, 0.8, 2, 2);
                              container.addChild(bm);
                              addElement(container);
                        
                        function createArc(mx:int, my:int):void{
                              var sp:MovieClip = new MovieClip();
                              //
                              sp.x = mx;
                              sp.y = my;
                              sp.radius = Math2.random(50, 100);
                              sp.count = Math2.random(2, Math.floor(sp.radius/4));
                              sp.step = Math.floor(sp.radius / sp.count);
                              //
                              sp.filters = [ds];
0
Hi Experts,
I come only halfway - one arc - when trying to implement Lee Brimelows random arc script. Where am I missing?

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                     creationComplete="init()" >
      <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
      <fx:Script>
            <![CDATA[
                  import mx.flash.UIMovieClip;
                  import com.leebrimelow.drawing.*;
                  import com.leebrimelow.utils.*;
                  import flash.filters.DropShadowFilter;
                  
                  private var container:UIMovieClip = new UIMovieClip;
                  private var bmd:BitmapData;
                  
                  private function init():void{
                        bmd = new BitmapData(900, 600, true, 0x000000);
                        var bm:Bitmap = new Bitmap(bmd);
                        container.addChild(bm);
                        addElement(container);
                        addEventListener(Event.ENTER_FRAME, loop);
                        var t:Timer = new Timer(50);
                        t.addEventListener(TimerEvent.TIMER, createArc);
                        t.start();
                        createArc();
                  }
                  
                  function createArc():void{
                  var sp:MovieClip = new MovieClip();
                  sp.radius = Math2.rand(50, 400);
                  sp.sx = Math2.rand(20, 500);
                  sp.sy = Math2.rand(20, 400);
                  sp.thick = 2;
                  sp.startAngle = Math2.rand(20, 270);
                  sp.endAngle = Math2.rand(sp.startAngle, 360);
                  sp.color = Math.random() * 0xFFFFFF;
                  sp.count = 0;
                  …
0
I have a datagrid with a dataProvider supplied by an arrayCollection. Each row has a cell filled with an edit button and three cells filled with info. The edit button is in a separate editBtn.mxml file via itemRenderer because that's the only way I could make it work. I am trying to get the edit button for each row to copy the three values in that row to three variables.

editBtn.mxml gives error (call to undefined method editBtnHandler). editBtnHandler function is defined in the first mxml page where the datagrid is located.

How do I resolve this to make these pages communicate? Or is this not the way it should be done? Thanks.

private function editBtnHandler(event:Event):void {
            var favorite:String = event.target.selectedItem;
            mx.controls.Alert.show("favorite="+ favorite);
}

<mx:DataGridColumn itemRenderer="editBtn"/>

editBtn.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Button xmlns:mx="http://www.adobe.com/2006/mxml"
    label="Edit Button"
    click="editBtnHandler(event)"
/>
0
Helo Experts,
I want to make an animation with a custom made line that turns around like a seconds hand in a clock as with the script below, but without maintaining the past lines. Is that possible .... ?
Sincerely
chrsyl

<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
creationComplete="init ()" >
      
      <fx:Script>
            import mx.core.UIComponent;
            private var tiden=new Date();
      
            private function init():void{
                  var timer:Timer = new Timer(1000);
                  timer.addEventListener(TimerEvent.TIMER, switchImage);
                  timer.start();                }
            
            private function switchImage(e:TimerEvent):void{
                  tiden=new Date();
                  var min= tiden.minutes;
                  var sec= tiden.seconds;
                  var x2:Number=160+120*(Math.sin(Math.PI-sec*6*Math.PI/180));
                  var y2:Number=180+120*(Math.cos(Math.PI-sec*6*Math.PI/180));
                  drawLine(160, 180, x2, y2);                      }
            
            private function drawLine(x1,y1, x2, y2):void {
                  var component:UIComponent = new UIComponent();
                  var myShape:Shape = new Shape();
                  myShape = new Shape() ;
                  myShape.graphics.lineStyle(1, 0x990000, .75);
                  myShape.graphics.moveTo(x1, y1);
                  myShape.graphics.lineTo(x2, y2);
                  component.addChild( myShape );
                  addElement(component);                         }            
      </fx:Script>
</s:Application>
0
I would like to ask for your opion, if you are an Automation Test Engineer, especially, on the best automation tool there is for test automation of a Flex application?
I did a google search, and came up with Selenium, and another tool called "Test Anywhere."  Now what kind of a name is that for a tool.  Maybe it is TAW, which stands for something else.
Just kidding I don't know.
I'll continue searching, yet I ask, what automation tool have you used for testing Flex?
0
Hi,
I put together a mobile action script that makes an arc. Then I tried to use this package in a mxml mobile code but did not succeed? Where am I failing?
Sincerely
chrsyl

mobile actionscript code:

package  com {
      import flash.display.DisplayObject;
      import flash.display.Graphics;
      import flash.display.Shape;
      import flash.display.Sprite;
      import flash.display.StageAlign;
      import flash.display.StageScaleMode;
      
      public class Arc extends Sprite {
            private var size:uint         = 80;
            private var bgColor:uint      = 0xFFCC00;
            private var borderColor:uint  = 0x666666;
            private var borderSize:uint   = 0;
            private var cornerRadius:uint = 9;
            private var gutter:uint       = 5;
            
            public function Arc() {
                  super();
                  
                  // support autoOrients
                  stage.align = StageAlign.TOP_LEFT;
                  stage.scaleMode = StageScaleMode.NO_SCALE;
                  
                  drawArc(90, 160, 50, 100, 30, 30 );      
                  refreshLayout();
            }
            
            private function refreshLayout():void {
                  var ln:uint = numChildren;
                  var child:DisplayObject;
                  var lastChild:DisplayObject = getChildAt(0);
                  lastChild.x = gutter;
                  lastChild.y = gutter;
                  for (var i:uint = 1; i < ln; i++) {
                        child = getChildAt(i);
                        child.x = gutter + lastChild.x + lastChild.width;
                        child.y = gutter;
                        lastChild = child;
                  }}
                        
            public  function drawArc(x : Number, y : Number, radius : Number, arc : Number, startAngle : Number, yRadius : Number ) : void {
                  
                  var target:Shape = new…
0
This is a datagrid with two columns. I plan on having many columns. Each column input says add text here. When user clicks on that input,(add text here) gets replaced or updated with the user input. The columbs are editable, so if the user changes his mind the ArrayCollection gets updated.

I test this by inputing: sentence01 test. and sentence02 test. and click the button which converts the contents of the weatherInfo array object to a string that I can send to php.

The array is converted to a string and sent to php. PHP emails me the string and this is what I recieve:

nullD3315A22-768D-F239-D0D6-729798515A31, sentence01 test, F55EA87E-A1B9-B9DF-2EC1-7297993BDD51, sentence02 test,

When I use  mx.controls.Alert.show("weather info="+ weatherInfo);. It says the same thing.

The weatherInfo array object has this (D3315A22-768D-F239-D0D6-729798515A31) additional information.

How do I get a string into php with just the input values (sentence01 test, sentence02 test,)? Thanks.

<s:HTTPService method="POST" resultFormat="e4x">
  <s:request xmlns="">
  <str>{str}</str>
</s:HTTPService>

[Bindable] private var weatherInfo:ArrayCollection = new ArrayCollection
                ([{tex01:'add text here'}, {tex02:'add text here'}]);

[Bindable] private var str:String;

private function buttonHandler(event:Event):void {
  str = arrayCollectionToString(weatherInfo);
}

public static function arrayCollectionToString( weatherInfo:ArrayCollection ):String 
  { 
     

Open in new window

0
I have an ArrayCollection that I am trying to save to a folder on a web server to csv.

I don't mind using a combination of AS3 and PHP to accomplish this. I tried first sending the data as XML to a php script (magicparser) and then converting it to CSV but I could not get it to work as the csv was not in the order that it was originally in the ArrayCollection. I would like to know how to get this in it's proper order.

 If the CSV can be generated from Flex then auto uploaded to the server for further processing that would be fine as well.


This is how the CSV file should look
H,TUS test,TUS test,02/8/2012,TUS test,1234567890,555,05/19,Visa,
D,MBE37602SH,MBE37602SH,4,EA,54.41,345678,2/8/2012,,
D,MBE37602SH,MBE37602SH,4,EA,54.41,345678,2/8/2012,,

This is what I get


   ,TUS TEST,05/19,Visa,,TUS TEST,555,1234567890,02/8/2012,H,TUS test
  ,MBE37602SH,2/8/2012,,,MBE37602SH,345678,54.41,4,D,EA
 ,MBE37602SH,2/8/2012,,,MBE37602SH,345678,54.41,4,D,EA

This is the ArrayCollection

private var items:ArrayCollection = new ArrayCollection([
{type:"H", cnum:"TUS TEST", fg:"TUS TEST", qty:"02/8/2012", uom:"TUS test", price:"1234567890", po:"555", ddate:"05/19", efield:"Visa", ffield:""},
{type: "D", cnum:"MBE37602SH", fg:"MBE37602SH", qty:"4", uom:"EA", price:"54.41", po:"345678", ddate:"2/8/2012", efield:"", ffield:""},
{type: "D", cnum:"MBE37602SH", fg:"MBE37602SH", qty:"4", uom:"EA", price:"54.41", po:"345678", ddate:"2/8/2012", efield:"", ffield:""}]);
0
Hi,

 
Does the updateFramework work on executables.  If so does anyone have a suggestion for a good tutorial.  I've tried one and even using the files provided by the author the updater doesn't wotk on Windows.  Thanks for your assistance.

 
Best regards,

 
Chris McLaughlin
0
been googling how this should be done - i'm coming across a lot of mobile OS workarounds but i really just need this for a desktop app prototype.

so i did this

i tried this
var file:String = "Chris.pdf";
				currentState = "RegulationsView";
				
				var loader:URLLoader = new URLLoader();  
				loader.dataFormat = URLLoaderDataFormat.BINARY;  
				loader.addEventListener(Event.COMPLETE,  
					function(e:Event):void {  
						var air:File = File.applicationStorageDirectory.resolvePath(file);  
						var fs:FileStream = new FileStream();  
						fs.open(air, FileMode.WRITE);  
						fs.writeBytes(loader.data);  
						fs.close();  
					});  
				loader.load(new URLRequest("http://localhost/admin/upload/"+ file));  
				webView.stage = this.stage; 
				webView.viewPort = new Rectangle( 105, 65, stage.stageWidth-105, stage.stageHeight-65 ); 
				var pdf:File = File.applicationStorageDirectory.resolvePath(file);
				webView.loadURL(pdf.nativePath); 

Open in new window


i get a black rectangle - no pdfs.

at the end of the day what i'm trying to achieve is a read only pdf file. not allowing the user to open the pdf in native app so they can't do a save as.

help?
0
I want to be able to make graphics arc drawings with Flash Builder 4.6 for Air and Mobile Applications. There is very interesting algoritm by Lee Brimow (http://www.leebrimelow.com/?p=429) using movieclip to draw most fascinating artlike structures. I tried to use the arc algoritm but failed. What am I doing wrong?

import mx.core.UIComponent;
private function onInitialize():void{
drawLine( );

private function drawLine():void {
      var myShape:Shape = new Shape();
      var displayObject:UIComponent = new UIComponent();
      myShape.graphics.lineStyle(2, 0x990000, .75);
      myShape.graphics.moveTo(10, 10);
      myShape.graphics.lineTo(25, 145);
                        
      displayObject.addChild(myShape);
      this.addChild(displayObject);
                                                 }
is working!

But I have not succeeded to adapt with:
private function drawArc():void {
                        var myArc:Shape = new Shape();
                        var displayObject:UIComponent = new UIComponent();
                        
                        draw();
                        
                        displayObject.addChild(myArc);
                        this.addChild(displayObject);
                        }
                                    
                  private function draw(myArc, 20, 70, 50, 60, 270):void{
etc as below:

http://code.google.com/p/leebrimelow/source/browse/trunk/as3/com/theflashblog/drawing/Arc.as
package com.leebrimelow.drawing
{
        /*
         * This class is based on code written by Ric Ewing (www.ricewing.com).
         * See the details at http://www.adobe.com/devnet/flash/articles /adv_draw_methods.html.
         * I made several changes including the sending …
0
Hi guys,

I am looking to do the following with an image in AS3 (flash)

Upload an image to swf movie -
edit this image size, position on screen, orientation
Save the image to the server using PHP or what ever is easy

Can some one point me in the right direction of a package maybe?

John
0
Hi guys,

I am trying to populate some text fields using this

public var txtName:String ="MovieClip(leaderboard).txtName";
		public var pic:String ="MovieClip(leaderboard).pic";
		public var txtTime:String ="MovieClip(leaderboard).txtTime";
		
		public function popLeaderBoard() : void {
			
			var currentVO:Number = 0;
			
			for each (var scoreVO:Object in leaderBoardDecoded) 
			{
				currentVO++;
				
				var leaderPic = "http://graph.facebook.com/"+scoreVO.fbname+"/picture";
				var leaderPicFile : DisplayObject = loadSmallFBPic(facebookpic);
				
				txtName = "leaderboard.txtName"+currentVO +".text";
				pic = "MovieClip(leaderboard).pic"+currentVO;
				txtTime = "MovieClip(leaderboard).txtTime"+currentVO;

				
				this[txtName]= scoreVO.fname;
				//this[pic].removeChildAt(0);
				//this[pic].addChild(leaderPicFile);
				//this[txtTime].text= scoreVO.scoreTime;
			
			
			}
			
			

		};

Open in new window



So i am looping the VO and getting the values fine however I need to dynamically get access to the text field , txtName1 -> txtName10.

John
0
I am trying to write a simple Flex Mobile Application in Flash Builder 4.6 that will play embedded and remote videos and target iOS and Android platforms.

However, when I create a Flex Mobile project I do not get the option of using the VideoPlayer component.

How can I go about playing videos from within my application on these devices?
 
Alternatively, could I somehow invoke the native video player from within the flex application? If so, how would I go about this and could I also play embedded videos using this technique?
0

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
<
Monthly
>