Silverlight app uses Flash to work :)

September 23, 2008

I installed google chrome some time back. I would reserve my comments about the browser for a different post, but the my favorite feature is the task manager. Today, someone forwarded me the Windows Ads campaigns page, primarily for the I am a PC campaign (which uses Flash video :) ).

I went to see the Bill Gates-Seinfeld campaign. You probably wont be able to see it as you don’t Silverlight or it is not supported for your browser/OS. Don’t bother installing, it is much easier to catch the videos on youTube (Shoe Circus | New Family).

Anyway, I was on the page and i see this…

Hmm.. Flash Player in a Silverlight page? I went on a right click spree and couldnt find it. Then i check out the embed tag on the video-bar and here’s what i get…

Is MS loading a SWF within Silverlight and conning people?? I decided to check it out. I embed the code into an html and ran it and i get this…

I still don’t know if my initial hypothesis was right, though the pre-loading suggests that the soapbox player is done in Flex. Next step was to check out the DOM to see where Flash was on the page. Thanks to Firebug, this was easy work. Here’s what I found (click the image to see a bigger version)

There is a div in the page called clipboardPlaceHolder. This contains a faceless swf that is used to access the system clipboard to copy the embed code into the system clipboard. I did some googling and found that Silverlight does a sloppy job with Clipboard access. There’s something in Silverlight that can access clipboard, but it only works on IE ;). Here’s the thread from the Silverlight forum.

Yes. This script doesn’t work in non-IE browsers.

Please read the following links if you wonder why it doesn’t work. .

* IE Clipboard Stealing

The best solution that I have so far is “Using Flash clipboard”. If you want to implement this in your Silverlight, you can get the swf file…

So much for the multi-browser claim. It seems to me that they are trying to show as if Silverlight has capabilities that it actually does not… What next?

Flash for Flex Developers I – Importing artwork from Flash CS3 into Flex

March 27, 2008

CSS support in Flex is something that lets you tidy up your vanilla UI in a very easy manner…. In Flex2, you could do this with the Flex Style Explorer. When Flex3 happened, we decided to add this into FlexBuilder using the new CSS Design View feature. This lets you do a whole lot of stuff, but what if you want a button that looks like this:

With Flash CS3 we have a method of exporting any artwork, which can then be used in your Flex application. Here are the steps to achieve this

Read the rest of this entry »

MovieStar released to the public…

December 4, 2007

Adobe today announced the immediate availability of Adobe® Flash® Player 9 Update 3, previously code named Moviestar. Adobe Flash Player 9 includes H.264 standard video support, the same standard deployed in Blu-Ray® and HD-DVD® high definition video players, and High Efficiency AAC (HE-AAC) audio capabilities.

The latest update also features hardware accelerated, multi-core enhanced, full-screen video playback for high-resolution viewing across major operating systems and browsers. The combination of Adobe Flash Player 9 and Adobe Flash Media Server 3 (also announced today) enables the delivery of HD quality video to the broadest online audience

Security in Flex – Demystified !

October 12, 2007

This is for people who are searching for places to get information on FlashPlayer/AIR Security and for guidelines on creating secure applications.

  1. This link will provide you an overview of Flash Player Security with details on the Flash Player APIs for the same
  2. This link talks of AIR Security and of the additional sandboxes in AIR and how to work with them
  3. A really informative presentation done by Deneb Meketa at MAX2007
  4. Lucas Adamski’s Blog – State of Security

The above links should give you a good idea about security with AIR & Flex and how to create applications that leverage them.

The Architecture of Flash from the horse’s mouth

April 26, 2007

A continuation from the last post, this is again from PodTech. Here Ely Greenfield (Flex Architect), David Wadhwani (Vice President of Flex Product Line), and Mike Chambers (Senior Product Manager, Developer Relations), gives us an inside on Flash’s architecture and gives further details about what is being open sourced.

[podtech content=]

(or you can download it here)

Error on adding FullScreenListener in creationComplete handler

March 6, 2007

This is an issue i hit upon while i was doing the Full Screen App (you can see it here). I wanted to add a listener to listen for the FullScreenEvent (package in my Application. So i put that onto my creationComplete handler on the Application, i.e.

mx:Application xmlns:mx=”” width=”100%” height=”100%” creationComplete=”initStuff()”


private function initStuff():void{
stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreen);

But, this threw a real time error (RTE) saying…

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at JustFullScreen/::initStuff()
at JustFullScreen/_Application1_creationComplete()

The above error means that the “stage” object is null when it is trying to set the listener. What perplexes me is that if i put this addListener code in a later part of the application, it works. Which means that the stage is getting intitialized between the Application’s creationComplete and the place in the code where i’m calling it. Is this a bug or does the stage get initialized later, dispatching a different event? I’m still digging.

Addendum (half hour later): I observed now that including the SystemManager class (mx.managers.SystemManager) and then using the following code in the creationComplete handler works.

import mx.managers.SystemManager;

private function initStuff():void{
FullScreenEvent.FULL_SCREEN, handleFullScreen);

So why is the systemManager object required if it is in the creationComplete handler and not if it is in a later part of the code… I’m confused now!!! Gotta tread back to the Flex Gurus :)
The code is here…

Addendum again (the next day)Thanks Joan for the info. Thanks to her, i found the solution for the above problem…

It seems that the stage is available only after the updateComplete or applicationComplete Events. Read the post that demystified things for me…

My Full Screen Video App – Ver 1.0

March 6, 2007

I wrote about full screen support in flash, a long time back in Nov ’06 (see that post here). I have been planning to write one myself. So finally i got myself down to write it. Before i put you through the app, some details on the API.

To make your application have a fullscreen support you need to do the following things.

1) Have the latest Flash Player (get it here)

2) Use the new Full Screen API
import flash.display.StageDisplayState into your Application and set the displayState of the stage. I have the following function toggling the FullScreen feature. “fsChk” is a CheckBox, based on which I’m toggling the functionality

private function toggleFullScreen():void{

stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreen);

if(fsChk.selected) {
stage.displayState = StageDisplayState.FULL_SCREEN}
else {
stage.displayState = StageDisplayState.NORMAL}


3) Update the html-template in which you have the flash App

In the object & embed parts of the html code of the page in which the flash app is inserted, you need to add a new parameter allowFullScreen to true. You can refer the source of the app and view the html for details.

If you want to know more about this feature, refer the Adobe DevCenter article on the same or view the PDF that i have created, collating all that information.

Now the Application. This is just a small video player which can go full screen by checking a Flex CheckBox. This is written in Flex2.0 and you can find all the source files here

Click here to view the Application
(confirm that you have the latest Flash player)

P.S – I have muted the video to start with, un-mute it if it pleases you :)

Update March 07 2008: A lot of people have complained that they got a security error when they tried using the code above. Here is a post articulating the problem and the solution.


Get every new post delivered to your Inbox.