Archive for July, 2009

flash 10 security issue filereference workaround example

Upload and download require user interaction
In Flash Player 9, ActionScript could perform uploads and downloads at
any time. With Flash Player 10, the FileReference.browse and
FileReference.download operations may be initiated only through
ActionScript that originates from user interaction. This includes
actions such as clicking the mouse or pressing the keyboard.
What is impacted?
This change can potentially affect any SWF file that makes use of
Filereference.browse or FileReference.download. This change affects
SWF files of all versions played in Flash Player 10 beta and later.
This change affects all non-app content in Adobe AIR (however, AIR app
content itself is unaffected).
What do I need to do?
Any existing content that invokes a browse dialog box using
Filereference.browse or FileReference.download outside of an event
triggered by user interaction will need to be updated. The dialog box
will now have to be invoked through a button, keyboard shortcut, or
some other event initiated by the user.

Solution

try{
var urlReq:URLRequest = new URLRequest(“http://www.myUrl.com/file”);
fileReference.download(urlReq);
}

catch(error:Error)
{
Flash10Workround();

}

WorkAround Method :

var popup:Somepopupcustomobject;

private function Flash10Workround():void
{
popup= new Somepopupcustomobject();
PopUpManager.addPopUp(popup,this,true);
PopUpManager.centerPopUp(popup);
popup.LABEL=”File is Ready to Exported, Please Click Ok to continue”;
popup.submitSub.addEventListener(MouseEvent.CLICK, closePopUp);
}

private function closePopUp(e:MouseEvent):void
{
var urlReq:URLRequest = new URLRequest(“Ur Link here”);
fileReference.download(urlReq);
PopUpManager.removePopUp(Object218PopUp);

}

Regards,
Ranjit Sail

Advertisements

Cairngorm View Locater : Change view based on Change in Command

I was making changes to view based on collection change event till i found out that Cairngorm Event and Cairngorm Event dispatcher go very well like a normal event dispatcher.
To change a view based on the result listen by command, write a Event Meta Tag, Create a Event and dispatch it in result handler of command as show in figure.

Command

Command

And listen this event in main File on initialize as shown in the figure

Main.mxml

Main.mxml

dispatched event is captured in function and based on this change can be made to View of Cairngorm.

Regards,
Ranjit Sail

Silverlight tools Installation problem and microsoft site does not open.

Hi All,

I had problem where Microsoft web site didn’t work for me and the same reason silverlight tools installation was not going a head as it downloads from microsoft codeplex so was getting following errors as shown in the image.

Errror In Silverlight Tools Installation

Errror In Silverlight Tools Installation

solution :

1. Check if you have install VS SP1
2. If you are getting above error install windows Live one care

Regards,
Ranjit