Friday, December 18, 2009

Event.bubbles, Event.cancelable, and Event.currentTarget

Perhaps some of you may not know this, but event-bubbling in Actionscript3.0 is way cool and well worth your attention. So read on.
With event-bubbling you can let one Event subsequently call on every ancestor (containers of containers of etc.) of the DisplayObject that originally dispatched the Event, all the way up to the surface (read: Stage), hence the name 'bubbling'.Perhaps noteworthy is that bubbling for an Event instance is disabled by default, and can only be activated by setting the bubbling parameter in the Event constructor.
Although the documentation doesn't seem to make it all too apparent, event-bubbling is actually the reason why the Event class has a currentTarget property (as well as a target property).So what is the use of Event.currentTarget? While the target property will always have its value set to the DisplayObject that originally dispatched the Event, the currentTarget property always points to the DisplayObject that the event is currently processing (i.e. bubbling at).
Find out more here actual source

Thursday, December 17, 2009

Manual Data Binding in Flex

You need to set up data binding manually. This allows you to do much more complicated and powerful things with data binding

Typically, you set up data binding using the simple Flex data binding syntax, like this:

Assuming the property is bindable, this will automatically change the label every time the "someProperty" property changes.But what if you want to do something more complicated, like execute a block of code in response to a property changing? You can't use the simple Flex data binding syntax. Rather, you have to set data binding up manually which you can do with the mx.binding.utils.ChangeWatcher class like this:
ChangeWatcher.watch(someObject, "someProperty", onPropertyChange);
This will ensure that your onPropertyChange function will get called every time the "someProperty" property changes.This is especially useful and powerful when using the Cairngorm Flex framework.

Will any event be dispatched when the user closes the browser window

Detailed explanation
No event will be dispatched by Flash Player or Flex framework when the user is closing the window. Your application can still be notified via JavaScript using ExternalInterface API.All you have to do is have a JavaScript function which will be invoked when the HTML page is unloaded. In this JavaScript function you can invoke a function in Flex to perform your desired operation.
Find the example code here :

Tuesday, October 27, 2009

Learn Flex

Flex is neither a programming language nor a scripting language. Flex is an IDE (Integrated development environment) and as well as a SDK (Software Development Kit) for the development and deployment of cross platform, RIA (Rich Internet applications) generally based on Flash.

Checkout more topics available at learna2z.com

All the useful stuff related to flex includes basic information like what is flex,framework,features,advantages over other ria technologies, controls,components,build custom components,code samples,customizations..n more


find out how to design using layouts,controls,navigators ... to develop custom components through example,sample codes

Flash® video is one of the standout technologies on the Internet. However, the traditional presentation of video--in a rectangular screen with a progress bar and some control buttons underneath--is only one possible use of video in a Flash application. Through ActionScript™, you have fine-tuned access to and control over video loading, presentation, and playback.


AIR (code name Apollo) is a new technology by Adobe allowing web developers create Rich Internet Applications (RIAs) for the desktop.


Monday, September 14, 2009

How to Cache Images in Your Flex Application

http://userflex.wordpress.com/2008/07/28/image-caching/

Sunday, September 6, 2009

Flex DisplayShelf Component

A DisplayShelf lets you display your image files in iTunes style. It’s a pretty cool way of presentation. In Flex I have used two libraries to achieve such a view.

The first one is what I saw on a popular webcast of James Ward and Bruce Eckel to display Flickr images. You can get more information about this component on http://www.quietlyscheming.com/blog/components/tutorial-displayshelf-component/ Go there and download necessary ActionScript files of DisplayShelf.as and TiltingPane.as

Flex component that imports contacts via OpenInviter.

this is a gr8 component found.

One of the requirements called for importing contacts from their email addresses. With the number of websites implementing contact importers these days, there would be plenty of Flex components out there to import your contacts.

One such thing is OpenInviter.

As of now, it allows you to import contacts from 62 different email and social network providers. :)


http://flexnflex.wordpress.com/2009/07/21/importing-contacts-from-mail-server/

Wednesday, September 2, 2009

Designing for Flex Part 1: Overview and introduction to Flex | Adobe Developer Connection

Designing for Flex – Part 1: Overview and introduction to Flex | Adobe Developer Connection

