FileReference updated in Macromedia Flash Player 9 beta 3

flash.net.FileReference class, in latest beta of Macromedia Flash Player 9, has been updated. Let's see the FileReference.upload(..) method signature.

public function upload(request:URLRequest,
uploadDataFieldName:String = "Filedata", testUpload:Boolean = false):void

Following are things, I noticed in the latest beta.

  • Custom data-field name, which was hard-coded(as FileData) in previous version of player. Now you can change it by using uploadDataFieldName parameter of upload method of FileReference.
  • You can now send HTTP/POST parameters with file-upload request. Previous version of player only allowed you to send HTTP/GET parameters. You can use first parameter request to send HTTP POST or GET parameters.

This means, I can now go ahead and complete my Flickr AS3 API. I was stuck, when I wanted to upload pictures to Flickr. Darron's Flickr AS3 library was also missing file-upload feature because of above mentioned limitation in previous versions of Flash Player 9 beta. I am sure, Darron must have updated Flickr AS3 library.

Phase of life

How does it feel when you have:

  • not written a single line of code in last twenty days
  • not been online for last five days
  • been very sick last few days
  • been thinking to relocate to another city within next one week
  • missed barcamp-bangalore talk and fun, for which you were so excited about and got involved in planning initially
  • started feeling that everything and everyone around you are changing?
  • not followed a single thread in any of mailing lists you have subscribed to
  • not imagined things which are happening with you now
  • feelings of uncertainty but full of hopes for future
  • started avoiding too much talking to avoid others making you feel bad about your decisions
  • started believing strongly actions speak louder than words

That's my state now. I don't exactly know how does it feel? I surely feel weaker, disconnected, lost, alone, lazy and what-not.
Is it because I have been ignoring my food and been on coffee and sandwich for almost last two months? Is it because I really need a break? But then reading a part of an email from a friend confuses me more, these words specially: Confucius said, "everyday is a holiday if you love what you do."
Anyways, I believe it's a phase of life. There is always learning so am I doing in this phase of life.

The journey begins

I am moving ahead in life to start a new journey. Where I want to do things I like. Probably, taking break for some months from work after that might start freelance development or join some startup. I would keep posting what I am doing, yeah you gotta bear me this time because posts might be totally non-techncial.
In simple words, today was my last day in Yahoo! I am moving out of Bangalore to stay with my parents or closer to them.

Legendary Kannada actor Rajkumar passed away

Legendary Kannada actor Rajkumar passed away due to cardiac arrest. It is, Indeed, a big loss to Indian film industry/community. May his soul rest in peace and I share my condolence to his family, friends and fans.

Onfolio is free now

Microsoft acquired Onfolio and now it comes free with Microsoft Windows Live Toolbar. I got an email from Onfolio that I can request refund since I bought Onfolio last year. Cool!

But I think, FireFox extension is not installed anymore. I guess, you can still use old extension as long as you don't uninstall it while removing old Onfolio version.

Macromedia(Adobe) online store sucks

I know it is harsh statement but I am so upset with Macromedia(Adobe)'s online store. I have been trying to buy FlashLite 2.0 from online store but no success. I sent an email to support guys, no reply in last two days. I tried calling toll-free Indian number, it's always busy, are they busy talking to their girlfriends all the time? I tried calling San Francisco number, no body picks-up.

WTF?

Following points upset me:-

  • India is not listed in Asia Pacific(APAC) store of macromedia.com
  • I can not buy things from other region-stores because they check for billing address of credit-card then why they are asking for CVV(three-digit-number). I can buy things from Amazon why not here?
  • There is no Paypal integration
  • Support sucks

Importantly, Why the hell, India is not listed in APAC store? How can they ignore India?

I mean, hundreds of developers, like me, would want to buy FlashLite but they can't for these reasons. I remember, many of my friends (FlashLite developers) kept asking me the ways to download FlashLite, when I was in macromedia. But I could never understand their problem, but today I can really understand how frustrated they must have been.

I just ask, why India is not listed in APAC store?

I spent three nights writing some cool application, bought the expensive Nokia N90 so that I can enjoy seeing my application working on it. But when I try to download the player nothing happens, I am really pissed off. I never said such harsh words in my life(to anyone) but I have to say here because of above reasons.

