Owner: FLEX{er} - flex developers web corner URL:http://www.flexer.info Join Date: Tue, 16 Oct 2007 08:51:25 -0500 Rating:0 Site Description: FLEX{er} is a tool where information regarding Flex programmers is gathered starting from general like books and resources and going to examples of actionscript for specific problems. Site statistics:Click here
Adobe Flex Builder Linux Public Alpha 2007-10-16 02:04:02 This is the first release of Flex Builder
to support Desktop Linux
. This version is based on several features from Flex Builder 3 (codenamed “Moxie”). It includes project creation, code coloring, code hints, compilation, the Ajax Bridge, Find All References, and debugging. Not all Flex Builder 3 features are supported, so be sure to check out the release notes for a list of unsupported features.
FAQ
Is Flex Builder for Linux part of the Flex 3 beta?
No. Adobe
is developing the Linux product in parallel with Flex 3. Many of the Flex 3 features are also included in the Linux version, however the Linux product is a separate project and is on its own schedule.
Are all of the Flex Builder 3 features included in the Linux release?
No. Although many of the features in Flex 3 are included in the Linux release, there are several features that are not yet included. Our main goal is to get the base features in place and then to solicit user feedback and their priorities for addition Read more:Alpha
, Public
Flex Builder 3 beta 2 2007-10-16 01:56:22 This near-feature-complete Flex Builder
3 beta 2 release will provide you with an opportunity to explore powerful new features, communicate early feedback, and test existing Flex applications with the latest Flex 3 framework.
FAQ
What did Adobe announce regarding Flex?
On October 1, 2007 Adobe announced the public availability of Flex 3 beta 2. This is the second public beta for Flex 3. Adobe also announced the availability of the Flex Skin Design Extensions for CS3. These extensions enable Flash, Fireworks, Illustrator and Photoshop to export skins that can easily be imported into Flex Builder 3.
What’s new in beta 2?
We’ve added a number of important new features in this beta including data wizard support for .NET, Web Service introspection wizards, and project import/export capabilities. You can get all the details for the release by reading Matt Chotin’s article in the Flex Developer Center and by reading the release notes.
What are the goals of the beta?
Beta 2 is a nea
Essential Actionscript 3.0 - a book you must have 2007-10-13 09:02:42
For those that have been to Flex Camp in Bucharest, Romania they already have one copy of this book - that because Adobe was kind to give all participants an Essential
Actionscript 3.0 book for free. This book is a must for Flash and Flex programmers and covers many aspects of programming Actionscript. Is published by O’Reilly and has a bit more over 900 pages.
The book can be easily found in US and other West European countries but in Romania it can be bought from Byblos Bookstore (to see it online click here).
Flex runtime errors after reverting to old 9.0.28 version 2007-10-12 02:39:50 In the previous article found here we reverted to 9.0.28 flash player because we still need the debugging version
of flash player for Flex Builder 2. The approach is working and the debug is working again but sometimes in bigger application where a lot of actionscripting is involved some runtime errors are arising. It seems that the player found in “Player Backup/debug” is not the same with the last player (and in deed it seems to be the player from Flex Builder 2.0.0 not the one from the 2.0.1 update) and because of that some errors will appear. To solve this issue i found Archived Flash players available for testing purposes where different versions of flash player can be downloaded for testing purposes. I’ve downloaded “Flash Player 9 (debugger versions) (61.0 MB)” and from there installed the 9.0.28 version also as simple debug version and also as ActiveX. From now on the runtime error didn’t appeared anymore.
Sony Ericsson web site 2007-10-11 16:10:58 Cool and fast web site, nice effects and also a very good architecture.
Products overview it clean and they realy used flex in order to have a nice feeling when you come as a customer on SonyEricsson
web site. You can search, list, chose, compare also you can browse accessories and so on.
As an user was a new experience. I like it.
As an developer I was amazed what can Flex do. You grab some components, mix them together, put some info from a few XML files, add images and you have a full working presentation web site or a cool shop. Go and visit this website at http://www.sonyericsson.com. Read more:Sony Ericsson
To disable an item of a MenuBar 2007-10-11 09:05:15 Having the code bellow:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public static const menubarXML:XMLList =
<root>
<menuitem label="main1" data="http://www.flexer.info/feed/1">
<menuitem label="sub1" data="http://www.flexer.info/feed/1_1"/>
<menuitem label="sub2" data="http://www.flexer.info/feed/1_2"/>
<menuitem label="sub3" data="http://www.flexer.info/feed/1_3"/>
<menuitem type="separator"/>
<menuitem label="sub4" data="http://www.flexer.info/feed/4" />
</menuitem>
<menuitem label="main2" data="http://www.flexer.info/feed/2">
<menuitem label="sub1" data="http://www.flexer.info/feed/2_1"/>
<menuitem label="sub2" data="http://www.flexer.info/feed/2_2"/>
<menuitem type="separator"/>
<menuitem label="sub3" data=
Flex Camp - Bucharest 2007, octomber 10 2007-10-11 06:37:09
Adobe Romania invite around 80 flash and flex programmers to first Flex Camp in Romania.
What can I say … cool … a lot of new stuff. New products, a new IDE, we see some AIR stuff and results, also we got the feeling that Flex we be developed from now on for different user need (VoIP, video, data synchronization, visual effect and so on …).
Was a great opportunity for me to meet the team and I will be there to the next camp in 2008 January. For more details, presentations and other information please visit Flex camp web site at http://www.flex.org/camp.
Adobe team was very friendly, you can get a lot of help from them, at any time. Read the documentation, get new releases, report bugs or suggest features this is what Adobe team expects from a good developer. Go to bug web site and post bugs, it there are any at http://bugs.adobe.com/flex/. Read more:Bucharest
How to find the class name of an object instance? 2007-10-18 04:26:23 If you need to find the class
name of an object instance you can use:
className = flash.utils.getQualifiedClassName(yourObject);
This will return a string containing the name of the class that is the base for yourObject. Is very helpful when you need to show errors in big applications.
The returned value is something like this: my.path.to.class::className.
Cross domain policy 2007-10-17 03:24:43 Some times you may pass over the following problem: the data doesn’t loads although the flex application is showing busy cursor. It remains in the loading process but it doesn’t finish. One of the following thing happens:
As you can see in the image above the SWF is not accessing the same domain
it come from as it resides on www.test.ro and tries to access www.testserver.ro. Due to flash player security policy this is not posible by default.
Here enters the crossdomain.xml file (the default cross-domain policy file). A cross-domain policy file is an XML file that provides a way for the server to indicate that its data and documents are available to SWF files served from other domains. Any SWF file that is served from a domain that the server’s policy file specifies is permitted to access data or assets from that server.
When a Flash document attempts to access data from another domain, Flash Player attempts to load a policy file from that domain.
crossdomain.xml resi Read more:Cross
Flex Examples 2007-10-16 16:44:14 A bunch of examples for Adobe Flex and ActionScript.It’s a good starting point if you need help on any problem. There are examples with sources (mxml files) and a working swf.
I thing this is a really useful tool for everyone how it’s thinking to start using Flex.
So visit Peter deHaan’s blog at blog.flexexamples.com.
Peter deHaan currently works for Adobe on the Flex SDK QA team. While not working on Flex, Flash, and ColdFusion applications, Peter enjoys playing Dance Dance Revolution. Peter’s rarely updated blog can be found at http://blogs.adobe.com/pdehaan/.
While not Flex related, you can browse some of Peter’s quick start articles on Flash and the ActionScript 3.0 components on the Flash Developer Center Quick Start section:
Creating, populating, and resizing a DataGrid
Customizing and sorting the DataGrid
Using the Button component
Using the Label component
Using the Flash CS3 video encoder
Handling metadata and cue points in Flash video
Embedding fonts Read more:Examples
FABridge: Warn on flex application exit 2007-10-25 06:10:24 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 to create a public variable in your application
public var isAppDirty:Boolean = false;
That variable is set to true whenever changes occur that must be saved.
Second you need to modify your html wrapper. It is located in the html-templates folder.
window.onbeforeunload = confirmExit;
function confirmExit()
{
var flexApp = FABridge.flash.root();
var appDirty = flexApp.isAppDirty();
// Note that the isAppDirty var is called like a function.
// This is done deliberately. Thats the way FABridge works
if (appDirty == true)
{
return "Data has changed. If you wish to save the data, click CANCEL, if not cli
[Transient] metadata Tag 2007-10-25 02:56:25 One interesting that I have found is the [Transient] metadata
. What it does?
It instructs Flex not to serialize the object member (variable/function) when you do a serialize/deserialize of an object.
Here is a quick more in detail code
public class Test
{
private var x: int;
private var y: int;
public function get xval():int
{
return x*x;
}
public function set xval(value:int)
{
x= x*y;
}
public function set yval(value:int)
{
y=value + 1;
}
}
If you try to serialize and deserialize an instance of this class you would see that the values for x,y are different before and after. Why?
Well it seems that in the deserialization process all the values are extracted (x,y,xval and yval) and the getters/setters are executed. How to solve this problem? Simpl: use the [Transient] tag:
[Transient]
public function get xval():int
When the object will be serialized the value for the xval will not be present and the getter/setter w
Debug/Logging Client-Side 2007-10-24 07:48:30 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 is distributed to the customer?
There are several methods to do this: logging into a field in the application, logging to the customer database (if the application uses a database) or using TraceTargets. There may be other methods to do this, but this are the main ones.
I will not talk about the database approach, but I will concentrate on the TraceTarget approach.
Imagine you have an application that is distributed to a lot of clients and one of them tells you he has a problem. In this case you can ask him for a description of the problem and try to replicate it. That often is not successful. What if you could instruct the application you developed to send you the trace Read more:Client
, Debug
New Flex Builder pricing 2007-10-24 05:01:24
You may already know that but it's worth mentioning it again.
Along with the recent Flex Builder
3 public beta 2 release Adobe recently announcing the new packaging and pricing for Flex Builder 3.
Adobe Flex™ Builder™ 3 Standard Edition - $249 US
Adobe Flex™ Builder™ 3 Professional Edition - $699 US
Starting on November 1, 2007, Adobe will be re-pricing Flex Builder 2 to align with the new Flex Builder 3 pricing, so you will be able to purchase Flex Builder 2 for only $249 US and Flex Builder 2 with Charting for only $699 US.
Upgrading prices are:
Flex Builder 2 to Flex Builder 3 Standard Upgrade - $99 US
Flex Builder 2 with Charting to Flex Builder 3 Professional Upgrade - $299 US
Trade-up from FB Standard to FB Professional - $499 US
Official New Flex Builder 3 packaging and pricing article on Adobe
Retrieving channels from a 32-bit color 2007-10-24 03:33:19 To isolate the color channels
and alpha channel from a 32-bit color we use shifting and bitwise AND operator.
var colorValue:uint = 0xFFFFCC99;
// Isolate Alpha channel
var alpha:uint = ( colorValue << 24 ) & 0xFF;
// Isolate Red channel
var red:uint = ( colorValue << 16 ) & 0xFF;
// Isolate Green channel
var green:uint = ( colorValue << 8 ) & 0xFF;
// Isolate Blue channel
var blue:uint = colorValue & 0xFF;
To clear just one channel (let say red) in a 32-bit color value you can do as below:
// Clearing the red channel
colorValue &= 0xFF00FFFF;
Form more about this see Essential Actionscript 3.0 by Colin Moock, O'Reilly, chapter 26 - Bitmap Programming.
Total Training for Adobe Flash CS3 Professional ActionScript 3 Essentials 2007-10-23 07:24:25 Adobe Flash
CS3 Professional ActionScript
3 Essentials
Course, available on TotalTraining
web site as online study or on DVD, it's created for developers that have beginner or intermediate programming skills.
Highlights
Review the Panel basics in ActionScript 3 and see how to set up the ActionScript preferences using the Reference Library and the Script Selection panel.
Learn how to use dot syntax notation and how to write ActionScript 3 structures, and find out how to debug them when things go wrong.
Discover how to use properties and methods for ActionScript 3 built in classes for complete control of MovieClips, TextFields and Sounds.
Build event handlers for ActionScript 3 built-in classes to add interactivity and respond to both user generated events as well as program events like sounds and data loading.
Make and use your own custom classes so you can modify existing classes like custom buttons, and get more reusability from your applications and animated MovieClips.
Cours Read more:Adobe
Web Service small how-to 2007-10-23 03:46:27 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 _wsGeneralService
:WebService;
private var _wsGeneralMethod:String;
private var _wsGeneralParam:Object;
public function connect(webserviceURL:String,
webservice:String,
webmethod:String, params:Object)
{
_wsGeneralService= new WebService();
_wsGeneralMethod = webmethod;
_wsGeneralParam = params;
_wsGeneralService.wsdl = webserviceURL+ webservice+ ".asmx?WSDL";
_wsGeneralService.addEventListener(FaultEvent.FAULT,errorHandler);
_wsGeneralService.addEventListener(ResultEvent.RESULT,handleResult);
_wsGeneralService.addEventListener(LoadEvent.LOAD,loadHandler);
_wsGeneralService.loadWSDL();
function
Nokia N810 and Flash Player 9 2007-10-23 01:55:49
The Nokia
N810 internet tablet runs Flash
9 in the browser.
This device is based on the Maemo platform.
You can find more on the following links:
Nokia N810 - official
Maemo platform
Maemo on Nokia site
Colin Moock Blog 2007-10-22 07:33:25 Colin
Moock Blog (www.moock.org/blog) it's full of information, you can get latest news and also cool lessons about ActionScript and Flex Builder.
If you don't know who this person is, let me give you a clue ... it's the author of Essential ActionScript 3.0 book and more others related to ActionsScript, Flex and Flash.
"Colin Moock is an independent web guru with a passion for networked creativity and expression. He has been researching, designing, and developing for the Web since 1995. Colin served as webmaster for SoftQuad, Inc. (makers of HoTMetaL PRO) until 1997, and then as web evangelist for ICE (one of Canada's leading interactive agencies) until 2001. He has created interactive content for Sony, Levi's, Nortel, Air Canada, Procter & Gamble, and Hewlett-Packard. Colin now divides his time between writing, speaking at conferences, and researching emerging web technology. His award-winning Flash work and his renowned support site for Flash developers (http://www.moock.or
Debug/Logging Client-Side Part 2 2007-10-29 11:22:00 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 myTarget:ILoggingTarget;
myTarget = new TraceTarget();
Log.addTarget(myTarget);
var myLogger:ILogger = Log.getLogger(category);
myLogger.log(0,message);
The first 2 lines create a variable of type TraceTarget. Then it is added to the loggers list by calling
Log.addTarget(myTarget)
.
After that all we have to do is log the message:
myLogger.log(0,message);
.
How can we use this method to send the log output to a remote machine? Simple we have to create our own logger:
package com.qbic.logging
{
import flash.events.Event;
import flash.net.XMLSocket;
import mx.logging.LogEvent;
import mx.logging.targets.LineFormattedTarget;
internal final class remoteTarget exte Read more:Client
, Debug
RIA Developer Camp 2007-10-29 08:25:31 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 owners, web developers, and end users are using these technologies to build their cool applications in a snap.
• Adobe AIR lets developers use their existing web development skills in HTML, AJAX, Flash, and Flex to build and deploy rich Internet applications to the desktop.
• Design rich Internet applications that help businesses communicate more effectively, inside and outside the enterprise, with Flex 2.
Camp will be held at:
Adobe San Francisco Office
601 Townsend St.
San Francisco, CA
Click here to register
News gotten from everythingflex blog
Adding a mask to graphic components 2007-10-29 08:17:23 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(0x00FFFF, 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 otherwise everything will be masked - nothing will be shown.
Simple modal window in ActionScript 2007-10-29 06:11:10 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.
<mx:application xmlns:mx="http://www.adobe.com/2006/mxml">
layout="absolute" initialize="_openModalWindow()">;
<mx:script>
<!--[CDATA[
import mx.containers.Canvas;
import mx.managers.PopUpManager;
import mx.containers.TitleWindow;
import mx.controls.Label;
public function _openModalWindow():void
{
//define title window
var _titleWindow:TitleWindow = new TitleWindow();
_titleWindow.title = "New modal window";
//define and add canvas
var _tmpCanvas:Canvas = new Canvas();
_tmpCanvas.height = 100;
_tmpCanvas.width = 300;
_titleWindow.addChild(_tmpCanvas);
//define and add label
var _tmpLabel:Label = new Label();
_tmpLabe Read more:ActionScript
, Simple
9 Flex Frameworks 2007-10-26 06:19:41
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 because of:
Composition over inheritence
Liberal use of Interfaces
Indirection is used but not overwhelming
Instance members hide singleton references from application code
MXML views can be extremely thin
Benefits of Cairngorm, with few of the disadvantages
Watch the presentation: http://adobechats.adobe.acrobat.com/p12266504/
See the slides: http://www.asserttrue.com/files/ApplicationFrameworks/index.html
PureMVC Article: http://puremvc.org/content/view/43/1/
Framework spotlight 2007-10-26 03:14:16 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
Garbage Collector and events 2007-10-26 02:21:54 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 it. In this case the garbage collector cannot collect that object.
In Flex one of the main reasons this can happen is because of event handlers that are forgotten to the object.
Let's take a look at the following code:
var myTestComponent:Canvas = null;
myTestComponent = new Canvas();
myTestComponent.addEventListener(MouseEvent.CLICK,testHandler); //testHandler is a function
myTestComponent = null;
This code will destroy the component but the memory associated to it cannot be collected as a reference exists (the event callback function: testHandler). In order to be able to collect the object before you make the object null you need to do the following:
myTestComponent.removeEv Read more:Collector
, events
, Garbage
Deep Object Copy 2007-10-25 09:12:29 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 Object
Util.copy This is a very nice function but the problem is it cannot work on all object classes. How can you handle those cases? You can make your own function for deep copy but that includes you need to know all about the object structure.
Let's take a quick look at how Flex copies objects:
var buffer:ByteArray = new ByteArray();
buffer.writeObject(value);
buffer.position = 0;
var result:Object = buffer.readObject();
return result;
It looks pretty interesting, no? What it does: instead of introspection and recursively copying properties from one object to another it will serialize the object as an array of bytes and then de-serialize it.
Using AMF means that some strange things might happen: Casts back to the original object class may fail, and the [Transient] metadata tag can affe