XPath example
April 23, 2008
I have used XPath before, recently when I needed I forgot the syntax, so thought of keep it written here. It may come helpful for some others as well
import mx.xpath.XPathAPI;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.load(”http://api.flickr.com/services/feeds/photos_public.gne?id=67845814@N00&lang=en-us&format=rss_200″);
xml.onLoad = function()
{
var thumbs:Array = XPathAPI.selectNodeList(this.firstChild, “/rss/channel/item/media:thumbnail”);
for(var i in thumbs)
{
trace(thumbs[i].attributes.url);
}
}
This tutorial was a great help.
http://tutorials.lastashero.com/2005/10/using_the_xpath_api_in_flash.html
Smoothing image loaded in Flash
March 11, 2008
In our company we have been working on t-shirt customization tool for long time. Here people can upload their own picture and it is placed on t-shirt. They can rotate, resize, move and many other features. Infact all features t-shirt tools now-a-days offer.
Normally the image gets pixelated like normal html. So, whether the image is bigger or smaller always it’s little crippled. One of our client asked to make it smoother. Then I found Flash supports bitmap smoothing. After working on the code, I have made a small code snippet which will make any movieclip loading smooth image.
Just paste in the movieclip actionscript
onClipEvent(load)
{
if(this.getBytesLoaded()>100)
{
import flash.display.*;
var bitmap:BitmapData = new BitmapData(_width,_height);
bitmap.draw(this);
this._quality = “BEST”;
this.attachBitmap(bitmap,1,”auto”,true);
}
}
Interesting, huh?
Key.isDown unavailable in AS3
February 26, 2008
Unlike AS2 developers can’t use Key.isDown in AS3. But, while you are making a game like racing or people moving you must work with two/three key press which can’t be achieved without Key.isDown.
I was facing the same problem when one of my dev Zeeshan was working with car racing game. So, went for some Googling and found this http://www.kirupa.com/forum/showthread.php?p=2098269 Thanks Guru for the beautiful class.
WAMP time zone problem
February 26, 2008
WAMP doesn’t configure time zone as Apache default installation will do. So, by default it takes GMT 0. If the server is located somewhere else make sure to set the time zone. The list of time zones available here
http://www.php.net/manual/en/timezones.php
This caused me quite pain for 2 hrs today and searching with WAMP time zone problem I didn’t find anything so thought people may need
3 Joomla sites uploaded in 10 mins
December 31, 2007
It has been long since I have written something. Recently have been going through some interesting experience. Thought why not add this up. At least it would help me to remember
Today we had a situation that we needed to upload 3 Joomla sites. Now, as you know Joomla has around 1800 files. So, it’s around 5400 files. Yesterday we tried to upload and it didn’t for while day!
So, today thought why not try some zip/unzip. So, I just zipped to tgz and then uploaded (around 7 mins) and unzipped using shell command.
gzip -d ar_ny.tgz
made it ar_ny.tar
tar -xf ar_ny.tar
made it extract to ar_ny. I believe there is more short methods, I’m totally new to shell. But, at least now it does in 10 mins
Happy shelling everybody!
They Write the Right Stuff - interesting article about software writing for shuttle
January 25, 2007
http://www.fastcompany.com/online/06/writestuff.html
Today I found this interesting old article about software writing. How people write software for shuttle and how seriously bug free it has to be. Here Charles Fishman shortlisted some healthy habits of software writing as well.
Some icons collections
January 21, 2007
I needed some icons and I found that I forgot some sites that I liked earlier. So, for me (and anybody if needed) I recollected some list of icons from my friends at Pageflakes.
http://tango.freedesktop.org/Tango_Desktop_Project
I hope it will help some of my friends here.
53 Css Techniques
January 19, 2007
Today morning I got a great link from Omar Al Zabir of Pageflakes
http://www.smashingmagazine.com/2007/01/19/53-css-techniques-you-couldn’t-live-without/
Amazing, isn’t it! I hope it will help many of you.
Amazing multitouch screen in you tube
January 16, 2007
I wish I had something like this sometime ![]()
Today Great Amit bhai from Pageflakes gave a link http://www.metacafe.com/watch/333720/lightning_fast_browsing_trick_for_internet_explorer_and_firefox/ (Thanks bhaiya). So I went to visit the link and found, in FF the default maximum connection to a server is given as 4 and same in IE. But, for me, I found it is for IE7 set to 10 already. I noticed earlier that IE7 is faster than FF2 and I was little bit worried because I’m used to FF. Now I found the reason. IE7 probably configures it self seeing that the PC has a better connection.