AS3 - Flash to AIR - ExternalInterface - actionscript-3

I have a flash project that I am trying to convert to Adobe AIR to be compatible with steam. The flash project uses ExternalInterface calls into Javascript that embeds the swf that are essential to the app (PHP logins, Facebook interactions, etc).
What are my options for getting around a lack of ExternalInterface when using Adobe AIR?

You need to re-implement all this features (login, social network integration) without ExternalInterface. I think, you need to use Steam API for much part of this.

Related

Discord Rich Presence in AIR?

Discord released a Rich Presence SDK that lets C++ developers integrate their game with Discord, which really is an extension of their existing RPC server built into Discord. Lately this SDK has been ported to more and more languages, including Java and Javascript. I know AIR can interface with Javascript, but they seem to use node.js which could be messy.
With all of these new wrappers popping up, what would be the best way of going about this for an AIR app? I'm trying to figure out the most efficient method for creating an AS3 version but I'm not sure which path is the best.
Edit: I don't even want the fancier features, I just want to be able to set a user's local Discord client to display extra game info.

Can Adobe Air (AS3) use socket.io directly?

I have a desktop app made with Adobe Air (as3). The app will send and receive notifications over the web with online users.
I'm trying to find a way to connect Adobe Air (as3), not Flex, directly with socket.io, but I found nothing.
Can anybody help?
What are you trying to accomplish? Why not just use NetConnection? Does the server have to use WebSockets?
UPDATE: Here is an implementation of WebSockets in ActionScript.

Adobe air or flex?

I am starting with my first application development. So far I have worked only with Html, css, js, jquery etc..
I want to create an app like the desktop gmail notifier which pings the server at regular interval, look for any messages and notifies the user. I read that Adobe Air and flex are the tools that can be used for this. I have developed the basic prototype in adobe air by studying the tutorials in net.
But the problem is that, my client doesn't want the source code to be made available to users. With air, you can see the complete source code after installation/unzipping the .air app.
Is there any way I can protect the source code? Or should I use flex and convert it to a swf? Is the source codes are protected in flex? I am not familiar with the flash action scripting. Please advice.
I think you are confused as to what Flex is. It is an SDK that is a level below the AIR and Flash SDKs. Flex is a secondary structural language that is meant to be used in conjunction with AS3, while AIR is compile-type.
It doesn't matter how you compile this, the source code will be attainable if someone really wants to get it. If you compile as an AIR app, you can unzip and get the SWF file. If you compile as a SWF, you already have that SWF. The SWF can then be decompiled using various tools.
There is no real way to hide front end code from prying eyes. Flash is definitely harder to read than HTML or CSS or Javascript, but definitely not impossible to view regardless of how you compile. Your best bet is definitely to offload as much as possible to a server and possibly obfuscate your code.
I would definitely try to explain to your client that it is simply not possible to truly hide source code from individuals who would like to access it. If someone really wants to steal the code, they can and will.
Code cannot be hided in any front end technologies, Flash (SWF, Flex or AIR) or HTML (JavaScript).
Do all the business logic at server and authentic properly for securing your data.
And AIR and Flash Player are both runtimes which play applications written in Adobe Flash or Apache Flex.
You can use a client-server implementation to hide the logic from the user and flex would just render a UI based on the business logic from the server side code(php,java or .NET) that interacts with the gmail servers
If you want proper notifications, go with AIR - access to some system-level features like toast notifications. With Flex, you'll be limited to webpage content.
About code protection - you can develop app in ActionScript and then protect compiled SWF with obfuscator for some fair defense, although there's probably no good free obfuscators. I paid some bucks for secureSWF license and consider it a good investment. Of course, determined hacker would crack app anyway (in theory,) but I would'nt worry about this too much for a simple pinger app.

Is it possible to monitor or change the system audio volume in Adobe AIR?

I am making a game in AS3 / Adobe AIR that requires the user to react to certain sounds. Is there a way to inform the user up front if the system volume is muted? Moreover, is there a method to change the volume? If not, does an external cross-platform application exist that lets me monitor the volume and that I can call from Adobe AIR?
The only access you may have to sound volum is restricted to the application (Flash player or AIR). You can change it with SoundMixer.soundTransform.volume for the general volume or SoundChannel.soundTransform.volume for a specific sound.
To summerize, you can't access the OS sound manager's settings or state with Flash. That's why many flash websites start with a message asking the users to switch their speakers on.
Native Extensions is the way to go.
You can follow an Adobe tutorial: http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt1.html
Or download them ready made: https://github.com/nweber/SystemVolumeNativeExtension

Telephone call from AIR application

Since there is no actionscript API for skype, is there a http call API which I can use for actionscript 3? I want to make telephone calls from AIR app.
Check out http://www.ribbit.com/platform/ Its the only solution I know of, and while I've never worked with it myself I have heard really good things.
Adobe has created a product which allows this:
http://labs.adobe.com/technologies/flashmedia_gateway/
There's always red5phone, if air is backwards compatible with flash.
Twilio Client is a simple JavaScript and Flash based softphone that allows you to send and receive calls from a browser. It should work great from Adobe Air, though I haven't tried it yet.
(I work for Twilio)