Tuesday, April 11, 2006

wmode = transparent in FF plugin - its Key.isDown() this time!

Had there never been transparent windowless mode (wmode), I wouldn’t have proposed a solution using it, to my team. And it wouldn’t have fired back on me now.

As I had mentioned in a previous post I had problems with wmode onMouseWheel event. Finally we ended up with a workaround for this, using our good old hitTest method. Not a great work around, but solved our purpose.

Today pick is the Key.isDown method. With wmode=”transparent”, Key.isDown always returns false even when the corresponding key is pressed.

Try this:

Reproduction steps:

  1. Create a movie with a text field on stage( give it a instance name “log”).
  2. Draw some shape. Make it a button. On that button have the following code:


on (keyPress "")

{

_root.log.text += "\nShift is pressed : " + Key.isDown(Key.SHIFT);

}

  1. Now publish this FLA to SWF and HTML. Open the html file in FF and IE
  2. Try pressing SHIFT + TAB
  3. Verify Result 1.
  4. Now open the FLA and set wmode to “transparent windowless” and then publish
  5. Refresh the pages in IE and FF.
  6. Try pressing SHIFT + TAB
  7. Verify Result 2.

Actual Results:

  1. You’ll see both the browser pages trace Shift is pressed :true
  2. FF traces Shift is pressed :false and IE traces Shift is pressed :true

Expected results:

Both IE and FF should trace Shift is pressed :true at step 8.

Bad bad bad bad bad bad bad bad (read it like how Mallory says ;o) )

Work around: ( I hate this part)

Make a keyListener object in the root level(or anywhere you need it) of ur SWF and onKeyDown check if SHIFT is pressed and toggle a variable to true. on KeyUp, toggle it back to false. And everytime u want to do a Key.isDown (Key.SHIFT), check ur variable instead.

Doh!

Sunday, April 02, 2006

China Buys Google - Oh man, Did I just get fooled??

It just isn't making much sense in Google being bought over by China's ministry of Info.. And when I read the article again, Every other detail seems to be wierdly made up! And worst of all, its still April 1st out there!!!

Pranks by Google on previous April Fool's days just struck me now!!!

If its a april fool's game, they seem to have planned it great - I read that on theregistrar's site and I found the link in scobleizer's blog, and there are other 'breaking news' as well!

I tried reading the 'breaking news' posts as well, but am not able read thru.. Probably I should get back to sleep!

Doh!

But hey, it isnt a far game after all.. Its April 2nd here already :D

China Buys Google

Its 4 AM here in Bangalore, I was still struggling to sleep, so woke up to check on whats happening with the world :) - And I reached this: http://www.theregister.co.uk/2006/04/01/china_buys_google/

There seem to be many other interesting things happening around. I was just going through Eddie Awad's compilation of breaking news. Woah! Just enough to keep me awake over the rest of the night ;)