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 ;)

Wednesday, March 22, 2006

About Adobe Flash Player 8.5

Just noticed, the new Flash player 8.5 beta that gets installed with Flex Builder 2 Beta 2 has the "About Macromedia Flash player x" replaced with "Adobe Flash player 8.5" string in the context menu.

I still remember seeing the "About Macromedia Flash player 5..." link in the Windows XP tour, way back in 2000. Thats how I first came to know about flash (that was pretty late, I know) Forget working for Macromedia Flash team, little did I know I would make a living with Flash then :p

The menu looks little thinner now. (with "Macromedia" being replaced by the smaller string "adobe")

The settings dialog title still reads "Macromedia Flash player settings" though!

Tuesday, March 21, 2006

LG licenses Flash lite and flash player SDK

Following the paths of Samsung, Nokia etc. LG has signed an agreement with Adobe for licensing Flash Lite and Flash Player SDK.

LG is one of the major mobile handsets as far as the Indian CDMA market is concerned. Hopefully we will get to see Flash enabled LG mobile phones soon.

Monday, March 20, 2006

Windows XP on Intel -Mac is ready!

Thick secret has an article about the windows XP boot available for Intel Macs - Exactly what many people would have been waiting for. How I wish I had a Intel Mac!!

The XP on mac project home page: http://onmac.net/
Download: http://download.onmac.net/

And they have a Wiki also put up here.

Wednesday, March 01, 2006

Microsoft Virtual Earth - MS's answer to Google Earth

Microsoft replies to Google Earth with its new feature they call 'interactive Street-side browsing' in the preview release of Virtual Earth. And I should say, they did that in Style!

Check out their weblog here.It was announced on Channel9 in this article.

Currently they have street images of Seattle and SF. Lucky that I had been to SF, I could 'drive' around on the streets that I know!!

Awesome stuff!

Friday, February 24, 2006

mouseWheel has issues when used with wMode=transparent

I've been facing a lot of issues with wmode='transparent'. (We needed it to be transparent because we had to show a java applet showing a 3D interactivity above the SWF in our app).

I have come across a few blog posts about the transparent setting for wmode making the input text fields appear without a I-beam mouse pointer in FF.

The recent one that I see is that when wmode = transparent, the scrollTarget being sent as the second parameter to the onMouseWheel event handler function is the path to a movieclip tats a few (about 50- 60 , i guess) pixels above / below the actual movieclip that the mouse is currently on. I tried turning off wmode and it works as expected.

I put together a test file to test this (I tested it out on both Flash 8 and MTASC) , and I see the same problem there.
Here is the test Class:

class App {
function App(ref) {
drawMe(ref);
var o:Object = new Object();
o.onMouseWheel = function(n:Number, s:String) {
ref.log.text += s+"\n";
}
Mouse.addListener(o);
}
static function main(ref) {
var o:App = new App(ref);
}
function drawMe(timelineRef) {
var w:Number = Stage.width;
var h:Number = Stage.height;
var bg_mc:MovieClip = timelineRef.createEmptyMovieClip("bg_mc", timelineRef.getNextHighestDepth());
var box_mc:MovieClip = timelineRef.createEmptyMovieClip("box_mc", timelineRef.getNextHighestDepth());
bg_mc.lineStyle(1, 0xFF0000, 100);
bg_mc.beginFill(0xFF0000, 100);
bg_mc.moveTo(0, 0);
bg_mc.lineTo(w, 0);
bg_mc.lineTo(w, h);
bg_mc.lineTo(0, h);
bg_mc.lineTo(0, 0);
box_mc._x = box_mc._y=100;
box_mc.lineStyle(1, 0x00FF00, 100);
box_mc.beginFill(0x00FF00, 100);
box_mc.moveTo(0, 0);
box_mc.lineTo(w/4, 0);
box_mc.lineTo(w/4, h/4);
box_mc.lineTo(0, h/4);
box_mc.lineTo(0, 0);
timelineRef.createTextField("log", timelineRef.getNextHighestDepth(), 0, 0, 200, 0);
timelineRef.log.autoSize = true;
}
}

And in my FLA, I have the following code:

App.main(this);

Does anybody else see this? is this a known issue? If it is,dDo we have a technote about all these known issues with wmode?

Workaround:

We developed (actually a collegue of mine wrote it all) a work around. As you might guess, we resorted back to hitTest. We have a onMouseWheel listener and when it triggers, we dont use the target that Flash player returns itself. Instead we do a hitTest with _xmouse and _ymouse and figure out the bounds. Though not a great solution, it solves the purpose. Am planning to think about doing something generic enough for this. Let me think!

Wednesday, February 15, 2006

Points to remember when using SSL + IE + Flash

(I got no time to write it in detail. Bear with me, please ;-))

Flash UI (built using AMES), Java for backend code (on Websphere app server), OpenAMF to communicate between Flash and Java. Thats the basic tech stack of the application that I am current working on.

We use SSL to send / receive sensitive information to / from the server. The development machines use Tomcat server instead of websphere. Things were fine until we tested the app with HTTPS on Websphere. Only on IE, the netConnection call returned with a "Call failed" error. Logs showed that the Java code was receiving calls and was returning the data, But the connection kept failing.everytime a HTTPS connection was made.

Thanks to Abdul Qabiz, who was quick to point me into sniffing the HTTPS headers being received. This tip off helped us narrow down our 'googling' and we figured out that there was an issue with IE and SSL that was causing this issue.

The following pages came to be of great help:
macromedia Technote
Microsoft Knowledge base:
http://support.microsoft.com/kb/323308/
http://support.microsoft.com/kb/815313/

and of course this post from Gary Matthew Rogers.

And the solution, we added the following line of code in Java before sending the response back to Flash:

HttpServeletResponseObj.setHeader("Cache-Control", "no-store");

That solved the problem!

Wednesday, February 01, 2006

Flex 2.0 Beta available at macromedia Labs!

Flex 2.0 beta is available to the public, at Macromedia(Adobe) labs. Click here to download the flex SDK,Flex Charting Components 2, Flex Enterprise Services 2, and Flash Player 8.5 (Alpha 3).

With this beta, You don't have to download the entire flex installers to install Flash Player 8.5. Installers (& uninstallers) for Flash player 8.5 (Win and Mac) are available as separate downloads!!

There are some really exciting offerings today from Adobe. As the press release goes "The Flex Framework will be made available free of charge through the Flex Software Development Kit, which will include the command line compiler and documentation required to develop, compile, and deploy Flex applications that connect to XML and SOAP web services with no additional charges or server licensing required. ...Flex Builder 2.0 will be sold for less than $1,000 ... Flex Enterprise Services 2.0 will be free of charge for use by a limited number of concurrent users on a single, non-clustered server. "

There has been a lot of talks in the open source community about what would happen post AS3.0 release, since the next revision of the currently available open source AS compiler MTASC isn't going to support AS3.0.With Flex 2.0's release, Developers will get a standalone AS3.0 compiler, straight from the source, for free!

Can't wait to get my download done ;-)