2010
01.28

The i-pad

So now im sure if you are reading this, you probably know that the ipad has launched. What are my views on it? It’s just a larger ipod touch. That’s it. Nothing fancy. I maybe wrong but let’s see if Steve Jobs can convince you.

BLEH! At least its not crazily priced.

2010
01.21

I thought today I would post something about Bitmap and Bitmap Data in AS3.

Bitmap is a display object which wraps the BitmapData within it. The BitmapData is the array of data used to form the pixels in the image. Now a point to note here is that you can’t use use the BitmapData of one state of a movieclip and expect it to gather all the frames. What it does is it takes a photograph sort of and gets its pixel data value.

Ok so all this may seem like a lot of text. Let’s just jump into flash and figure this out. Let’s start by creating a movie clip with a text field inside of it.

sample copyGive this movieclip an instance name of mc and hit f9 to get into the actionscript panel.

Now we begin by declaring our variables and defining their properties.

var newBitmap : Bitmap;
var bd:BitmapData=new BitmapData(mc.width,mc.height,true,0×000)
the parameters we pass in when constructing a BitmapData are:
1) width- compulsory
2) height -compulsory
3) alpha
4) fill colour
We now proceed  to tell the bitmap what data to copy and then to tell the bitmap which bitmapdata it should be wrapping.
bd.draw(mc)
newBitmap = new Bitmap(bd);
we turn on smoothing for the bitmap (this is quite processor heavy for complex images but for this illustration I would like it)
newBitmap.smoothing=true;
finally we add it to the display list
addChild(newBitmap);
lets compile and check it out

So now obviously we have a new display object called newBitmap. This has the display object properties and methods attached to it.
But there is one drawback of using the Bitmap to copy movieclips you already have drawn out or text or whatever.
Here it is. The image you have just created is indeed a Bitmap. If you scale it or whatever, the image is going to be pixelated. Comparing it to vector graphics or the text you just copied, there is a noticeable difference in quality.

There are of course uses of this to create objects which wont ever scale. I think its really handy. Besides, this is just the first step in many more things you can do with the bitmapdata. I will try and post more about it. It is truly an amazing class. I am going to try and have another post about this in the near future.

Download the source here Bitmap-Data example

2009
11.20

Iphone with Flash apps?

Soon, flash developers will be able to develop iphone apps which can run natively on the iphone without

flapple

any browser call. This means that no wrapper like flash plugin or air plugin will be required.

Only Actionscript 3 based content is supported when developing content for the iphone. AS1 and 2 are not supported and there are no plans to make them work. Also as as there is no a flash interpreter or plugin that will be reading the iphone app, an externally loaded swf should not and cannot have any actionscript. Any actionscript will be ignored as there is no virtual machine to interpret the code.

We can take advantage of almost all as3 – flashplayer 10 apis and native iphone apis which include,

  • Multitouch
  • Screen orientation
  • Saving images to photo library
  • Accelerometer
  • Geo-location
  • Cut / copy / paste

We cannot take advantage or use the dock tray. Usage of 3 fonts, Helvetica, Times new roman and Courier New are all we have.

Ok to get all this going you will need

Flash Professional CS5 ( beta to be released later this year) for the development. Obviously with AS3 knowledge and if you have some experience on how to optimise your flash for mobile phone experience, it would be great!

Iphone developer subscription, for the testing and deploying.

Here is a reference link about the announcement at MAX2009

http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/

Please excuse me if I am wrong for any of the above.

2009
09.28

DKNY Be Delicious

DKNY BE DELICIOUS ART
*No purchase required
End date : 30th September

Prizes:
100 DKNY Be Delicious Art Body Lotions

Blah Blah:
Just submit your details for a chance to get DKNY Be Delicious Art Body Lotions. There are 100 pcs to be won so start submitting the names of all your family members now! :) hehe..no games, not at all difficult.

My take on it
Why not just submit your particulars and try to win something in the process. Not like you don’t have some bank agents calling you to sign up for insurance anyway.

2009
09.28

https://www.webawards.gov.sg/Singapore Government Web Excellence Awards

*No purchase required
End date : 31st October

Prizes:
100winners of $100vouchers

