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 [...]
Recently I needed to implement a CAPTCHA (means: “Completely Automated Public Turing test to tell Computers and Humans Apart” – on wikipedia) functionality to a sign-up form in flex.
So here is the class:
public class Captcha extends Canvas
{
private const CAPTCHA_WIDTH:uint = 120;
private const CAPTCHA_HEIGHT:uint = 40;
[...]
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 [...]
So you need a modal window and you are using Flex . This a small example that will open a modal window when application it’s initialized. I put the title to the modal window, but you can add also an icon.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" initialize="openModalWindow()">
[...]
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 [...]
Today a friend send me a link that I feel I need to share with the others:
AlternativaGame- a 3d framework done in flash.
For a demo go here
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 [...]