PDA

View Full Version : Skype install check in Actionscript


Galaga
10-22-2008, 08:18 PM
Hi,

I have a problem for that I would like to ask your help.

I want to let show in Flash the online status of Skype. Everything works fine but has a small problem: if a visitor has no Skype installed, can see an error message that the system does not recognise the Skype software.

I found a solution on Skype's page:

Skype JavaScript detection

- first I need to put a small tag into our homepage header:

<script type="text/javascript"
src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js">
</script>

And I would need to use the following link:

<a href="skype:echo123?call" onclick="return skypeCheck();">
when the visitor clicks on Skype status button.

In my Flash the Actionscript now it looks like:
on(press) {
get URL("skype:echo123?chat");
}

How can I convert the requested
<a href="skype:echo123?call" onclick="return skypeCheck();"> link to Actionscript?

The best would be if the skype is not installed on the computer the Flash would pop-up a custom small page. It would be better solution as the Skype error message is in English, but I am using a not Skype-supported language (Hungarian).

Thanks!

inhan
10-22-2008, 11:39 PM
This does work on my computer but you might wanna try it on a computer without Skype to make sure.

btn.onPress = function() {
flash.external.ExternalInterface.call("skypeCheck");
getURL("skype:echo123?call");
};

Galaga
10-23-2008, 08:37 AM
Hi,

thanks, your solution will display the Skype's oops.html (http://download.skype.com/share/skypebuttons/oops/oops.html) warning with the download possibility.

I have only one problem. It seems, the actionscript will do the click which means, firefox will show an error mesage that Firefox does not know how to open the link as the protocol 'skype' is not associated to any program on the computer.
It wouldn't be a problem, but the warning message from Firefox will hide the Skype's recommendation oops.html to download the skype.

It would be the best to solve this problem in the Actionscript in the following way:
- clicking onto the button, the actionscript first check through http://download.skype.com/share/skypebuttons/js/skypeCheck.js if Skype is installed. If not, button will be disabled until page reload. This way the Skype javascript popup could be opened (as in the original js is programmed) and won't be hidden in the background...

My only problem I don't know how to write the script...

inhan
10-23-2008, 10:51 AM
import flash.external.ExternalInterface;

btn.onPress = function() {
var skypeAvail = ExternalInterface.call("function(){return skypeCheck();}");
if (skypeAvail) getURL("skype:echo123?call");
else this.enabled = false;
};