Blah Blah:
Singapore government websites are up for you to rank right now!
Here you have a list of 66 websites set up to assist Singaporeans in various methods from Tax to Sex.

Voters can vote for their favorite websites for three award categories as follows:

  • Most User-friendly
  • Best Content
  • Top e-Service

Be sure to vote as many times as you want as there are no limits to the number of votes you can place. But I am unsure if each vote is 1 entry.

My take on it
Spend sometime on it. The rules are long but easy to read and understand. I didn’t bother to go through the entire list. I think I just voted for my favourite sites and left. Did not bother spending much time on it.

2009
09.28

Recently and a long time back, sometime in December 08 to be exact, I had the rare challenge of making HTTPS calls from a swf which did not sit on the same server. I faced quite a bunch of problems and I still do. But I do have some solutions which I have found on the internet from reliable sources, though not tried and tested, which may solve your issues should you come across this situation at any time.

The “allow-access-from” has an attribute called secure which very few people use.

Adobe says : 

secure
[HTTPS and Sockets only, optional] When false, allows an HTTPS policy file to grant access to a request coming from an HTTP source. The default for URL policy files is true, providing only HTTPS sources permission. Using false is not recommended. Socket policy files use a default of false.

So a sample would be

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>
	<allow-access-from domain="*.somedomain.com" secure="false"/>
</cross-domain-policy>

The second option which I believe will never give you any problems is using a proxy. This works even when you cannot get a crossdomain file onto the server you are feeding from.

A sample PHP Proxy is as follows:

<?php
$dataURL = "http://www.sowebme.com/murtaza/feed/";
//note that this does not follow redirects.
readfile($dataURL);
?>

2009
09.24

Club snap competition Club snap contest info page

*No purchase required
End date : 15th October

Prizes:
First Prize: Seagate 2 Terabyte (2000GB) FreeAgent™ Desk Drive
5 runner up: Seagate 320GB FreeAgent™ Go Drive with Dock and Case.

Blah Blah:
The competition seeks to capture the ‘Spirit’ of the race in Singapore – not just the race itself but the excitement and activities around Singapore. We are looking for photos that show how the event has captured the hearts and the imagination of Singaporeans. Whether its street celebrations, race day parties, the preparations, corporate functions, or just people out and about enjoying the excitement – it’s all about capturing the unique qualities Singapore brings to this international event.

My take on it:
Worth a try. If you are good at it, do it and win yourself some great prizes along the way.

2009
09.22

This year the Topiwalla gathering was held at my place during Eid this year. It was a mad rush getting everything organised and prepared. But in the end it all paid off.  Hope all of you who attended had a great time with all the food and kids running around. Ok enough talk here are the pics and videos of the event :)

Eid Milan 1430

Eid Milan 1430

2009
09.21

F1 Rocks Singapore with LG ContestI can’t find any website association.
*No purchase required
End date:22nd September 2009

Prizes:
4 tickets to F1 Rocks on 25th Sep Friday (x30 winners)

Blah Blah:
Qn: Which band did Gwen Stefani perform with before she went solo?
Ans:
(A) No Doubt
(B) Destiny’s Child
Hint : It’s no doubt an easy answer :)

SMS: STF1Rocks[space]Answer[space]NRIC[space]Name
Eg: STF1Rocks A S8765432B Mark Soh

Send your SMS to 77877

Each SMS costs 20 cents.

2009
08.28

I would like to wish one and all Ramadan Mubarak, wishing that this year, fasting won’t be too difficult. Regardless, its mandatory and should be taken as both a form of health and spiritual cleansing.

Often, I’ve been reminded that now, with a kid, I need to watch what I say. Vulgar, obscene words still can be heard coming out from my mouth. I do feel ashamed when I say it in the presence of my son but I can’t help it, now with Ramadan, I am forced to practice refraining from these things.
You see, its not just about fasting, its about spiritual cleansing too. Not thinking about things that are not morally right, not saying things to hurt others, you know that sort of thing.

Other than that, its a health benefit too. As my colleagues and some of my friends remind me its like a super-detox.

So to all those fasting, good luck, well wishes and may Allah help you in every step of the way.