tags:

views:

79

answers:

4

hi,

I would need to create a website that has all the screens using Flash. The Flash screen would be having authentication system and get few data like Menu info, image info..................

Just wondering what is the way that Flash & .Net can talk.

Application front end: Flash Platform: .Net (Asp.Net, C#) Back end: SQL server.......

thank you

+1  A: 

Your flash can obviously accept parameters. There is a .NET control called BeWise which allows you to pass in parameters from your code behind to your flash objects.

So for instance you set it up as a control in your aspx page and then in your code behind you can do this:

flashControl.FlashVarsCollection.Add(new FlashVarItem("menu", "false"));
flashControl.FlashVarsCollection.Add(new FlashVarItem("flashVar", variableName));
Jack Marchetti
+2  A: 

This is not an answer to your question, but I have to give you this warning.

Do not use Flash as an authentication system!

Just two weeks ago I watched a video done by a security expert at IBM that showed how easy it is to take flash files, reverse-engineer them, and get by the authentication. It's ridiculously easy. He had some audience members shout out some web sites (big name sites) until he found one that used Flash eavily. He was into restricted adminstrator pages in less than a minutr.

You may as well do all of your authentication with client-side javascript.

Use Flash for what it's good at and what it was meant for - nice presentation. Treat Flash the way you would treat images or video files, and you can use Flash with any server-side technology you want.

When I get back to work tomorrow I'll try to find the link to the video.

David Stratton
A: 

Flash has URLLoader class that you can use to communicate with the server.

Amarghosh
+1  A: 

David Stratton´s point is valid. Be careful when using flash for authentication!

Anyhow, there are many ways to pass data to a flash app.

The most easiest way is using FlashVars. I use that in order to pass small amounts of data to the flash, like image-paths, baseurl for hyperlinks etc.

When the flash app uses more complex data I either serve it via XML or JSON (you need the AS3corelib from Adobe in order to parse JSON in AS3).

One might use URLLoader and URLRequest in order to load the XML/JSON via HTTP from the backend. See this page for an example on how to use the mentioned classes: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLRequest.html

Max