Be a Supporter!

Sitelock to NG

  • 385 Views
  • 3 Replies
New Topic Respond to this Topic
MichaelJ
MichaelJ
  • Member since: Mar. 2, 2009
  • Offline.
Forum Stats
Member
Level 18
Voice Actor
Sitelock to NG 2009-07-16 08:55:11 Reply

What is the AS2 code to sitelock a game to Newgrounds? I forgot how to write it. Thanks.


BBS Signature
StaliN98
StaliN98
  • Member since: Jul. 27, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Sitelock to NG 2009-07-16 09:12:10 Reply

var url:String = this._url;
url = url.substring( 11, 21 );
if( url != "newgrounds" ){
	// Do something
}

Should work. Just put it at the top of your code on the first frame. Make it do something like show a graphic saying "This has been ripped from newgrounds.com" etc.

MichaelJ
MichaelJ
  • Member since: Mar. 2, 2009
  • Offline.
Forum Stats
Member
Level 18
Voice Actor
Response to Sitelock to NG 2009-07-16 09:15:05 Reply

It doesn't work when I test movie, will it work when on the internet?


BBS Signature
StaliN98
StaliN98
  • Member since: Jul. 27, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Sitelock to NG 2009-07-16 09:20:13 Reply

At 7/16/09 09:15 AM, Animator1mike wrote: It doesn't work when I test movie, will it work when on the internet?

By "doesn't work", do you mean the movie won't work because this code stops it or the code I supplied doesn't work? The code worked when I tested it.