AS3 - Encrypted local storage - actionscript-3

I need to store a password locally from a Flash based app that runs within a browser. Is there an Flash equivalent to Air's encrypted local storage? (I'm publishing for Flash Player 10)
Thanks. Uli

I'd strongly advise against this, because the only way you can do this is by using Flash's shared objects, which are accessible to any flash application. Someone could simply create a flash wrapper to your SWF application and have people visit through their wrapper and then collect sensitive information (the password) with great ease. I'm posting this an answer because if you ever want anyone to feel remotely secure while using your application, this is the only answer.
On another note, you could simply write an AIR app and then when people visit your apps website, they can either have their AIR app launched from your web page or be prompted to install it if they do not already have it. Check out these links for more NFO on that:
http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html#1035834
http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7fcb.html#WS5b3ccc516d4fbf351e63e3d118666ade46-7e15

Related

Using Bluetooth ANE for Android

I'm relatively new to flash, air and AS3 so I'm sorry if this comes of as a beginners question. I have made an application in AIR to run on windows and communicate with my atmega8 chip through serial communication via serproxy.
Now I want to port that application to android to perform the same basic functions but communicate to the atmega8 via bluetooth. So I created a new Air for android file in Flash CS6 copied my code from my previous application excluding the communication through sockets part and created an apk which ran on an android phone:). It did everything except the communication as expected.
Now I have been trying to implement the as3breeze.com/bluetooth-ane and use it to communicate but I'm not too sure how to go about the whole thing. I have imported the ane through actionscript settings and have implemented the classes but when I try to test I get this error.
The content cannot be loaded because there was a problem loading an extension: Error: Extension namespace is invalid for C:\Users\AppData\Local\Temp\Tmp_ANE_File_Unzipped_Packages\AndroidBluetooth.ane
So after some searching I found posts talking about as3 sdk and flash builder. Do I really need all these things or can I make my bluetooth app work some how with just flash cs6? Also what exactly does my error mean and how can I solve it. Thanks in advance for any help. I have been searching so a solution to this for days and I either get an explanation that does not work or I lack the knowledge to understand.
The path that can't be accessed makes me believe you haven't extracted the ANE (basically you're trying to access a temporary directory). Try extracting the ANE file to somewhere, like My Documents or wherever your flash project is, and include (in the actionscript settings) that path instead.
Hope it helps.

Sound Cloud and FLASH

I'm having troubles with connecting flash and sound cloud api so i would really appriciate if someone with bigger experience could help me out.
Is it possible to stream an audio file through flash without
embedding the sc player? What i mean is accessing the audio file
without any redirects plus granting access through crossdomain.xml.
Is there an up to date documentation how to autenticate an
application, how to get tokens and everything necessary?
Are there any sample solutions or tutorials in flash wich is up to date and really works (what i found was pretty much outdated)?
Thank you for your answer in advance.
Regards:
Gabe
Point 2) How to authenticate with Flash?
If you are building a flash web application, you could use the Javascript SDK to authenticate, then pass the access token back to the flash app via the flash external interface.
There's tons of information on how to authenticate in Javascript. One great walkthrough is on codecademy: http://www.codecademy.com/courses/javascript-intermediate-en-txGOj/0/1

Writing text to .txt files using actionscript

