<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>guidefordesign &#187; Actionscript</title>
	<atom:link href="http://www.guidefordesign.com/category/code-samples/actionscript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.guidefordesign.com</link>
	<description>Free resources for webmasters, design tools, templates, pixel fonts, free vectors and more..</description>
	<lastBuildDate>Tue, 10 Jan 2012 12:39:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AS2 Domain Lock &#8211; Protecting SWF Files</title>
		<link>http://www.guidefordesign.com/code-samples/as2-domain-lock-protecting-swf-files.html</link>
		<comments>http://www.guidefordesign.com/code-samples/as2-domain-lock-protecting-swf-files.html#comments</comments>
		<pubDate>Wed, 22 Jun 2011 15:43:36 +0000</pubDate>
		<dc:creator>yuzi</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[domain lock]]></category>
		<category><![CDATA[lock swf]]></category>
		<category><![CDATA[protect swf files]]></category>
		<category><![CDATA[swf decompile]]></category>
		<category><![CDATA[swf protect]]></category>

		<guid isPermaLink="false">http://www.guidefordesign.com/?p=312</guid>
		<description><![CDATA[Domain Locking is the simple way to protect your swf files at least from newbies. Here&#8217;s what i&#8217;ve found for domain locking. Just copy and paste this code into first frame;
urls_allowed = ["www.guidefordesign.com"];
sitelock(urls_allowed);
function sitelock(urls_allowed) {
lock = true;
domain_parts = _url.split(&#8221;://&#8221;);
real_domain = domain_parts[1].split(&#8221;/&#8221;);
domain.text = real_domain[0];
for (x in urls_allowed) {
if (urls_allowed[x] == real_domain[0]) {
lock = false;
}
}
if (lock) {
_root._alpha [...]]]></description>
			<content:encoded><![CDATA[<p>Domain Locking is the simple way to protect your swf files at least from newbies. Here&#8217;s what i&#8217;ve found for domain locking. Just copy and paste this code into first frame;</p>
<p>urls_allowed = ["www.guidefordesign.com"];<br />
sitelock(urls_allowed);<br />
function sitelock(urls_allowed) {<br />
lock = true;<br />
domain_parts = _url.split(&#8221;://&#8221;);<br />
real_domain = domain_parts[1].split(&#8221;/&#8221;);<br />
domain.text = real_domain[0];<br />
for (x in urls_allowed) {<br />
if (urls_allowed[x] == real_domain[0]) {<br />
lock = false;<br />
}<br />
}<br />
if (lock) {<br />
_root._alpha = 0;<br />
}<br />
}</p>
<p>for multiple domain lock just change the line above;</p>
<p>urls_allowed = ["www.guidefordesign.com","www.anotherdomain.com"];</p>
<p>source: <a href="http://www.emanueleferonato.com/" target="_blank">emanueleferonato.com</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.guidefordesign.com%2Fcode-samples%2Fas2-domain-lock-protecting-swf-files.html&amp;linkname=AS2%20Domain%20Lock%20%26%238211%3B%20Protecting%20SWF%20Files"><img src="http://www.guidefordesign.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.guidefordesign.com/code-samples/as2-domain-lock-protecting-swf-files.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Actionscript Preloader</title>
		<link>http://www.guidefordesign.com/code-samples/flash-actionscript-preloader.html</link>
		<comments>http://www.guidefordesign.com/code-samples/flash-actionscript-preloader.html#comments</comments>
		<pubDate>Wed, 23 Dec 2009 12:26:22 +0000</pubDate>
		<dc:creator>yuzi</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[as2.0]]></category>
		<category><![CDATA[flash actionscript]]></category>
		<category><![CDATA[macromedia]]></category>
		<category><![CDATA[preloader]]></category>

		<guid isPermaLink="false">http://www.guidefordesign.com/?p=208</guid>
		<description><![CDATA[Here is a good &#38; working  AS2.0 preloader sample.
Insert the code above  into frame 1, add new dynamic text on scene and name its var as &#8220;showpercent&#8221;, that&#8217;s all..
onEnterFrame=function(){
            var total:Number=_root.getBytesTotal();
            var loaded:Number=_root.getBytesLoaded();
            if(loaded==total){
                        delete  onEnterFrame
                        play();
            }else{
                        var percent:Number=Math.floor((loaded/total)*100);
                       showpercent.text=percent
            }
}
stop();
]]></description>
			<content:encoded><![CDATA[<p>Here is a good &amp; working  AS2.0 preloader sample.</p>
<p>Insert the code above  into frame 1, add new dynamic text on scene and name its var as &#8220;showpercent&#8221;, that&#8217;s all..</p>
<p>onEnterFrame=function(){</p>
<p>            var total:Number=_root.getBytesTotal();</p>
<p>            var loaded:Number=_root.getBytesLoaded();</p>
<p>            if(loaded==total){</p>
<p>                        delete  onEnterFrame</p>
<p>                        play();</p>
<p>            }else{</p>
<p>                        var percent:Number=Math.floor((loaded/total)*100);</p>
<p>                       showpercent.text=percent</p>
<p>            }</p>
<p>}</p>
<p>stop();</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.guidefordesign.com%2Fcode-samples%2Fflash-actionscript-preloader.html&amp;linkname=Flash%20Actionscript%20Preloader"><img src="http://www.guidefordesign.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.guidefordesign.com/code-samples/flash-actionscript-preloader.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to disable browser cache for flash</title>
		<link>http://www.guidefordesign.com/code-samples/how-to-disable-browser-cache-for-flash.html</link>
		<comments>http://www.guidefordesign.com/code-samples/how-to-disable-browser-cache-for-flash.html#comments</comments>
		<pubDate>Sat, 17 Oct 2009 21:36:14 +0000</pubDate>
		<dc:creator>yuzi</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[AC_FL_RunContent]]></category>
		<category><![CDATA[AC_RunActiveContent.js file]]></category>
		<category><![CDATA[browser cache]]></category>
		<category><![CDATA[CS3]]></category>
		<category><![CDATA[disable browser cache]]></category>
		<category><![CDATA[flash cache disabling]]></category>

		<guid isPermaLink="false">http://www.guidefordesign.com/?p=150</guid>
		<description><![CDATA[As you know when you upload new swf file to server, browser doesn&#8217;t show it until you delete browser cache. Also it&#8217;s important to delete swf cache for websites which includes dynamic data and dynamic sub swf files. Here&#8217;s the method that we pass this problem for flash.

Now we&#8217;ll make some changes on AC_RunActiveContent.js file. ( Supported with CS3, for [...]]]></description>
			<content:encoded><![CDATA[<p>As you know when you upload new swf file to server, browser doesn&#8217;t show it until you delete browser cache. Also it&#8217;s important to delete swf cache for websites which includes dynamic data and dynamic sub swf files. Here&#8217;s the method that we pass this problem for flash.</p>
<p><span id="more-150"></span></p>
<p>Now we&#8217;ll make some changes on AC_RunActiveContent.js file. ( Supported with CS3, for older versions you need to download it from <a title="active content adobe" href="http://www.adobe.com/devnet/activecontent/articles/devletter.html" target="_blank">here</a> ) </p>
<p><strong>1.open AC_RunActiveContent.js file</strong></p>
<p><strong>2. Change AC_FL_RunContent() function with this;</strong></p>
<p>function AC_FL_RunContent(){<br />
var ret =<br />
AC_GetArgs<br />
( arguments, &#8220;.swf?foo=&#8221;+new Date()+&#8221;" //&lt;–Line we pass the browser by giving auto generated numbers<br />
, &#8220;movie&#8221;, &#8220;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&#8243;<br />
, &#8220;application/x-shockwave-flash&#8221;<br />
);<br />
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);<br />
}</p>
<p><strong>3.That&#8217;s all..</strong></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.guidefordesign.com%2Fcode-samples%2Fhow-to-disable-browser-cache-for-flash.html&amp;linkname=How%20to%20disable%20browser%20cache%20for%20flash"><img src="http://www.guidefordesign.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.guidefordesign.com/code-samples/how-to-disable-browser-cache-for-flash.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to delete xml cache with actionscript?</title>
		<link>http://www.guidefordesign.com/code-samples/how-to-delete-xml-cache-with-actionscript.html</link>
		<comments>http://www.guidefordesign.com/code-samples/how-to-delete-xml-cache-with-actionscript.html#comments</comments>
		<pubDate>Wed, 14 Oct 2009 13:25:12 +0000</pubDate>
		<dc:creator>yuzi</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[deleting xml cache]]></category>
		<category><![CDATA[flash actionscript]]></category>
		<category><![CDATA[ignorwhite]]></category>
		<category><![CDATA[loadxml]]></category>
		<category><![CDATA[math.round]]></category>
		<category><![CDATA[xml data cahe]]></category>
		<category><![CDATA[xml loader]]></category>

		<guid isPermaLink="false">http://www.guidefordesign.com/?p=148</guid>
		<description><![CDATA[İt&#8217;s important to delete xml cache in flash if your content is renewing it self often.  Here&#8217;s the sample code for deleting xml cache with actionscript;
Just change your xml loading code with this:

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
myAdd=Math.round(Math.random()*10000); // producing random numbers to add after filename
myXmlFile=&#8221;myfile.xml?new=&#8221;+myAdd;  // little trick to pass the browser [...]]]></description>
			<content:encoded><![CDATA[<p>İt&#8217;s important to delete xml cache in flash if your content is renewing it self often.  Here&#8217;s the sample code for deleting xml cache with actionscript;</p>
<p>Just change your xml loading code with this:</p>
<p><span id="more-148"></span></p>
<p>xmlData = new XML();<br />
xmlData.ignoreWhite = true;<br />
xmlData.onLoad = loadXML;<br />
myAdd=Math.round(Math.random()*10000); // producing random numbers to add after filename<br />
myXmlFile=&#8221;myfile.xml?new=&#8221;+myAdd;  // little trick to pass the browser cache, it thinks this is a new file ..<br />
xmlData.load(myXmlFile);</p>
<p>With this code your flash will reload your xml file refreshing everytime.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.guidefordesign.com%2Fcode-samples%2Fhow-to-delete-xml-cache-with-actionscript.html&amp;linkname=How%20to%20delete%20xml%20cache%20with%20actionscript%3F"><img src="http://www.guidefordesign.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.guidefordesign.com/code-samples/how-to-delete-xml-cache-with-actionscript.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

