September 18, 2008
The below code debugs the capabilities of system, might be useful for debugging. Check the output here.
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”horizontal”
initialize=”init()”>
<mx:Script>
<![CDATA[
import flash.system.Capabilities;
import mx.utils.ObjectUtil;
private function init() : void
{
var _capObj:Array = new Array();
capability.dataProvider = objectToArray(Capabilities);
}
private function objectToArray(cap:Class) : Array
{
var capObj:Object = ObjectUtil.getClassInfo(cap);
var _capArr:Array = new Array();
for each (var _capPropObj:Object in capObj.properties)
{
if (_capPropObj.localName != "prototype")
{
var capProp:Object = new Object();
capProp.Capability = _capPropObj.localName;
capProp.Value =Capabilities[capProp.Capability]
_capArr.push(capProp);
}
}
return _capArr;
}
]]>
</mx:Script>
<mx:DataGrid id=”capability” width=”100%” height=”100%” />
</mx:Application>
Leave a Comment » |
Flex | Tagged: array, as3, capabilities, capability, conversion, debug, Flex, object, object to array, system, System.capabilities, to, util |
Permalink
Posted by nsdevaraj
September 17, 2008
Check the demo for data filtering xml output with LOGICAL AND, updating the Datagrid dynamically.
The source is available over here. It uses data filter component developed by Jack Herrington.
Leave a Comment » |
Flex | Tagged: and, array, as3, conversion, data, datafilter, datagrid, filter, Flex, Logical, sort, XML, xml to array |
Permalink
Posted by nsdevaraj
August 21, 2008
1. Declare types for all variables, parameters, and return values.
2. Declarations with no access specifier now default to package internal, not public.
3. Classes are sealed by default, meaning properties cannot be added dynamically at runtime.
4. Use package declarations to put a class definition into a package.
5. Import classes, even if references to the class are fully qualified.
6. Always mark method overrides. Declare return types in your functions.
7. Delegates are now built into the language, making event dispatching easier.
8. De referencing a null or undefined reference will throw an exception.
9. For debugging use the -verbose-stacktraces and -debug options.
10. Explicitly declare properties to be bindable.
11. Flash Player API has been reorganized into packages.
12. Use the new Timer class instead of setInterval/setTimeout.
13. Be sure to subclass events.
14. Visual elements must extend DisplayObject, and define them like any other class.
15. E4X (ECMAScript for XML) is used for manipulating XML.use toXMLString() method when using E4X.
16. for…in loop will not enumerate properties and methods declared by a class.
Leave a Comment » |
Flex | Tagged: as2, as3, conversion, convert, Flex, guide, migration, steps |
Permalink
Posted by nsdevaraj