Writing text to .txt files using actionscript. how? i couldn't find anything about that in the internet. is that possible? for flash player.
The flash player (the one in browsers) is run through a sandbox which prevents it from accessing or creating files on the users computer (imagine the chaos if it wasn't!), among other things.
You can store persistent data using SharedObject (but this is not readily visible to the user, only useful for storing settings etc).
The other options is to send the data to a web service which in turn would allow the user to download it. Those are your only options really.
Adobe Air is a different runtime, designed to be used for desktop applications. Eg like any program on your computer. It can do a lot more, but has to be downloaded and possibly installed before you can run it (it will not run from within a HTML page).
Check out Adobe AIR: http://www.adobe.com/devnet/air/flash/quickstart/articles/building_text_editor.html
That's impossible from flash player, only from air.

Get a stream from client microphone via web browser?

I want to implement something like voip communication that client doesn't need to install additional application, they just open the webpage and talk to a server. Is there anyway to access the audio stream from client microphone via web browser ? I don't want additional plugin like applet that user have to install.
I think flash can do this, but is there anyway else ?
Thank you,
Voteforpedro
Your four main options are:
Flash
Silverlight
ActiveX
Unsecure browser settings (e.g. javascript calling EXEs)
All of the above will be subject to various security limitations or require some acceptance by the end-user. I'm not even certain that the browser calling out to EXEs is even possible any more so it should be avoided at all costs.
Installing an ActiveX control will limit you to IE on Windows, so should probably be avoided. The user would have to agree to installing the ActiveX anyway.
Both Flash and Silverlight are cross-platform (Flash more so than Silverlight) but also require the user to agree to access to the Microphone/Webcam - this is done by the framework, not something you can control/influence. Obviously, if the user does not have Flash or Silverlight installed, you'd need to prompt the user that they need to install it!
As stated by #Oded, there are serious security and privacy issues related to microphone's and webcams, so do not expect future browsers to make this easier for you (e.g. the new family of HTML5 browsers).
There is no standard, I think flash is your best bet.
AS 3.0 Accessing a microphone.
There is no standard that gives you access to the client machine microphone.
I can imagine there are security implication to giving a browser such access, so don't expect to see anything soon, not without some sort of plug-in.
Chrome 11+ supports access to the microphone. Visit this page (with Google Chrome) and click on "Speech" and try it out. This is using Sencha Ext/Touch which is an open library. This specific addon to Sencha Touch is also open source and released here.
Edit: To clarify, this is JavaScript only. The user doesn't need to approve anything. But, it only works in Chrome and it uses Google voice recognition.
Good luck!

Browser application & local file system access

I want to enhance my browser-based web application with functionality that enables management of local files and folders. E.g. folder tree structures should be synchronized between local workstation and server via HTTP(S).
I am aware of security-related limitations in browser-based applications. However, there are some techniques that "work around" these issues:
Signed Java applets (full trust)
.NET Windows Forms browser controls (no joke, that works. Just the configuration is horrible)
ActiveX
My question is: What do you use/suggest, both technology and implementation practice? Key requirement is that the installation process is as simple as possible.
Thanks for your opinions!
Google Gears.
it lets you write Javascript applications with a much bigger platform support than the usual browser, and go 'unconnected' with local file access, cache and DB. and if/when connected it syncs to the central server.
available for several browsers on all platforms; but still under heavy evolution.
Both Gears and Adobe Air require the user to manually select a local file before you get any programmatic access. Very limited because of security considerations when it comes to local filesystem access, so no chance for any web based file sync type functionality there as far as I can see. Maybe I'm wrong about Adobe Air but this is definitely the case with gears. But If I'm wrong let me know!
Silverlight 4 (still in beta) allows file system access:
"Read and write files to the user’s MyDocuments, MyMusic, MyPictures and MyVideos folder (or equivalent for non-windows platforms) for example storage of media files and taking local copies of reports"
http://www.silverlight.net/getstarted/silverlight-4/
Definitely not ActiveX. No sense spending time on something that out-of-date.
Adobe AIR (essentially, Flash for the Desktop), is something that we considered in my last contract, as opposed to Java applets. Last I checked, though it's been several months, the installation of the AIR runtime environment was fast and easy
Your best bet might be to write a custom application that interacts with your web application. For example, Dropbox lets you synchronize files across computers by use of a background application that watches a Dropbox-enabled folder. It also lets you view your Dropbox files online through a web browser. The Dropbox web application then allows you to delete/move/copy files which is echoed in your local filesystem.
In the demo of Google Wave...
http://www.youtube.com/watch?v=v_UyVmITiYQ&fmt=18
...at 15:30 in, a group of img files are drag-and-dropped from the file system to the browser. The functionality is attributed to Google Gears. This seems a bit different from what Daniel OCallaghan and the official documentation suggest is possible.
Anybody know what's actually possible w/ Google Gear and the local file system?