And now here is a running example. This shows how to generate a CAPTCHA setting about 4 parameters.
A very handy parameter is the rest one. Imagine you want a function that will calculate the sum of any number of parameters of type number. One way to do it is to send an array to the function. But one better way is to use the “rest” parameter.
Here is the function:
public function MakeSum(a:int, … [...]
These days I started to study about MVC (Model-View-Controller) implementation for Flex. Although I used a lot MVC and MVC Frameworks in other language (PHP 4 & 5) the Cairngorm MVC Framework is a bit more complex.
For a better understanding I found the following interactive diagram where you can view which part of the code [...]
This it’s a clean example about how to add a CSS style to a component in Flex.
We need to create the CSS file (style.css) and add a custom style:
.myStyle {
font-size: 20px;
color: #cc0000;
}
Make a new Flex project and in the defalul MXML aplication file add this code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" >
<!–// Here we call our [...]
In my previous post I started to talk about how you can see the same trace messages you were used from developing but this time in the “Release”.
This is done with the help of the Log class (mx.logging.Log).
Let’s take a look at some pieces of code (full code can be provided per request).
private var [...]
Adobe has announced a RIA Developer Camp November 5, 2007 4:00 p.m. – 8:30 p.m.
Details:
Learn from other developer community leaders on how they use Adobe® Flex™ 2, Flash® CS3, and AIR™ (Adobe Integrated Runtime) to help them improve their business applications.
Join this seminar and hear speakers from Yahoo!®, PayPal™, ActionScript.com, and Adobe discuss how business [...]
Recently I had to put a mask to an UIComponent. Here is the way to do it:
var largeMask:UIComponent = new UIComponent();
largeMask.graphics.beginFill(0×00FFFF, 0.5);
largeMask.graphics.drawRect(0, 0, 120, 40);
largeMask.graphics.endFill();
largeMask.x = 0;
largeMask.y = 0;
this.addChild(largeMask);
this.mask = largeMask;
this should be UIComponent or Shape or similar object.
Obs: the mask must be added as child to the object you need to add the mask [...]
ScrapBlog is a very nice web based photo tool made using Flex Technology.I play around, and in about 10 minutes a make my account and create my first web photo album. I select a theme, upload some images,I place those in the right spots and that’s all.
You can post comment, have your own public profile, [...]
Luke Bayes and Ali Mills of PatternPark presented 9 Flex Frameworks for the Silicon Valley Flex Users Group (SilvaFUG) at Adobe’s offices in San Francisco.
Those frameworks are: Cairngorm, PureMVC, ARP, MVCS, Flest, Model-Glue: Flex, ServerBox Foundry, Guasax, and Slide.
The final conclusion was that PureMVC by Cliff Hall beats out the alternatives. We prefer PureMVC [...]
A feature of Flex (and any decent programming language) is the garbage collector. What it does? Once it detects that an object in memory is no longer needed it will clean up the memory. Simple no?
Well is not that simple: you may have finished your work with that object but there are references to [...]
I wanted to write a few words about the deep object copying in flex (aka as making an absolute identical replica of an object no matter it’s class).
There is a function in the flex API called ObjectUtil.copy This is a very nice function but the problem is it cannot work on all object classes. [...]
It seems that the constants behave strangely in Flex.
Here is why:
public const X:String = "X";
public const Y:int = 101;
public const NotSoConstant:XML = …some random xml…
Now here comes the fun part:
var x:string = X;
x = "aaa";
trace(X + ":" + x); // X:aaa
var y:int = Y;
y = 10;
trace(Y +":" + y); //101:10
var constantOrNot:XML = NotSoConstant;
constantOrNot = …another [...]
One of the most common problems in the RIA applications that require login/logout and also some saves is how to prevent the user from closing the window/tab when there is unsaved information?
The answer is simple: FABridge.
This functionality allows you to catch the unload event from javascript and execute your flex code.
Here is how:
First you need [...]
One of the most common problems in developing new applications is their debugging. There are several methods to do this in Flex (trace, alert - like somebody once said: “Alert till death”). But what happens if you want the same logging that you had on your work environment to also be available when the application [...]
Flex3 offers a nice way of using web-services. Flex2 does not have the feature to the generate wsdl classes, but there is a way to write one general function that allows you to connect to any webservice and pass any number of parameters to it. Here is the quick and dirty code :
private var [...]