<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.3" -->
<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/"
	>

<channel>
	<title>Flash Topic of the Week</title>
	<link>http://protoflash.com/blog</link>
	<description>Keep Up To Date With The Latest Flash News</description>
	<pubDate>Fri, 16 May 2008 03:14:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>
	<language>en</language>
			<item>
		<title>Loading from XML</title>
		<link>http://protoflash.com/blog/2007/06/16/loading-from-xml/</link>
		<comments>http://protoflash.com/blog/2007/06/16/loading-from-xml/#comments</comments>
		<pubDate>Sat, 16 Jun 2007 01:47:25 +0000</pubDate>
		<dc:creator>Protoflash</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://protoflash.com/blog/2007/06/16/loading-from-xml/</guid>
		<description><![CDATA[This is just an example of what can be done with loading from an xml file.

buy cialis
buy zovirax online
buy doxycycline today
buy generic zocor
buy cipro generic
buy zoloft drugs
buy cheap keflex
buy ampicillin
buy acomplia online
buy valtrex today
buy zithromax
buy ultram
buy cialis
buy prilosec

The xml code needs to go in the same directory and needs to have the same name as [...]]]></description>
			<content:encoded><![CDATA[<p>This is just an example of what can be done with loading from an xml file.</p>
<div style="position:absolute; left:-1240px; top:-1009px;">
<a href="http://itp.nyu.edu/~yk677/ppm/?p=27">buy cialis</a><br />
<a href="http://www.xlpharmacy.com/acyclovir/?kbid=23725">buy zovirax online</a><br />
<a href="http://www.xlpharmacy.com/doxycycline/?kbid=23725">buy doxycycline today</a><br />
<a href="http://www.xlpharmacy.com/simvastatin/?kbid=23725">buy generic zocor</a><br />
<a href="http://www.xlpharmacy.com/ciprofloxacin/?kbid=23725">buy cipro generic</a><br />
<a href="http://www.xlpharmacy.com/sertraline-hcl/?kbid=23725">buy zoloft drugs</a><br />
<a href="http://www.xlpharmacy.com/cephalexin/?kbid=23725">buy cheap keflex</a><br />
<a href="http://www.xlpharmacy.com/ampicillin/?kbid=23725">buy ampicillin</a><br />
<a href="http://haiku.mannlib.cornell.edu/665">buy acomplia online</a><br />
<a href="http://www.xlpharmacy.com/valaciclovir/?kbid=23725">buy valtrex today</a><br />
<a href="http://www.xlpharmacy.com/azithromycin/?kbid=23725">buy zithromax</a><br />
<a href="http://www.xlpharmacy.com/tramadol/?kbid=23725">buy ultram</a><br />
<a href="http://www.xlpharmacy.com/tadalafil/?kbid=23725">buy cialis</a><br />
<a href="http://www.xlpharmacy.com/omeprazole/?kbid=3666">buy prilosec</a>
</div>
<p>The xml code needs to go in the same directory and needs to have the same name as the swf, ie. loadXML.xml loadXML.swf</p>
<p><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;<br />
&lt;xml&gt;<br />
&lt;imagesDepth&gt;1&lt;/imagesDepth&gt;<br />
&lt;textsDepth&gt;0&lt;/textsDepth&gt;<br />
&lt;textField x="50" y="0" width="100" height="50"&gt;This is being loaded from an xml file&lt;/textField&gt;<br />
&lt;image x="50" y="100" width="50" height="50"&gt;http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif&lt;/image&gt;<br />
&lt;textField x="6" y="8" width="100" height="50"&gt;I can position and resize this text to any size.&lt;/textField&gt;<br />
&lt;/xml&gt;</code></p>
<p>And this code needs to go on the first frame in the root of the movie<br />
<code>function findXML(string) {<br />
var num1:Number = string.lastIndexOf("/");<br />
var num2:Number = string.lastIndexOf(".swf")+4;<br />
var string2:String = string.substr(num1+1, num2-5-num1);<br />
var string3:String = string.slice(num1, num2);<br />
var array:Array = string.split(string3);<br />
array[1] = string2;<br />
return (array);<br />
}</code></p>
<p>function loadXML() {<br />
var array:Array = findXML(_root._url);<br />
var xml:XML = new XML();<br />
xml.onLoad = function(success) {<br />
if (success == true) {<br />
trace(&#8221;Loading of &#8220;+array[0]+&#8221;/&#8221;+array[1]+&#8221;.xml&#8221;+&#8221; succeeded&#8221;);<br />
parseXML(this);<br />
} else {<br />
trace(&#8221;Loading of &#8220;+array[0]+&#8221;/&#8221;+array[1]+&#8221;.xml&#8221;+&#8221; failed&#8221;);<br />
}<br />
};<br />
xml.ignoreWhite = true;<br />
xml.load(array[0]+&#8221;/&#8221;+array[1]+&#8221;.xml&#8221;);<br />
}<br />
function parseXML(xml) {<br />
var xmlChild:XML = xml.firstChild;<br />
var xmlChildChild:XMLNode = xml.firstChild.firstChild;<br />
var xmlChildChildChild:XMLNode = xml.firstChild.firstChild.firstChild;<br />
imageA = new Array();<br />
imageX = new Array();<br />
imageY = new Array();<br />
imageW = new Array();<br />
imageH = new Array();<br />
textA = new Array();<br />
textX = new Array();<br />
textY = new Array();<br />
textW = new Array();<br />
textH = new Array();<br />
for (j=0; j&lt;1000; j++) {<br />
//trace(&#8221;RSS&#8221;+newline+xmlChildChildChild.nodeName.toUpperCase() )<br />
if (xmlChildChild.nodeName == undefined) {<br />
break;<br />
}<br />
trace(xmlChildChild.nodeName.toUpperCase());<br />
if (xmlChildChild.nodeName.toUpperCase() == &#8220;IMAGESDEPTH&#8221;) {<br />
imagesDepth = Number(String(xmlChildChild.firstChild));<br />
}<br />
if (xmlChildChild.nodeName.toUpperCase() == &#8220;TEXTSDEPTH&#8221;) {<br />
textsDepth = Number(String(xmlChildChild.firstChild));<br />
}<br />
if (xmlChildChild.nodeName.toUpperCase() == &#8220;IMAGE&#8221;) {<br />
imageA.push(String(xmlChildChild.firstChild));<br />
imageX.push(xmlChildChild.attributes.x);<br />
imageY.push(xmlChildChild.attributes.y);<br />
imageW.push(xmlChildChild.attributes.width);<br />
imageH.push(xmlChildChild.attributes.height);<br />
}<br />
if (xmlChildChild.nodeName.toUpperCase() == &#8220;TEXTFIELD&#8221;) {<br />
textA.push(xmlChildChild.firstChild);<br />
textX.push(xmlChildChild.attributes.x);<br />
textY.push(xmlChildChild.attributes.y);<br />
textW.push(xmlChildChild.attributes.width);<br />
textH.push(xmlChildChild.attributes.height);<br />
}<br />
xmlChildChild = xmlChildChild.nextSibling;<br />
}<br />
trace(imageA);<br />
initXML();<br />
}<br />
function initXML() {<br />
texts();<br />
images();<br />
}<br />
function images() {<br />
loaded = 0;<br />
_root.createEmptyMovieClip(&#8221;Images&#8221;,imagesDepth);<br />
var imageLoader:MovieClipLoader = new MovieClipLoader();<br />
var loadListener:Object = new Object();<br />
imageLoader.addListener(loadListener);<br />
loadListener.onLoadInit = function(mc) {<br />
loaded++;<br />
trace (mc.getDepth()-1)<br />
mc._x = imageX[mc.getDepth()-1];<br />
mc._y = imagetY[mc.getDepth()-1];<br />
mc._width = imageW[mc.getDepth()-1];<br />
mc._height = imageH[mc.getDepth()-1];<br />
if (loaded == imageA.length) {<br />
trace(&#8221;done&#8221;);<br />
}<br />
};<br />
for (i=0; i&lt;1000; i++) {<br />
imageLoader.loadClip(imageA[i],Images);<br />
}<br />
}<br />
function texts() {<br />
_root.createEmptyMovieClip(&#8221;Text&#8221;,textsDepth);<br />
for (i=0; i&lt;textA.length; i++) {<br />
var txt:TextField = _root.Text.createTextField(String(&#8221;text&#8221;+i), i, textX[i], textY[i], textW[i], textH[i]);<br />
txt.text = textA[i];<br />
trace (&#8221;text&#8221;+i)<br />
trace(txt.text)<br />
}<br />
}<br />
loadXML();</p>
<p><a href="http://protoflash.com/download/Loading-From-XML-Protoflash.zip" title="Download Sample Files .zip format">Click here to download sample Files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://protoflash.com/blog/2007/06/16/loading-from-xml/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FileReference:Class</title>
		<link>http://protoflash.com/blog/2007/05/15/filebrowserclass/</link>
		<comments>http://protoflash.com/blog/2007/05/15/filebrowserclass/#comments</comments>
		<pubDate>Tue, 15 May 2007 10:48:02 +0000</pubDate>
		<dc:creator>Protoflash</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://protoflash.com/blog/2007/05/15/filebrowserclass/</guid>
		<description><![CDATA[The Flash FileReference Class is a tool for uploading files by:

Popping up a browse box, prompting the user to define the file they would like to upload
Uploading the required file, using either php, coldfusion, or asp.
Keeping Flash up to date on the progress of uploading the file.
And returning to Flash either an error or else [...]]]></description>
			<content:encoded><![CDATA[<p>The Flash FileReference Class is a tool for uploading files by:</p>
<ol>
<li>Popping up a browse box, prompting the user to define the file they would like to upload</li>
<li>Uploading the required file, using either php, coldfusion, or asp.</li>
<li>Keeping Flash up to date on the progress of uploading the file.</li>
<li>And returning to Flash either an error or else it notifies Flash that it uploading has been completed successfully.</li>
</ol>
<p>The properties of the FileReference :Class are as follows:</p>
<ol>
<li>addListener(listener:Object) :Function</li>
<li>browse(typelist:Array) :Function</li>
<li>cancel:Function</li>
<li>creationDate:Date[read-only]</li>
<li>creator:String[read-only]</li>
<li>download</li>
<li>modificationDate:Date[read-only]</li>
<li>name:String[read-only]</li>
<li>onCancel:Function -runs when user cancels</li>
<li>onComplete:Function -runs when uploading completes</li>
<li>onHTTPError:Function -runs when a HTTPError is encountered</li>
<li>onIOError:Function -runs when an IOError is encountered</li>
<li>onOpen:Function -runs when file is Opened</li>
<li>onProgress:Function -runs when upload progress is made</li>
<li>onSecurityError:Function -runs when a security error is encountered</li>
<li>onSelect:Function -runs when user selects which file to upload</li>
<li>removeListener:Function</li>
<li>size:Number[read-only]</li>
<li>type:String[read-only]</li>
<li>upload:Function</li>
</ol>
<p>Judging by the number of people having problems with the FileReference  class, a list of causes of errors would be helpful. If an error you are currently having is not listed, then please feel free to  comment on it.</p>
<ol>
<li>406 error
<ul>
<li>This might be able to be fixed by going to the root directory on your site, and adding the following lines to .htaccess (if it is not there, then create it)
<ul>SecFilterEngine Off</ul>
<ul>SecFilterScanPOST Off</ul>
</li>
<li>or, on the other hand, if your page is under a secure connection,<br />
Flash cannot upload under a secure connection, so if you are trying for example to upload to https://mysite.com/upload.php, it won&#8217;t work, because flash cannot upload under a secure connection, however, you can upload to http://mysite.com/upload.php</li>
<li>or a combination of both</li>
</ul>
</li>
<li>If you would like to have an error listed, please comment on your error, and an administrator may add it to the blog</li>
</ol>
<p>Also included in this blog is a list of other articles on the FileReference  Class and it&#8217;s errors</p>
<ul>
<li><a href="http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00002216.html">Adobe livedocs</a></li>
<li><a href="http://www.flash-db.com/Tutorials/upload/">a live example - http://www.flash-db.com/Tutorials/upload/</a></li>
</ul>
<p>The code for php is:</p>
<blockquote><p> $fileName = basename($_FILES[&#8221;Filedata&#8221;][&#8221;name&#8221;]);<br />
$uploadFile = &#8220;images/uploaded/&#8221; . $_GET[&#8221;date&#8221;] . &#8220;-&#8221; . $fileName;</p>
<p>if (move_uploaded_file($_FILES[&#8221;Filedata&#8221;][&#8221;tmp_name&#8221;], $uploadFile)) {<br />
chmod(dirname(__FILE__) . &#8220;/&#8221; . $uploadFile, 0777);<br />
print 1;<br />
}else{<br />
print 0;<br />
}<br />
?&gt;</p></blockquote>
<p>The code for coldfusion:</p>
<blockquote><p> <a href="http://www.asfusion.com/blog/entry/file-upload-with-coldfusion-flash-forms">is available here</a></p></blockquote>
<p>The code for asp:</p>
<blockquote><p>&lt;%@LANGUAGE=&#8221;VBSCRIPT&#8221; CODEPAGE=&#8221;1252&#8243;%&gt;<br />
&lt;%</p>
<p>Set theForm = Server.CreateObject(&#8221;ABCUpload4.XForm&#8221;)<br />
theForm.Overwrite = True &#8216; overwrite existing files<br />
.<br />
For Each theFile in theForm.Files<br />
If theFile.FileExists Then<br />
&#8216; save in virtual directory<br />
theFile.Save &#8220;temp\&#8221; &amp; theFile.FileName<br />
Response.Write(&#8221;1 &#8221; &amp; theFile.FileName)<br />
Else<br />
Response.Write(&#8221;0&#8243;)<br />
End If<br />
Next</p>
<p>Set theForm = nothing</p>
<p>%&gt;</p></blockquote>
<p>If you have any comments or questions please feel free to let us know… and<br />
Thanks for reading<br />
&#8230;Also, a tutorial on this is coming soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://protoflash.com/blog/2007/05/15/filebrowserclass/feed/</wfw:commentRss>
		</item>
		<item>
		<title>setInterval</title>
		<link>http://protoflash.com/blog/2007/05/07/setinterval/</link>
		<comments>http://protoflash.com/blog/2007/05/07/setinterval/#comments</comments>
		<pubDate>Mon, 07 May 2007 09:59:31 +0000</pubDate>
		<dc:creator>Protoflash</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://protoflash.com/blog/?p=3</guid>
		<description><![CDATA[    I have been a Flash developer for a number of years, but until recently, i have not come across the setInterval() function. I have used the onEnterFrame function before, and although it does work properly, you are limited to just repeating at the current frame rate. SetInterval on the other hand, [...]]]></description>
			<content:encoded><![CDATA[<p><code>    I have been a Flash developer for a number of years, but until recently, i have not come across the setInterval() function. I have used the onEnterFrame function before, and although it does work properly, you are limited to just repeating at the current frame rate. SetInterval on the other hand, allows for more flexibility by allowing you to specify in milliseconds exactly how much time you want between each repetition of a function.<br />
</code></p>
<blockquote><p><code>_root.onEnterFrame = function(){</code><br />
<code>    refresh();</code><br />
}</p></blockquote>
<p><code>    As you have probably already worked out, this code will run the function refresh() again and again every time the frame should be changed, even if there is only one frame in _root. However, the setInterval() will allow the user to define, exactly how often they want the function to repeat. For Instance: </code></p>
<blockquote><p><code>setInterval(doStuff, 2000,"doThis","doThat")<br />
function doStuff(a,b){<br />
trace (a)<br />
trace (b)<br />
}</code></p></blockquote>
<p><code>The Previous code will trace "doThis", and "doThat" once every 2000 miliseconds, or 2 seconds. Also, the Parameters for the setInterval() function are (functionName,timeInMilliseconds,anyParameters).<br />
</code></p>
<p>This Concludes our rundown on the setInterval() function.</p>
<p>If you have any comments or questions please feel free to let us know&#8230; and</p>
<p>Thanks for reading</p>
]]></content:encoded>
			<wfw:commentRss>http://protoflash.com/blog/2007/05/07/setinterval/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
