{"id":1877,"date":"2012-01-13T15:29:33","date_gmt":"2012-01-13T15:29:33","guid":{"rendered":"http:\/\/www.benoitfreslon.com\/?p=1877"},"modified":"2024-07-19T09:32:52","modified_gmt":"2024-07-19T07:32:52","slug":"actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games","status":"publish","type":"post","link":"https:\/\/benoitfreslon.com\/fr\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/","title":{"rendered":"ActionScript: Protect your Flash games on the web, sitelock all your games."},"content":{"rendered":"<p>Si vous souhaitez diffuser vos jeux Flash sur les portails de jeux NE LES UPLOADER PAS AVANT D&rsquo;AVOIR SITELOCKE VOS JEUX.<\/p>\n<p><strong>POURQUOI ?<\/strong><\/p>\n<p>Vos jeux peuvent \u00eatre \u00ab\u00a0vol\u00e9s\u00a0\u00bb par d&rsquo;autres portails de jeux. Ils le mettrons sur leur portail sans autorisation de votre part.<br \/>\nOu bien si vous n&rsquo;avez pas encore termin\u00e9 votre jeu et que vous voulez le mettre \u00e0 jour \u00ab\u00a0bonjour la mis\u00e8re\u00a0\u00bb pour mettre \u00e0 jour votre jeu sur tous les portails du web.<\/p>\n<p>J&rsquo;ai essay\u00e9 beaucoup de codes pour sitelocker mes jeux mais certains trouv\u00e9s sur le net sont encore en ActionScript 2.0 ou totalement p\u00e9rim\u00e9s.<br \/>\nCertains ne fonctionnent pas avec le pr\u00e9fixe \u00ab\u00a0https\u00a0\u00bb ou sans les \u00ab\u00a0www\u00a0\u00bb.<br \/>\nUn autre exemple, quand vous voulez simplement tester votre jeu sur votre machine, il faut commenter le code de sitelock et ne pas oublier de le d\u00e9comment\u00e9 avant de l&rsquo;uplopad\u00e9 sur web.<\/p>\n<p>Donc j&rsquo;ai d\u00e9cid\u00e9 de cr\u00e9er mon propre script de sitelock.<\/p>\n<p>Il s&rsquo;agit d&rsquo;une version simplifi\u00e9e de mon script de base mais cette version est parfaite pour toutes utilisations.<\/p>\n<p><strong>Installation<\/strong><\/p>\n<p>Copier et coller ce bout de code et ajouter les domaines dans le tableau \u00ab\u00a0[ ]\u00a0\u00bb s\u00e9par\u00e9s par des virgules.<\/p>\n<p>[\u00ab\u00a0kongregate.com\u00a0\u00bb, &#8230;, &#8230;]<\/p>\n<p>Vous pouvez v\u00e9rouiller la lecture en local du jeu en changeant le second param\u00e8tre pour \u00ab\u00a0false\u00a0\u00bb.<br \/>\nLa valeur par d\u00e9faut \u00e9tant true.<\/p>\n<pre>sitelock([\"kongregate.com\",\"benoitfreslon.com\"]);\r\n\r\n\/**\r\n* Sitelock your swf file on domains\r\n*\r\n* @param arrDomain List of all authorized domains\r\n* @param local This swf can be played on local computer ?\r\n*\/\r\nfunction sitelock(arrDomain:Array, local:Boolean = true):void\r\n{\r\n\r\n\tvar isAut:Boolean = false;\r\n\r\n\tvar url:String = root.loaderInfo.url;\r\n\tvar arr:Array = root.loaderInfo.url.split(\":\/\/\");\r\n\r\n\tvar domain:String = arr[1].split(\"\/\")[0];\r\n\r\n\t\/\/ localmode\r\n\tif (url.split(\"file:\/\/\").length &gt; 1)\r\n\t{\r\n\t\tif (local)\r\n\t\t{\r\n\t\t\t\/\/trace(\"Local mode is autorized\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdestroy();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tfor (var i:String in arrDomain)\r\n\t{\r\n\t\tarr = domain.split(arrDomain[i]);\r\n\t\tif (arr.length &gt; 1)\r\n\t\t{\r\n\t\t\tisAut = true;\r\n\t\t\tdomain = arrDomain[i];\r\n\t\t\t\/\/trace(\"*** Sitelock: Domain found\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}\r\n\tif (! isAut)\r\n\t{\r\n\t\t\/\/trace(\"*** Sitelock: Not authentified\");\r\n\t\tdestroy();\r\n\t}\r\n\treturn;\r\n}\r\n\/**\r\n* This function is called when the game is locked.\r\n*\/\r\nfunction destroy()\r\n{\r\n\t\/\/ Domain error\r\n\ttrace(\"*** Domain Error ***\");\r\n\troot.alpha = 0;\r\n}<\/pre>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Si vous souhaitez diffuser vos jeux Flash sur les portails de jeux NE LES UPLOADER PAS AVANT D&rsquo;AVOIR SITELOCKE VOS&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[163,6,48,162,160,161,159],"class_list":["post-1877","post","type-post","status-publish","format-standard","hentry","category-news","tag-domain","tag-flash","tag-jeu","tag-lock","tag-protection","tag-site","tag-sitelock","wpcat-1-id"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ActionScript: Protect your Flash games on the web, sitelock all your games. - Beno\u00eet Freslon<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/benoitfreslon.com\/fr\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benoit Freslon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/news\\\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/news\\\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\\\/\"},\"author\":{\"name\":\"Benoit Freslon\",\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/#\\\/schema\\\/person\\\/fe9fe28a6b6c2b56648448b977fd6b78\"},\"headline\":\"ActionScript: Protect your Flash games on the web, sitelock all your games.\",\"datePublished\":\"2012-01-13T15:29:33+00:00\",\"dateModified\":\"2024-07-19T07:32:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/news\\\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\\\/\"},\"wordCount\":436,\"keywords\":[\"domain\",\"flash\",\"jeu\",\"lock\",\"protection\",\"site\",\"sitelock\"],\"articleSection\":[\"Actualit\u00e9s\"],\"inLanguage\":\"fr-FR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/news\\\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\\\/\",\"url\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/news\\\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\\\/\",\"name\":\"ActionScript: Protect your Flash games on the web, sitelock all your games. - Beno\u00eet Freslon\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/#website\"},\"datePublished\":\"2012-01-13T15:29:33+00:00\",\"dateModified\":\"2024-07-19T07:32:52+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/#\\\/schema\\\/person\\\/fe9fe28a6b6c2b56648448b977fd6b78\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/news\\\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[[\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/news\\\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\\\/\"]]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/news\\\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ActionScript: Protect your Flash games on the web, sitelock all your games.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/\",\"name\":\"Beno\u00eet Freslon\",\"description\":\"[:en]Game designer | D\u00e9veloppeur de jeux ind\u00e9pendant | Freelance | Enseignant | Blogueur[:fr]Game designer | Independent game developer | Freelance | Teacher | Blogger[:]\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/benoitfreslon.com\\\/#\\\/schema\\\/person\\\/fe9fe28a6b6c2b56648448b977fd6b78\",\"name\":\"Benoit Freslon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b828da2527f91fb7c86dab67050492f4303279afa245d6e718ea1c6e6f00bb2?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b828da2527f91fb7c86dab67050492f4303279afa245d6e718ea1c6e6f00bb2?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b828da2527f91fb7c86dab67050492f4303279afa245d6e718ea1c6e6f00bb2?s=96&d=identicon&r=g\",\"caption\":\"Benoit Freslon\"},\"sameAs\":[\"https:\\\/\\\/benoitfreslon.com\",\"https:\\\/\\\/www.instagram.com\\\/benoitfreslon\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/benoitfreslon\",\"https:\\\/\\\/x.com\\\/BenoitFreslon\",\"https:\\\/\\\/www.youtube.com\\\/benoitfreslon\"],\"url\":\"https:\\\/\\\/benoitfreslon.com\\\/fr\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ActionScript: Protect your Flash games on the web, sitelock all your games. - Beno\u00eet Freslon","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/benoitfreslon.com\/fr\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/","twitter_misc":{"\u00c9crit par":"Benoit Freslon","Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/benoitfreslon.com\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/#article","isPartOf":{"@id":"https:\/\/benoitfreslon.com\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/"},"author":{"name":"Benoit Freslon","@id":"https:\/\/benoitfreslon.com\/#\/schema\/person\/fe9fe28a6b6c2b56648448b977fd6b78"},"headline":"ActionScript: Protect your Flash games on the web, sitelock all your games.","datePublished":"2012-01-13T15:29:33+00:00","dateModified":"2024-07-19T07:32:52+00:00","mainEntityOfPage":{"@id":"https:\/\/benoitfreslon.com\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/"},"wordCount":436,"keywords":["domain","flash","jeu","lock","protection","site","sitelock"],"articleSection":["Actualit\u00e9s"],"inLanguage":"fr-FR"},{"@type":"WebPage","@id":"https:\/\/benoitfreslon.com\/fr\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/","url":"https:\/\/benoitfreslon.com\/fr\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/","name":"ActionScript: Protect your Flash games on the web, sitelock all your games. - Beno\u00eet Freslon","isPartOf":{"@id":"https:\/\/benoitfreslon.com\/fr\/#website"},"datePublished":"2012-01-13T15:29:33+00:00","dateModified":"2024-07-19T07:32:52+00:00","author":{"@id":"https:\/\/benoitfreslon.com\/#\/schema\/person\/fe9fe28a6b6c2b56648448b977fd6b78"},"breadcrumb":{"@id":"https:\/\/benoitfreslon.com\/fr\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":[["https:\/\/benoitfreslon.com\/fr\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/"]]}]},{"@type":"BreadcrumbList","@id":"https:\/\/benoitfreslon.com\/fr\/news\/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/benoitfreslon.com\/fr\/"},{"@type":"ListItem","position":2,"name":"ActionScript: Protect your Flash games on the web, sitelock all your games."}]},{"@type":"WebSite","@id":"https:\/\/benoitfreslon.com\/fr\/#website","url":"https:\/\/benoitfreslon.com\/fr\/","name":"Beno\u00eet Freslon","description":"[:en]Game designer | D\u00e9veloppeur de jeux ind\u00e9pendant | Freelance | Enseignant | Blogueur[:fr]Game designer | Independent game developer | Freelance | Teacher | Blogger[:]","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/benoitfreslon.com\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Person","@id":"https:\/\/benoitfreslon.com\/#\/schema\/person\/fe9fe28a6b6c2b56648448b977fd6b78","name":"Benoit Freslon","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/secure.gravatar.com\/avatar\/0b828da2527f91fb7c86dab67050492f4303279afa245d6e718ea1c6e6f00bb2?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0b828da2527f91fb7c86dab67050492f4303279afa245d6e718ea1c6e6f00bb2?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b828da2527f91fb7c86dab67050492f4303279afa245d6e718ea1c6e6f00bb2?s=96&d=identicon&r=g","caption":"Benoit Freslon"},"sameAs":["https:\/\/benoitfreslon.com","https:\/\/www.instagram.com\/benoitfreslon","https:\/\/www.linkedin.com\/in\/benoitfreslon","https:\/\/x.com\/BenoitFreslon","https:\/\/www.youtube.com\/benoitfreslon"],"url":"https:\/\/benoitfreslon.com\/fr\/author\/admin\/"}]}},"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pLAe3-uh","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/posts\/1877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/comments?post=1877"}],"version-history":[{"count":15,"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/posts\/1877\/revisions"}],"predecessor-version":[{"id":39115,"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/posts\/1877\/revisions\/39115"}],"wp:attachment":[{"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/media?parent=1877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/categories?post=1877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benoitfreslon.com\/fr\/wp-json\/wp\/v2\/tags?post=1877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}