Hope, you guys understand how I am feeling now..

Update: I want to say more. We (flash)developers do evangelism(unofficially) about Flash/Flashlite in local lists, among non-macromedia developers. But what would be the impression or experience, if a J2ME guy wants to give a try to FlashLite and he is not able to download the player? He would probably drop the idea and might not raise the issue but would surely spread the bad word.
Also wanted to say that I loved Macromedia, love it and it would always be alive in my heart.

BarCamp Bangalore

BarCamp Bangalore is going to happen very soon in Bangalore. Dates are yet to be finalized but we are working on plans. I hope, very soon date, venue etc would be finalized.

We are infact meeting on this saturday(March 18th) in Barista (near Koshys), Near M.G Road, Bangalore at 4PM
You can check out the BarCampBangalore WIKI. Manish has created a Yahoo! groups mailing-list for discussion.

BarCamp in Chennai and Hyderabad is also happening next month. I am impressed the way, Chennai guys are planning for ideas and budgets etc.

I am planning to participate in BarCampChennai but once again not sure due to work schedule. But I would try my best....

How to get URL query-string variables within Flex application

On flexcoders, someone asked, how to get the URL parameters in a Flex 2.0 application? By URL parameter, I mean the query-string variables, as shown below:

http://yourserver/yourapp.swf?name=Joe&age=22 or http://yourserver/yourapp.mxml?name=Joe&age=22

Note: To get the variables in flex via mxml file, you need server-side compilation of mxml files.

You can get the values of the params using from

</p>

mx.core.Application.application.parameters

</code>

object, which contains the name-value pairs (hash-map).

For example,

</p>

mx.core.Application.application.parameters.name

</code>

would return "Joe", considering above example URL. You can find more information about this in livedocs: http://livedocs.macromedia.com/flex/20beta1/docs/00001300.html

Then someone asked, what if your swf is embedded in custom html wrapper, how to get the query-string params inside swf?

Most of us use ExternalInterface class in Macromedia Flash Player 8(onwards) to invoke some JavaScript functions and extract the value in ActionScript.

I wrote a quick-and-dirty class in ActionScript 3, which would get the values of params from URL query-string for you. You don't need any extra JavaScript code in HTML. The same logic can be used for any an ActionScript 2.0 running Macromedia Flash Player 8.
QueryString class has following properties:-

  • parameters - an Object which contains the name-value pairs from query-string
  • queryString- String, this contains the entire query-string (url-encoded) name-value pairs.
  • url- String, this returns the complete URL of the wrapper page with query-string.

See demo
Download source files

HTTP Authentication for HTTP/GET requests using ActionScript 3

I am working on ActionScript3 API for Bloglines services, which requires HTTP Authentication for its two of the services. I was not able to set the header of a HTTP/GET request. Macromedia Flash Player allows you set the header only for POST requests. I discussed this issues with Ted Patrick and he told me how I can us Socket to achieve the desired and he was very kind to give a me code-snippet, which got me started. Thanks Ted.

Finally, I could implement a class(HTTPURLLoader) which allows me to:

  • Add request-headers
  • Do HTTP Authentication for GET URLs
  • Handle HTTP status messages
  • Read the complete response header

It basically connects to a HTTP server on port 80(hardcoded for now) and sends an HTTP/1.0 request so that server closes the connection immediately after response. I could use HTTP/1.1 to keep connection alive and do things. But then closing connection would require some more logic, either a timeout logic if there is no activity on socket then close the connection, or find the end delimiter of response and then close. So I chose the easiest approach :)

I am still working on it and there is a lot(bugs-fixing, optimization, code-commenting, removing hardcoded stuff etc) to be done. I just wanted to share whatever I have done so far. I think, idea is more important than the implementation.
Anyways, I also implemented Base64 in AS3 and also OPML parser for Bloglines. I would soon upload the entire Bloglines AS3 API source.

Download the code:

View HTTPURLLoader Source and Example:

Yahoo! India launches a job search website

Yahoo! India has launched a job-search website. You can search jobs in India as well as international locations. It looks quite neat, clean and usable site. It allows you to see jobs available in different categories(finance, information-technology etc) as well as locations (cities, countries etc).
Link: http://web.careers.in.yahoo.com/index.html