Adobe Flex is a new medium specifically created for designing and developing rich Internet applications, or RIAs. RIAs are a new breed of applications that break out of the constraints of traditional web and desktop environments to provide a more fluid, information-focused user experience. Flex makes it much easier to create these experiences, but it requires application designers and developers to think differently about the application design problem than they did when creating traditional web and desktop applications.


The Designing for Flex series includes the following articles:

Part 1: Overview and discovering Flex
Part 2: Planning your application
Part 3: Structuring your application
Part 4: Merging the web and the desktop
Part 5: Designing content displays
Part 6: Guiding with motion
Part 7: Making your application fast
Part 8: Making your application safe
Appendix A: List of best practices
Appendix B: For further reading

Shared via AddThis

Wednesday, August 26, 2009

List of 31 Flex APIs, Libraries, Components and Tools

Following up the list of 22 ActionScript 3.0 libraries is a new list of 31 Flex APIs and resources. You will find: time saving APIs, libraries, tools and other resources related to Flex development.

Adobe Flex cookbook beta
http://www.tiny.cc/VbU44

AnimatedGIfLoader Flex Component
Allows you to load animated gif files into your Flex applications
http://dougmccune.com/blog/animatedgifloader-flex-component/

Asdia
Provides an easy way to integrate flowcharts, uml or any other diagrams in flash tools.
http://code.google.com/p/asdia/

as3flexunitlib
ActionScript 3.0 framework for unit testing.
http://code.google.com/p/as3flexunitlib/

AsWing A3
Allows programmers to make their flash application(or RIA) UI easily
http://www.aswing.org/

Cairngorm
http://labs.adobe.com/wiki/index.php/Cairngorm

DisplayShelf Component
Provides a rich, templatable control to display a faux-3d view of a list of items
http://www.quietlyscheming.com/blog/components/tutorial-displayshelf-component/

flex2treemap
Treemap Component for Adobe Flex 2
http://code.google.com/p/flex2treemap/

flex4filemaker
Flex4FileMaker is an Adobe Flex 2 FileMaker API modeled after the FileMaker PHP library.
http://code.google.com/p/flex4filemaker/

FlexBook
Flex flip book component. Supports transparantcy.
http://www.quietlyscheming.com/blog/components/flexbook/

flexbox
Directory of Flex Components
http://flexbox.mrinalwadhwa.com/

flexcalendar
Flex Calendar Components
http://code.google.com/p/flexcalendar/

flexedtoolkit
Flexed Toolkit
http://code.google.com/p/flexedtoolkit/

FlexLib
community effort to create open source user interface components for Adobe Flex 2.
http://code.google.com/p/flexlib/

flexservicelocator
ServiceLocator for flex to use web service
http://code.google.com/p/flexservicelocator/

flextube
FlexTube is an flex UI front end for youtube
http://code.google.com/p/flextube/

Flex 2 Basic Email Form
Cut and dry example using an HTTP Service to send an email in Adobe Flex 2 via a simple PHP email script.
http://augiemarcello.com/flex-2-basic-email-form/

Flex 2 Debug Component
http://www.mikenimer.com/index.cfm/2006/7/5/FlexDebugPanel

Flex 2 Primitive Explorer
http://www.3gcomm.fr/Flex/PrimitiveExplorer/Flex2PrimitiveExplorer.html

Flex Developers Journal
The first and only independent magazine serving Adobe Flex developers worldwide.
http://flex.sys-con.com/

Flex Style Explorer
http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html

Fluorine
FLUORINE is an open source .NET Flash Remoting Gateway.
http://fluorine.thesilentgroup.com

Free Visual Reflection Component for Flex 2
http://blog.benstucki.net/?id=20

Granite Data Services
Free, open source (LGPL’d), alternative to Adobe® Flex 2 Data Services for J2EE application servers.
http://www.graniteds.org/confluence/display/INTRO/Granite+Data+Services

JAM - Just ActionScript and MXML
http://www.onflex.org/code/

Live “reflection” component
http://www.rictus.com/muchado/2006/07/05/live-reflection-component/

osflash-xray
Open Source Flash Debugger for AS2/AS3/Flex1.5/Flex2
http://code.google.com/p/osflash-xray/

scale nine
themes for flex and apollo/AIR
http://www.scalenine.com/

