2009
07.22

Hello people, I would really appreciate it if you could click through this link and click on like as the person with the most votes can win a trip to Switzerland.

http://www.facebook.com/video/video.php?v=103494827650&oid=85632499431

People who vote for me will be rewarded too :)

Thanks!

2009
07.17
Flickr logo

Hello everyone,

Its time to talk about and its API, how to use it and things associated with it. This is going to be the first of a series of blogs of how to use flickr and its API.

In this first post, we are going to talk about the API Key and its uses. We will also get our minds ready to use these values in our flash application.

First of all lets start with the flickr.com apply an API Key site. http://www.flickr.com/services/api/keys/apply/

Applying for an API key is relatively simple and no guidance is required. A commercial key takes about 4 weeks and requires some form of approval. A testing or non commercial key can be obtained immediately. I recommend you apply for both together to make sure you have a commercial key when your site is ready to go live. If its commercial anyway.

API Key example image

Once you have got an API Key and secret, you can actually start to use them to get frobs. You might be wondering what the hell a frob is but actually it seems to me like nothing more than a first level security key that flickr wants to assign to you at every instance of your api key call. Frobs expire after 60 minutes.
An example of a frob can be found here http://www.flickr.com/services/api/explore/?method=flickr.auth.getFrob These API testing tools are just neat.

Alright once you have got your frob, you need to get a token. If I am correct on this frobs are basically whats needed for just viewing photos, but if you need to upload or modify photos, you need a token. Tokens are like level 2 security keys that flickr has implemented to ensure that you aren’t just logging in without authenticating yourself via a valid frob. Tokens last forever or until you decide to revoke them at your access page. You are going to need a workaround for this forĀ  your flash to keep your user at your site. OR you can just use a preattained token which is what I decided to do for my project.

In my next Flickr tutorial, I will talk about how to integrate flickr api and flash and some basic examples and commands.

See you next time.

2009
07.14

Hello, today I was wondering what the super keyword in AS3 did while they were used in classes. Initially it seemed like it was the constructor for the base class. However after exploring a bit deeper, I realised that there was more to super than it seemed.

So here is a scenario.

ChildClass.as extends ParentClass.as which requires a string in its constructor.
SO, in this case a super is required from ChildClass to pass in the string value that its base class requires. This is extremely important during events and is really apparent then. I will explain how to use, and manipulate events to your advantage in some other post.

Getting back to super, I also found out, not like its some great accomplishment, that you can run other items from parent, just so long as it does not conflict with the required parameters. So in the above scenario, ChildClass.as can run some other independent functions BEFORE running the super. So what you may ask. But this means you can actually append and modify the value of the super from its parent before you pass the super into the parent. IE, say for example your ParentClass wants to always add ” good bye” to the end of the string to be passed into its constructor, you could have a function that returns that value to your child and then from your child pass it to the constructor. Yeah, I am lost in my own post too!

Luckily, I found a person who made some kind of really really great example. I don’t remember who it was though, as I was searching all over for an example. If you are the owner please contact me for your credits here. Meanwhile, you guys can download the modified super example here.

Download link for super example

Feel free to leave any comments and ask anything you want here.

2009
07.13

After the tiring morning at Bedok Reservoir Park with the CC and some ministers, there was another Community Center event. This time it was at the center itself. FRUIT FEST! This is when residents of Joo Chiat get free flow of tropical fruits to eat to their hearts content. All for free. That’s right, we had durians, lychees, rambutans, pears, bananas, mangosteens and a whole lot more for FREE. Only catch, no taking home and you must eat what you ask for. Residents, volunteers and the minister guest of honour, Mr Chan Soo Sen, were all elated and I guess you guys must be wondering what it was like so here are some pics.

Mustansir enjoys durians! Mr Chan Soo Sen Fruit fest 1 Mustansir having a drink 1 Mustansir having a drink 2

2009
07.12

Today my father and I woke up early to be at Bedok Reservoir Park at 6am to volunteer for the Sports day carnival organised by the CC, too tired to write the rest of the blog now, but feel free to see the pics.

DSC00028 DSC00026 DSC00024 DSC00023 DSC00022

2009
07.10

Home 2009

Hey guys,
my colleague at work just showed me this really really massively long video at youtube with excellent quality video. The only thing I think that makes the video seem bad is the fact that it is jerky after every few moments. But I’m telling you the download is really worth it.
Watch it here below in a lower quality or go to the real deal HD version http://www.youtube.com/watch?v=jqxENMKaeCU

It’s about the Saving Gaia kind of thing that people are so into these days. Its not that I am not personally into it. I just feel that talk is cheap. People should actually start doing things before they start talking about it. There are people who are really starting to take action against pollution and take the effort to drive things towards the green way. Like for example the link below :

http://www.pushbikeparking.com/

2009
07.09

Well there are many instances when we need to pass flashVars from the html to a preloader and then on to a loaded movieClip.

This is how I’ve done it.

HTML –

<param name=”FlashVars” value=”baseURL=http://www.sowebme.com/murtaza” />
For AC_RunActiveContent.js users, There should be 3 instances where you would place this
For swfObject users, there will be only once.

Flash –
holder mc will get the paramets from FlashVars in stage.loaderInfo.parameters.whatevernameditemhere

But a more robust way to ensure you have it and that you’ve not jumped the gun, use an event to ensure its ready.
An example is as follows:

root.loaderInfo.addEventListener(Event.COMPLETE, func);
var parameters:Object=new Object();
function func(e:Event):void {
//Do what you want here
}

Now to load another swf we will be using it to append to the current url we are already loading. So the above code will now look like

root.loaderInfo.addEventListener(Event.COMPLETE, func);
var parameters:Object=new Object();
var loader:Loader=new Loader();
function func(e:Event):void {
loader.load(new URLRequest(“loadme.swf?baseURL=”+root.loaderInfo.parameters.baseURL));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
addChild(loader);
}

function swfLoaded(e:Event):void {
//More code here
}

So that about sums up how you can use flashVars and pass them along. Note one thing though. If you are using classes, you can use stage.loaderInfo instead of root.loaderInfo

You can download the source file for passing flash vars

Have fun and please post your comments!

2009
07.09

Hey,
In this first tutorial today we are going to talk about how to use javascript to open a new browser window from flash.
The code that is required is fairly simple actually.

var request:String =
“javascript: window.open(‘http://www.sowebme.com/murtaza’,'win’,'height=400,width=600,toolbar=no,scrollbars=yes’); void(0)”;

var url:URLRequest = new URLRequest(request);

navigateToURL(url, “_self”);

Within your HTML housing the flash, you are going to need the parameter “AllowScriptAccess” set to “always”.

Feel free to download the working files here:
New Window Example