Running Flash in the Vista Sidebar!

We have been doing quite a bit of gadget work lately at frog. As an experiment, myself and Tim Wong, a Senior Visual Designer at frog, decided to create a frogblog RSS reader gadget. Since gadgets are essentially just HTML and JavaScript there is no reason that you can’t include other browser technologies such as Flash and Flex. In this gadget the Flash piece is handling all of the XML parsing and the actual list of news items. Since it is running locally there are no sandbox restrictions for reading in external XML which is nice. The arrows allow you smoothly scroll up and down through the items.

There are a couple of caveats when using Flash in the sidebar. To re-position sidebar gadgets you click and drag them to their new position. But when you click on the Flash area, Flash captures the mouse input so you can’t drag the gadget around. We worked around that by making the chrome of the gadget out of a transparent PNG which you can use for moving the gadget around. Another interesting bug is that when you first click on an item in the Flash movie it doesn’t trigger the onRelease event of the MovieClip. After that, clicking on items opens the browser to view the news items. If anyone knows why this might be happening please let me know!

Having Flash in the sidebar opens up a TON of possibilities for cool gadgets like MP3 players and system monitors. Stay tuned for more!

If you are running Vista you can download the gadget here. Just save the ZIP file to your hard drive, rename it so that it has .gadget as the file extension and double-click to install.

Lee