SpringGraph
Adobe Flex 2.0 component that displays a set of items that are linked to each other.
http://mark-shepherd.com/blog/springgraph-flex-component/

The Flex Show
Jeffry Houser and Ryan Stewart’s Poscast covering Flex related topics.
http://www.theflexshow.com/blog

The ServeBox Foundry
Based on several design patterns, and includes tools built to resolve some of the recurrent Flex 2 development challenges.
http://sourceforge.net/projects/sbasfoundry

Yahoo Astra Components
Tree, Menu, TabBar, AutoComplete, and Charts
http://developer.yahoo.com/flash/astra-flash

Yahoo! Maps Web Services - Flexâ„¢ API
http://developer.yahoo.com/maps/flash/flexGettingStarted.html

ZoomFrame
http://www.zeuslabs.us/2007/08/14/open-source-flex-component-zoomframe/


source

Tuesday, February 17, 2009

Operators used in Adobe Flex

Symbolic operators are characters that specify how to combine, compare, or modify the values of an expression.


Arithmetic
+ addition Adds numeric expressions.
-- decrement Subtracts 1 from the operand.
/ division Divides expression1 by expression2.
++ increment Adds 1 to an expression.
% modulo Calculates the remainder of expression1 divided by expression2.
* multiplication Multiplies two numerical expressions.
- subtraction Used for negating or subtracting.
Arithmetic compound assignment
+= addition assignment Assigns expression1 the value of expression1 + expression2.
/= division assignment Assigns expression1 the value of expression1 / expression2.
%= modulo assignment Assigns expression1 the value of expression1 % expression2.
*= multiplication assignment Assigns expression1 the value of expression1 * expression2.
-= subtraction assignment Assigns expression1 the value of expression1 - expression2.
Assignment
= assignment Assigns the value of expression2 (the operand on the right) to the variable, array element, or property in expression1.
Bitwise
& bitwise AND Converts expression1 and expression2 to 32-bit unsigned integers, and performs a Boolean AND operation on each bit of the integer parameters.
<< bitwise left shift Converts expression1 and shiftCount to 32-bit integers, and shifts all the bits in expression1 to the left by the number of places specified by the integer resulting from the conversion of shiftCount.
~ bitwise NOT Converts expression to a 32-bit signed integer, and then applies a bitwise one's complement.
| bitwise OR Converts expression1 and expression2 to 32-bit unsigned integers, and places a 1 in each bit position where the corresponding bits of either expression1 or expression2 are 1.
>> bitwise right shift Converts expression and shiftCount to 32-bit integers, and shifts all the bits in expression to the right by the number of places specified by the integer that results from the conversion of shiftCount.
>>> bitwise unsigned right shift The same as the bitwise right shift (>>) operator except that it does not preserve the sign of the original expression because the bits on the left are always filled with 0.
^ bitwise XOR Converts expression1 and expression2 to 32-bit unsigned integers, and places a 1 in each bit position where the corresponding bits in expression1 or expression2, but not both, are 1.
Bitwise compound assignment
&= bitwise AND assignment Assigns expression1 the value of expression1 & expression2.
<<= bitwise left shift and assignment Performs a bitwise left shift (<<=) operation and stores the contents as a result in expression1.
|= bitwise OR assignment Assigns expression1 the value of expression1 | expression2.
>>= bitwise right shift and assignment Performs a bitwise right-shift operation and stores the result in expression.
>>>= bitwise unsigned right shift and assignment Performs an unsigned bitwise right-shift operation and stores the result in expression.
^= bitwise XOR assignment Assigns expression1 the value of expression1 ^ expression2.
Comment
/*..*/ block comment delimiter Delimits one or more lines of script comments.
// line comment delimiter Indicates the beginning of a script comment.
Comparison
== equality Tests two expressions for equality.
> greater than Compares two expressions and determines whether expression1 is greater than expression2; if it is, the result is true.
>= greater than or equal to Compares two expressions and determines whether expression1 is greater than or equal to expression2 (true) or expression1 is less than expression2 (false).
!= inequality Tests for the exact opposite of the equality (==) operator.
< less than Compares two expressions and determines whether expression1 is less than expression2; if so, the result is true.
<= less than or equal to Compares two expressions and determines whether expression1 is less than or equal to expression2; if it is, the result is true.
=== strict equality Tests two expressions for equality, but does not perform automatic data conversion.
!== strict inequality Tests for the exact opposite of the strict equality (===) operator.
Logical
&& logical AND Returns expression1 if it is false or can be converted to false, and expression2 otherwise.
! logical NOT Inverts the Boolean value of a variable or expression.
|| logical OR Returns expression1 if it is true or can be converted to true, and expression2 otherwise.
Other
[] array access Initializes a new array or multidimensional array with the specified elements (a0, and so on), or accesses elements in an array.
as Evaluates whether an expression specified by the first operand is a member of the data type specified by the second operand.
, comma Evaluates expression1, then expression2, and so on.
?: conditional Evaluates expression1, and if the value of expression1 is true, the result is the value of expression2; otherwise the result is the value of expression3.
delete Destroys the object property specified by reference; the result is true if the property does not exist after the operation completes, and false otherwise.
. dot Accesses class variables and methods, gets and sets object properties, and delimits imported packages or classes.
in Evaluates whether a property is part of a specific object.
instanceof Evaluates whether an expression's prototype chain includes the prototype object for function.
is Evaluates whether an object is compatible with a specific data type, class, or interface.
:: name qualifier Identifies the namespace of a property, a method, an XML property, or an XML attribute.
new Instantiates a class instance.
{} object initializer Creates a new object and initializes it with the specified name and value property pairs.
() parentheses Performs a grouping operation on one or more parameters, performs sequential evaluation of expressions, or surrounds one or more parameters and passes them as arguments to a function that precedes the parentheses.
/ RegExp delimiter When used before and after characters, indicates that the characters have a literal value and are considered a regular expression (RegExp), not a variable, string, or other ActionScript element.
: type Used for assigning a data type; this operator specifies the variable type, function return type, or function parameter type.
typeof Evaluates expression and returns a string specifying the expression's data type.
void Evaluates an expression and then discards its value, returning undefined.
String
+ concatenation Concatenates (combines) strings.
+= concatenation assignment Assigns expression1 the value of expression1 + expression2.
" string delimiter When used before and after characters, indicates that the characters have a literal value and are considered a string, not a variable, numerical value, or other ActionScript element.
XML
@ attribute identifier Identifies attributes of an XML or XMLList object.
{ } braces (XML) Evaluates an expression that is used in an XML or XMLList initializer.
[ ] brackets (XML) Accesses a property or attribute of an XML or XMLList object.
+ concatenation (XMLList) Concatenates (combines) XML or XMLList values into an XMLList object.
+= concatenation assignment (XMLList) Assigns expression1, which is an XMLList object, the value of expression1 + expression2.
delete (XML) Deletes the XML elements or attributes specified by reference.
.. descendant accessor Navigates to descendant elements of an XML or XMLList object, or (combined with the @ operator) finds matching attributes of descendants.
. dot (XML) Navigates to child elements of an XML or XMLList object, or (combined with the @ operator) returns attributes of an XML or XMLList object.
( ) parentheses (XML) Evaluates an expression in an E4X XML construct.
< > XML literal tag delimiter Defines an XML tag in an XML literal.

Delete a node from XML / XMLListCollection

source

PROBLEM SUMMARY

simply using the Delete key work in Flex does not work most of the time and if you have a Tree that's bound to the XMLListCollection Flex will mess up the Tree Selection after deleting an XML element.
SOLUTION SUMMARY

Use a custom method to for loop and delete proper child and reset tree selection
EXPLANATION
__________________________________________________________________________________
Use this method:
private function xmlDeleteNode(xmlToDelete:XML):Boolean
{
var cn:XMLList = XMLList(xmlToDelete.parent()).children();

for ( var i:Number = 0 ; i < cn.length() ; i++ )
{
if ( cn[i] == xmlToDelete )
{
delete cn[i];
return true;
}
}

return false;

}

Also, remember to do on an XML Bound Tree Control:
myTree.selectedItem = null;
_______________________________________________________________________________

i have extended this logic
myTree.selectedItem = null;
after delete ... instead setting the selectedItem to null, it wud b gud
if you select the deleted node's parent
before calling the xmlDeleteNode method

save the xmlToDelete's parent
**************************************
var tmp:XML = xmlToDelete.parent();
xmlDeleteNode(xmlToDelete);
myTree.selectedItem = tmp

**************************************

Freelance