How we protect our .swf work
Page 1 of 1 • Share •
How we protect our .swf work
If you mean that you dont want others to download and watch your swf files, then yes, you could save it, indirectly though. Basically they will download it, but wont be able to watch it. Firstly you could check whether the domain in which the swf movie is running is allowed using LocalConnection object. This is probably used extensively by Flash game sites. Here's how you could implement it.
(Toggle Plain Text)
var loc:LocalConnection = new LocalConnection();
var domain:String = loc.domain();
if (domain == "www.yoursite.com") {
gotoAndPlay("start");
} else {
gotoAndPlay("access_denied");
}
var loc:LocalConnection = new LocalConnection(); var domain:String = loc.domain(); if (domain == "www.yoursite.com") { gotoAndPlay("start"); } else { gotoAndPlay("access_denied"); }
And you could check in which player are you running this swf file using System.capabilities.playerType
For Example:
(Toggle Plain Text)
var player:String = System.capabilities.playerType;
if( player == "ActiveX" )
gotoAndPlay("start");
else
gotoAndPlay("access_denied");
var player:String = System.capabilities.playerType; if( player == "ActiveX" ) gotoAndPlay("start"); else gotoAndPlay("access_denied");
And to prevent your swf from being decompiled, use any SWF Encrypters. However, as far as I know it would only encrypt your ActionScript, your sound and movies will still be readable.
Regards
Sakthi
(Toggle Plain Text)
var loc:LocalConnection = new LocalConnection();
var domain:String = loc.domain();
if (domain == "www.yoursite.com") {
gotoAndPlay("start");
} else {
gotoAndPlay("access_denied");
}
var loc:LocalConnection = new LocalConnection(); var domain:String = loc.domain(); if (domain == "www.yoursite.com") { gotoAndPlay("start"); } else { gotoAndPlay("access_denied"); }
And you could check in which player are you running this swf file using System.capabilities.playerType
For Example:
(Toggle Plain Text)
var player:String = System.capabilities.playerType;
if( player == "ActiveX" )
gotoAndPlay("start");
else
gotoAndPlay("access_denied");
var player:String = System.capabilities.playerType; if( player == "ActiveX" ) gotoAndPlay("start"); else gotoAndPlay("access_denied");
And to prevent your swf from being decompiled, use any SWF Encrypters. However, as far as I know it would only encrypt your ActionScript, your sound and movies will still be readable.
Regards
Sakthi

sakthi- Leader
- Posts: 187
Join date: 2007-12-02
Age: 25
Location: Coimbatore
Permissions of this forum:
You cannot reply to topics in this forum