Comments

  1. February 22nd, 2007 | 4:38 pm

    Nice! I knew it had to be possible, thanks for sharing the info Lee. Also, quit showing off! :)

  2. lee
    February 22nd, 2007 | 4:44 pm

    Heh! All of the slick design work was done by Tim. I was just the technical grunt :-)

  3. February 22nd, 2007 | 4:45 pm

    The having to double click an item – could it be because the Flash object doesn’t receive focus automatically? Kinda like having to click a SWF in a browser before being able to interact with it using the keyboard.

  4. lee
    February 22nd, 2007 | 4:48 pm

    Well it’s strange because the rollovers on the items work immediately. But when you click the first time it just flashes and doesn’t trigger the event. I’m also using SWFObject to load the Flash piece.

  5. February 22nd, 2007 | 4:56 pm

    Thanks for the word… when you externalInterface out to the host, does anything interesting happen? Is there a host-to-Player communication API too?

    tx, jd/adobe

  6. lee
    February 22nd, 2007 | 5:02 pm

    There is a whole Javascript API that the gadgets can use to get information from the host computer. I haven’t tried delving into that yet but I’d like to make a cooler looking system monitor than the one provided from Microsoft.

  7. February 22nd, 2007 | 5:27 pm

    *wipes a tear*.

    My two favourite technolgies coming together ;) very purty.

    Scott Barnes
    Web Developer Evangelist
    Microsoft.

  8. February 22nd, 2007 | 10:07 pm

    I’ve been developing a Mac dashboard Widget and want to make available for windows users as well. Any tips on that?

  9. Baz
    February 22nd, 2007 | 10:32 pm

    The double clicking bug comes from the activation of the flash activeX like in IE but with the slidebar there is no top yellow bar.

    Rollover is not affected by it, it is only when you want to interact by clicking that you need it to confirm it once.
    This happens in IE even when you allow the activeX to run without waning.

    This is again how smart Microsoft does things.
    I really hope they will drop one day the confirmation popup/bar/click and learn what means being “User Friendly”.

  10. Erik
    February 23rd, 2007 | 12:46 am
  11. February 23rd, 2007 | 1:01 am

    Love the new header Lee. Way to finally get on top of your blog, while representing the new adobe icon with some style.

  12. February 23rd, 2007 | 3:29 am

    Een Flash/Flex Vista Gadget…

  13. February 23rd, 2007 | 3:31 pm

    [...] If you haven’t seen this, it’s worth checking out. Lee Brimlow of Frog Design has put together examples of a Flash widget and a Flex widget running as a gadget on the Windows Vista Sidebar. Gadgets are just mini HTML/Ajax applications so Lee included the Flash Player from the browser in the mix and viola, a Flash gadget for Vista. [...]

  14. Edward McIntyre
    February 23rd, 2007 | 4:50 pm

    First off, love the new header. Second, awesomeness! Third, you should make one that feeds all your blogs into one gadget.

  15. February 26th, 2007 | 10:06 pm

    Erik

    thanks for the link looks interesting!

  16. March 1st, 2007 | 8:55 am

    Looks great!

    First click is to activate the flash content, like Baz mentioned…
    I always use this http://blog.deconcept.com/swfobject/ to prevent this from happening, works great for html pages, dunno if you can use this in your gadget too?

  17. March 1st, 2007 | 11:57 pm

    [...] Running Flash in the Vista Sidebar [...]

  18. March 5th, 2007 | 5:14 am

    [...] Gadget i Flash [...]

  19. March 30th, 2007 | 7:00 am

    Hi,
    just to answer youre question about the missing events. We had the same issue with hosting WPF/Winform in the sidebar gadgets. Would you gess that it’s the transparent png causing the problem? It was in our case. Seems that the transparent background eats some of the events.
    JPK

  20. April 10th, 2007 | 11:22 am

    Hi there Lee,

    The problem lies in windows (2000/XP and Vista)
    You just have to replace the onRelease with onClick, since windows doesn’t know how to handle onRelease directly.

    PS: Reason I know this because i’m also making desktop apps with MDM Zinc (dunno if ya heard of it) and if i want a button to work directly from my standalone .exe i’d have to use this method. Check uit zinc at http://www.multidmedia.com.

  21. April 19th, 2007 | 3:35 am

    Hello,
    Flash widgets can also run on the deskbar. Desktop tools are generally enhanced by Flash. Programs like Deskbar Builder 2.0 create branded desktop toolbar and Flash widgets.
    Thanks.

  22. Clayton Wolff
    May 18th, 2007 | 7:48 am

    Whenever I use flash in html I always you fixit script to get rid of the first click problem. Below is how it works.

    1. Create .js file – Paste this code in text file

    theObjects = document.getElementsByTagName(“object”);
    for (var i = 0; i

  23. Clayton Wolff
    May 18th, 2007 | 7:51 am

    1. try again Create.js file – paste this code

    theObjects = document.getElementsByTagName(“object”);
    for (var i = 0; i

  24. May 21st, 2007 | 1:59 am

    Hi,

    In VISTA OS flash is not working fine, ( i am getting blank imgaes in the place of flash ). Can any one help me how to
    fix this bug.

    friendy,
    Jenni

  25. dan
    June 13th, 2007 | 7:08 am

    I’m having issues using ExternalInterface and the Vista Gadget. Has anyone had this issue? I get the “Object does not support this property or method…”

    When I run the page in IE everyting thing works fine.

    Thanks,

    Dan

  26. June 20th, 2007 | 6:40 pm

    I also cannot get ANY flash programs to work in live operation of the Vista OS. If the flash material allows to reload anyway via a link, it will load the flash – IE stattracker for yahoo sports. However, any flash on any webpage, or any seperate flash a la your clever gadget, will not allow the flash to process at all. I cannot find anything in the microsoft tech pages regarding this issue, there is nothing on the adobe site, and uninstalls / reinstalls don’t solve anything… And it’s driving me absolutely bonkers not being able to use flash or fully incorperate flash gadgets.
    Please help!

  27. nih
    July 5th, 2007 | 5:33 am

    I cannot seem to get flash-based sidebar gadgets working in Vista 64 either. These include the one from this page, the 12-hr world clock and 24-hr world clock.

    What gives?

  28. nih
    July 5th, 2007 | 5:38 am

    Aha! I found the solution buried in google.

    Quit out of the 64-bit version of Sidebar and navigate to Programs (x86)/Windows Sidebar/Sidebar.exe, and use this one instead.

    Suddenly everything starts working again.

    Bring on Flash Player 64!

  29. bs
    August 6th, 2007 | 11:54 pm

    I’m having intermitant issues. I’m using Timer to run a URLRequest on localhost. onLoad lights the gadget up, and ioError dims it. I’m also using ExternalInterface to launch/kill the web server if you click the Gadget.

    It worked well for a while, then I tried adding it to the Sidebar with a double-click. I couldn’t get the close button to come up and it was always dim. Restarted and had like 6 of them spawn. Killed them all and added 2 pixels padding to give it a border to more reliably trigger the close button & handle. Had it working again for a bit, then it started flashing bright/dim. I made the Timer longer and reopened it. Now it’s dim again.

    Grrr.

  30. August 14th, 2007 | 2:44 am

    Please give the link for how to make gadget application????

  31. January 2nd, 2008 | 1:26 am

    [...] Wer übrigens Microsofts Flashplayer-Konkurrenten Silverlight für die Erstellung von Sidebar-Gadgets einsetzen will, sollte sich mal den englischsprachigen Blog von Ben Hall ansehen. Aber auch Flash kann durchaus als Werkzeug benutzt werden, wie findige Programmierer auf theflashblog herausgefunden haben. Als Beispiel lässt sich dort ein RSS-Reader zur Webseite finden, der auch zum Download angeboten wird. Zwar stellt die Kreation von Sidebar-Gadgets mittels Flash noch ein Workaround dar, die Möglichkeiten, die sich dadurch bieten, sind aber auf jeden Fall äußerst interessant. [...]

  32. vbn
    March 3rd, 2008 | 3:52 am

    “But when you click on the Flash area, Flash captures the mouse input so you can’t drag the gadget around”

    I develop a SideBar gadget in Flex/Flash technology and I have the same issue. My Flash MouseDown.Event is not spread over the widget engine and I can’t drag and drop my gadget. Did someone find any solution to this issue?

    Thanks

  33. vbn
    March 26th, 2008 | 1:39 am

    I finally find a way to drag and drop my gadget in Vista SideBar.
    I put the wmode param of my flash object to the value “transparent” like this :

    If this could help somebody.

  34. Shantul
    May 21st, 2008 | 10:10 am

    Is the code for the widget still available? I get a 404 when I click on the link.

  35. Grape
    June 7th, 2008 | 6:37 pm

    So do I. Pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee fix link. kthxbai

  36. steve
    July 2nd, 2008 | 7:56 pm

    link still 404′ing guys. wondering if you could fix it or email it to me so i can take advantage of your great tool!

    thanks!

  37. keith
    July 5th, 2008 | 2:18 am

    Can someone fix the 404 link?

  38. jameal
    October 28th, 2008 | 12:42 pm

    Yeah link is broke :(

    Whenever I try to incorporate flash within my widgets, I get a red x. Anyone know a solution?

  39. jameal
    October 28th, 2008 | 12:49 pm

    okay, so I read some of the comments above and opened it up in 32-bit mode, and the flash works, but why do other widgets that use flash not have this same problem?

  40. Chris
    December 17th, 2008 | 5:11 am

    Can’t download. Gives a 404 still. Please Fix!

  41. milks
    March 11th, 2009 | 7:58 am

    404!!!! GET ON IT!!!

  42. Mike
    August 10th, 2009 | 5:28 am

    Gives 404. Please fix the problem. I am so looking forward to get flash objects on Vista sidebar and what I have googled, this is the only one.

  43. Austin
    November 30th, 2009 | 3:20 am

    D: 404 = bad. Please fix.

Leave a reply