Wednesday, January 26, 2005
|
Update.Arul's Blog: Quick Blog Viewer version 3.0 released.
I'm very happy to launch Quick Blog Viewer version 3.0, It is Mail Client kind of interface for my blog.
It is also a show case of what we can do in flash using XML, localSharedObject, Flash MX 04 Components, and CellRenderer API. Have a look and Kindly pass on your comments.
posted by Arul
| link
| ^top
| next> |
add comment |
Wednesday, January 26, 2005
|
Demo.Flash MX: New RIA Interface for my blog.
Quick Blog Viewer v3 is a Flash based RIA for my blog. Now you can keep track of the posts easily, find out what is new since your last visit, flag your favorite posts.
It's interface should explain how. Check it out at http://www.shockwave-india.com/blog/quickview/
Don't forget to right click on the grid after selecting something ;)
posted by Arul
| link
|<prev. | ^top
| next> |
comments [1] |
Monday, January 24, 2005
|
Examples.Flash MX: XML and V2 Tree Example 2: Open/Close All.
Lets enhance the last example by adding two buttons to open and close all tree nodes
Add the following code to the first frame
function openOrCloseAll (x, open:Boolean) {
if (tree.getIsBranch (x)) {
tree.setIsOpen (x, open, false, false);
}
for (var i = 0; i < x.childNodes.length; i++) {
if (x.childNodes[i].nodeType == 1) {
arguments.callee (x.childNodes[i], open);
}
}
return x;
}
Add two push button (v2) components to the document and label them "Open All" and "Close All"
write the following code for "Open All" button
on (click) {
_parent.openOrCloseAll (_parent.sample_xml.firstChild, true);
}
write the following code for "Close All" button
on (click) {
_parent.openOrCloseAll (_parent.sample_xml.firstChild, false);
}
It is very important to pass the firstChild instead of the xml itself for "Close All" otherwise tree root node itself will be closed (there will be no visible tree nodes)
posted by Arul
| link
|<prev. | ^top
| next> |
add comment |
Thursday, January 20, 2005
|
Examples.Flash MX: XML and V2 Tree Example 1.
Rendering XML using Tree component is very simple, because in Flash MX 2004, V2 Tree component is based on XML.
Lets explore the possible ways to visualize sample.xml in the coming examples.
Create a new document in Flash MX 04, drag and drop a tree component and name it as "tree"
Write the following code in the first frame
import mx.controls.Tree;
var tree:Tree;
var sample_xml:XML = new XML();
sample_xml.ignoreWhite = true;
sample_xml.onLoad = function(done) {
if (done) {
tree.dataProvider = this;
}
};
sample_xml.load('sample.xml');
This will result in something similar to the following image
What is wrong here? By default tree component looks for the label attribute to display the nodes. Since it is not present in the given xml it renders this junk text.
Lets fix this by placing a simple label function as shown below
import mx.controls.Tree;
var tree:Tree;
tree.labelFunction = function(node) {
return node.nodeType == 1 ? node.nodeName : node.nodeValue;
};
var sample_xml:XML = new XML();
sample_xml.ignoreWhite = true;
sample_xml.onLoad = function(done) {
if (done) {
tree.dataProvider = this;
}
};
sample_xml.load('sample.xml');
here is the resulting tree
posted by Arul
| link
|<prev. | ^top
| next> |
comments [1] |
footnote:-
Also check the recent entries
and feel free to add your comments. I need your comments to improve this blog
|