<?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>TAZ: TheTAZZone Network &#187; flash tutorials</title>
	<atom:link href="http://www.thetazzone.com/category/security-tutorials/flash-tutorials-security-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetazzone.com</link>
	<description>Welcome to Internet Chaos: 960+ Games; Security, Networking, and General Tutorials; IRC Chat; and an Active Forum Community</description>
	<lastBuildDate>Mon, 22 Mar 2010 09:36:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tutorial &#8211; Advanced loader (flash mx)</title>
		<link>http://www.thetazzone.com/tutorial-advanced-loader-flash-mx/</link>
		<comments>http://www.thetazzone.com/tutorial-advanced-loader-flash-mx/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 02:04:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[flash tutorials]]></category>
		<category><![CDATA[general tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=826</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=896">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=896#">Select all</a></dt>
<dd><code>This tutorial is the original work of Valhallen. He has kindly allowed us to host his work on The TAZ.<br />
</code></dd>
</dl>
<p>OK been a while since have written a tut so here goes&#8230;..</p>
<p>I have posted a previous tut on creating a preloader in flash which checked frames loaded but I thought I would right a more advanced one that checks BytesLoaded against BytesTotal and also incorporates a loading bar and percent loaded figure to give people viewing your file an idea of how long is left till its all loaded&#8230;..ok on with the tutorial &#8211; I am going to assume that your familiar with the Flash MX enviroment and are able to use the basic tools as well as give objects instance names&#8230;&#8230;</p>
<p>right lets set the scene</p>
<p>your preloader is going to need 3 layers &#8211; I&#8217;m going to name them</p>
<p>Loader</p>
<p>Text</p>
<p>Actions</p>
<p>now the Loader layer is going to contain the actual loading bar and the precent box so lets start with it&#8230;..</p>
<p>create a new rectangle with the border and fill set at the same color. Now select the border and make it a graphic (windows press F8 ) called container.</p>
<p>Now select the fill and convert it to a movie clip (F8 again) called bar &#8211; now you need to give it an instance name as well so we can refer to it in our action code later&#8230;&#8230;.to give something an instance name select it and down in the bottom left of the properties bar you should see a text box for instance name&#8230;.write it in there. We also need to make sure that it registration point is at the far left. A registration point is the lil white dot when u click on the movie clip.</p>
<p>To do this select the bar mc (movie clip) and hold shift drag it to the left so that the lil white dot is level with the far left of the container. now you should see that the container is half filled and half not (its sticking out the left) so double click on the bar mc to edit and move the fill so that is once gain filling the entire container</p>
<p>now on your text layer add your text &#8211; you know something like now loading<br />
usual kinda thing&#8230;..</p>
<p>thats the main thing set up so lets get down to the action scripting&#8230;&#8230;</p>
<p>ok gonna scare you now and paste the entire code but don&#8217;t worry will go thro it after<br />
this code all goes inside the first frame on your actions layer&#8230;.</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=896#">Select all</a></dt>
<dd><code>stop();<br />
myInterval = setInterval(preloader, 10);<br />
function preloader(){<br />
if (getBytesLoaded()&gt;=getBytesTotal()){<br />
play();<br />
clearInterval(myInterval);<br />
}<br />
bar._xscale = (getBytesLoaded()/getBytesTotal())*100;<br />
}</code></dd>
</dl>
<p>right aint that complex&#8230;..lets break it down</p>
<p><span style="color: red;">stop();</span> self explanitary, stops the movie so it doesn&#8217;t go on until all the criteria have been met &#8211; in this case BytesLoaded is equal to BytesTotal</p>
<p><span style="color: red;">myInterval = setInterval(preloader, 10); </span>this tells it to call it every 10 milliseconds</p>
<p><span style="color: red;">if (getBytesLoaded()&gt;=getBytesTotal()){</span> this simply means if The Bytes Loaded is more than or equal to the Total Bytes then carry out the next action&#8230;.</p>
<p>which is&#8230;.</p>
<p><span style="color: red;">play();<br />
clearInterval(myInterval);</span> simple enough plays the movie &#8211; the clear interval just gets rid of the myInterval now we dont need it as its all loaded&#8230;.</p>
<p><span style="color: red;">bar._xscale = (getBytesLoaded()/getBytesTotal())*100;</span> controls the x scale of the bar mc depending upon Bytes Loaded divided by Bytes Total multiplied by 100</p>
<p>ok give it a shot &#8211; put some large graphic or something in the next scene so it has something to load and then go to control &gt; Test Movie<br />
now you need to see it as you would on the web so select view &gt; show streaming<br />
you can alter the conection speed to test under debug</p>
<p>right so all good so far the more loaded the bigger the bar gets right lets add our percentage box&#8230;..</p>
<p>on your loader layer draw a dynamic text box and call it myTextField (once agin in the instance box)<br />
now we just need to add a lil bit more code&#8230;..</p>
<p>in the code you just entered place after&#8230;.</p>
<p><span style="color: red;">bar._xscale = (getBytesLoaded()/getBytesTotal())*100;</span></p>
<p>this code&#8230;.</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=896#">Select all</a></dt>
<dd><code>myTextField.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+"%";</code></dd>
</dl>
<p>this just tells the flash movie what it should show in the text box in this case Bytes Loaded divided by Bytes Total multiplied by 100 and then after that a precentage sign.</p>
<p>ok so your complete code should now look like this&#8230;.</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=896#">Select all</a></dt>
<dd><code>stop();<br />
myInterval = setInterval(preloader, 10);<br />
function preloader(){<br />
if (getBytesLoaded()&gt;=getBytesTotal()){<br />
play();<br />
clearInterval(myInterval);<br />
}<br />
bar._xscale = (getBytesLoaded()/getBytesTotal())*100;<br />
myTextField.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+"%";<br />
}</code></dd>
</dl>
<p>give it another test same as before &#8211; there ya go</p>
<p>well hope that was helpful to someone</p>
<p>v_Ln</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-advanced-loader-flash-mx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; ToolTips (flash MX)</title>
		<link>http://www.thetazzone.com/tutorial-tooltips-flash-mx/</link>
		<comments>http://www.thetazzone.com/tutorial-tooltips-flash-mx/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 02:03:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[flash tutorials]]></category>
		<category><![CDATA[general tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=824</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=895">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=895#">Select all</a></dt>
<dd><code>This is the original work of Valhallen, whom has allowed The TAZ to host his work on our site.<br />
Please find the original here:<br />
http://www.antionline.com/showthread.php?s=&amp;threadid=246123 </code></dd>
</dl>
<p>OK this is tutorial is written by me but has been adapted from script taken from ActionScript for Flash MX (book) by Friends of ED</p>
<p>Ok basically what I am going to show you is a way of creating a dragable movieclip in Flash MX that in conjuction with flash&#8217;s ability to record collisions can be used to create a help function type tooltip</p>
<p>Now yes I know it could be done using the on(Rollover) function as well but this is just to show a different way and also to give some people a taste of dragable movieclips (mc) and detecting collisions&#8230;.</p>
<p>Ok first of all lets set up the movie</p>
<p>Open a new flash document and create 2 layers named Graphics &amp; Actions</p>
<p>Ok the graphics layer is going to hold your dragable movieclip and the buttons and the top layer is going to be just for your actions.</p>
<p>Now your going to need two mc&#8217;s in your graphics area one will be your Hit area and the other your dragable mc</p>
<p>give your hitarea the instance name hitarea<br />
and your dragable mc the instance name Ques01</p>
<p>The hit area mc can contain whatever you want &#8211; in the example .fla is just text but you can place a button anything in it</p>
<p>The Ques01 must have a dynamic text field in it to display your tooltip</p>
<p>ok now lets add your code to the top layer</p>
<p><span style="color: blue;">tooltip = function () {</span><br />
<span style="color: red;">this.onPress = function() {<br />
this.startDrag(&#8221;");<br />
this.onMouseMove = function() {<br />
updateAfterEvent();<br />
};<br />
};<br />
this.onRelease = function() {<br />
this.stopDrag();<br />
this.onMouseMove = undefined;<br />
[color=green]};<br />
this.onReleaseOutside = function() {<br />
this.stopDrag();</span> };<br />
this.onEnterFrame = function() {<br />
this.coll = &#8220;&#8221;;<br />
if (this.hitTest(&#8221;_root.hitarea&#8221;)) {<br />
this.coll = &#8220;links&#8221;;[/color]<br />
<span style="color: indigo;"> }<br />
};<br />
};<br />
tooltip.apply(ques01);</span></p>
<p>ok the blue part of the code defines a new function called tooltip<br />
the red sets up the dragable mc<br />
the Green tells it to display the text links whenever a collision is detected over the hitarea<br />
&amp; the purple area of the code tells it to apply the rules set out in the function tooltip to the mc called Ques01</p>
<p>test your movie when you click and drag the mc Ques01 over the hit area it should display the text links</p>
<p>ok I know I aint gone into it into too much depth but it should be enough to get you started if you want to add multiple hit areas then you need to alter your code slightly</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=895#">Select all</a></dt>
<dd><code>if (this.hitTest("_root.hitarea")) {<br />
this.coll = "links";<br />
}</code></dd>
</dl>
<p>just alter this code and place it after the original for example if we had 3 hit areas labeled hitarea, hitarea2 &amp; hitarea3 then our code would be&#8230;..</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=895#">Select all</a></dt>
<dd><code>if (this.hitTest("_root.hitarea")) {<br />
this.coll = "links";<br />
}<br />
if (this.hitTest("_root.hitarea2")) {<br />
this.coll = "links 2";<br />
}<br />
if (this.hitTest("_root.hitarea3")) {<br />
this.coll = "links 3";<br />
}</code></dd>
</dl>
<p>the _root tells flash that the mc it is looking for is on the main time line &#8211; if your movie clip was inside another which was on the main timeline the code would look something like _root.firstclip.yourclip</p>
<p>thanks</p>
<p>v_Ln</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-tooltips-flash-mx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; Find the Mouse Location in Flash (5 &amp; MX)</title>
		<link>http://www.thetazzone.com/tutorial-find-the-mouse-location-in-flash-5-mx/</link>
		<comments>http://www.thetazzone.com/tutorial-find-the-mouse-location-in-flash-5-mx/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 02:01:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[flash tutorials]]></category>
		<category><![CDATA[general tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=822</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>With kind permission from Valhallen we are glad to be able to host this tutorial of his on The TAZ.<br />
</code></dd>
</dl>
<p>Ok this tut will use the old Flash 5 way of coding (may work in earlier versions to tho not sure) simply for the fact I taught myself in Flash 5 and have still not completly transfered to Flash MX coding</p>
<p>Ok basically what this will allow you to do is have a cross hair follow the mouse around the screen &#8211; in the example I have used it to find locations on a map but really is just to show you a little of how to use flash&#8217;s ability to move movieclips (mc) depending on mouse postion.</p>
<p>In the example you can see there are 5 main elements</p>
<p>Crosshair</p>
<p>Vertical bar</p>
<p>Horiz bar</p>
<p>Map</p>
<p>I know I said 5 and there are only 4 there but the crosshair is actiualy made of tewo parts the inner circle and the lines.</p>
<p>ok lets set up our movie -<br />
your gonna need 8 layers :::</p>
<p>Map</p>
<p>Border</p>
<p>Horiz bar</p>
<p>Vert bar</p>
<p>circle</p>
<p>lines</p>
<p>Buttons</p>
<p>actions</p>
<p>ok the first 2 are self explanitary as is the two bars (just make sure they are long enough) also as we will be applying actionscript to the bars please make sure they are movieclips</p>
<p>the circle and lines mc&#8217;s will contain the animation for when you mouse over an active area</p>
<p>the first frame in each mc should be when it is at rest make sure to also add a</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>stop();</code></dd>
</dl>
<p>function on the first frame<br />
now animate it when you rollover and rollout making sure to add another stop at the end of the rollover animation (not following me &#8211; take a look at the .fla while reading this tutorial for a better idea)</p>
<p>ok once you have your mc made add them to the main timeline on the correct layers (by giving everything its own labeled layer and mc now it makes editing one element at a later time alot easier and is good practice for when you try more advanced flash projects)</p>
<p>right now we got to add our buttons &#8211; i drew roughly round the different areas on the map but if you want (and are better at geography than me) you could add lil dots for actual places etc</p>
<p>once you have your buttons made set their alpha to 0 (unless you want them to be seen)</p>
<p>ok time to add our code :::</p>
<p>click once on the horiz bar mc and add this code</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>onClipEvent (enterFrame) {<br />
_y += (_parent._ymouse-_y);<br />
}</code></dd>
</dl>
<p>This tells flash to move the mc along with the mouse along the Y axis</p>
<p>ok now the vert bar :::</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>onClipEvent (enterFrame) {<br />
_x += (_parent._xmouse-_x);</code></p>
<p>}</p>
</dd>
</dl>
<p>exactly same thing but now is getting postion along X axis</p>
<p>ok adding the code to our circle and lines mc is just the same except we need it to get both the X &amp; Y postions &#8211; the code for both movies is the same</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>onClipEvent (enterFrame) {<br />
_x += (_parent._xmouse-_x);<br />
_y += (_parent._ymouse-_y);<br />
}</code></dd>
</dl>
<p>dont forget to give your mc&#8217;s instance names (i just used circle &amp; lines) as we will be refering to them in our code a little later</p>
<p>now we have got to tell the flash movie what to do when you move over one of our buttons</p>
<p>the code is the same for all the buttons :::</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>on(rollover){<br />
_root.circle.gotoAndPlay(2);<br />
_root.lines.gotoAndPlay(2);<br />
}<br />
on(rollout){<br />
_root.circle.gotoAndPlay(6);<br />
_root.lines.gotoAndPlay(8);<br />
}</code></dd>
</dl>
<p>now the frame numbers are just waht i used in my .fla and these will need to be changed depending upon the set up og your own mc&#8217;s</p>
<p>a quick break down of the code :::</p>
<p>on(rollout){ &#8211; tells flash to perform the following function when the mouse is placed over the button</p>
<p>_root.circle.gotoAndPlay(6); &#8211; this means that flash is to look for the mc (instance) name circle and go to the 6 frame and play</p>
<p>simple</p>
<p>***Flash Mx only***<br />
I&#8217;m not sure as I have not tested but if you wanted to code it in flash MX i think instead of placing the rollover &amp; rollout code on each button you could use</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>display = function () {</code></dd>
</dl>
<p>and then define the function before using</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>display.apply(button);</code></dd>
</dl>
<p>to attach the function to each button?</p>
<p>****End of Flash MX only****</p>
<p>Ok if you test it now you should see that the horiz line, vert line and both mc&#8217;s follow the cursor but lets get rid of the cursour as well</p>
<p>in your actions layer place the following code</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=894#">Select all</a></dt>
<dd><code>Mouse.hide();<br />
stop();</code></dd>
</dl>
<p>so there you go thats it now there are other things that could be done with this &#8211; add a mc at the bottom to display different flags depending what country you are over etc &#8211; it could even be used as the basis of a lash shooting game!!</p>
<p>v_Ln</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-find-the-mouse-location-in-flash-5-mx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; Displaying Date/Time in Flash MX</title>
		<link>http://www.thetazzone.com/tutorial-displaying-datetime-in-flash-mx/</link>
		<comments>http://www.thetazzone.com/tutorial-displaying-datetime-in-flash-mx/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 01:56:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[flash tutorials]]></category>
		<category><![CDATA[general tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=820</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=893">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<p>[code]Valhallen had very kindly allowed us to host his tutorial on The TAZ.</p>
<p>Enjoy!<br />
[/code]</p>
<p>Ok now this is not the easiest way of doing this in Flash Mx but it does use the new switch function so thought would let everyone see it<br />
original tut is at -&gt; [url]http://www.actionscript.org/tutoria&#8230;ime/index.shtml[/url]</p>
<p>thought I would rewrite it to make it a bit easier to understand and also add some extra functionality to it&#8230;&#8230;</p>
<p>ok so lets start your new movie ::::</p>
<p>first create a new movieclip called date_mc &#8211; this will hold your actual display so in it create a dynamic text box called date_txt</p>
<p>set the proporties (text font/color etc) and then name it as date_txt &#8211; this is done in the proporties menu were it says var</p>
<p>ok now still in your date_mc create a new keyframe on frame 2 &#8211; change the date_txt&#8217;s name in this frame (not first one) to date_txt2</p>
<p>ok now drag an instance of this movieclip onto the main timeline &#8211; give it an instance name of date_mc</p>
<p>ok almost done now just to make our button &#8211; create a new layer above the one holding date_mc and use the fill rectangle tool to draw a large rectangle covering your date_mc &#8211; set line to off and pick any color you wish &#8211; doesn&#8217;t matter wont be seen.</p>
<p>Now select the rectangle and convert it to a button (press F8 in windows) called date_btn &#8211; now set its instance name to the same (date_btn) and then change its alpha (in proporties menu) to 0% so is invisible</p>
<p>ok now for the code ::::</p>
<p>in the date_mc movieclip insert a stop action on frame 1 like so</p>
<p>[code]stop(); [/code]</p>
<p>and then on your main timeline create a new layer called actions and insert this code :::</p>
<p>code:&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;[code]function howlong(arg) {<br />
if (length(arg)==1) {<br />
arg = "0" + arg;<br />
return arg;<br />
}<br />
else {<br />
arg = arg;<br />
return arg;<br />
}<br />
}<br />
myDate = new Date();</p>
<p>hr = howlong(String(myDate.getHours()));<br />
mnt = howlong(String(myDate.getMinutes()));</p>
<p>daytext = myDate.getDay();<br />
dd = myDate.getDate();<br />
mm = myDate.getMonth();<br />
yyyy = myDate.getFullYear();</p>
<p>switch (daytext) {<br />
case 0:	daytext = "Sunday";<br />
break;<br />
case 1:	daytext = "Monday";<br />
break;<br />
case 2:	daytext = "Tuesday";<br />
break;<br />
case 3:	daytext = "Wednesday";<br />
break;<br />
case 4:	daytext = "Thursday";<br />
break<br />
case 5:	daytext = "Friday";<br />
break;<br />
case 6:	daytext = "Saturday";<br />
break<br />
}</p>
<p>switch (mm) {<br />
case 0:		mm = "January";<br />
break;<br />
case 1:		mm = "February";<br />
break;<br />
case 2:		mm = "March";<br />
break;<br />
case 3:		mm = "April";<br />
break;<br />
case 4:		mm = "May";<br />
break<br />
case 5:		mm = "June";<br />
break;<br />
case 6:		mm = "July";<br />
break<br />
case 7:		mm = "August";<br />
break<br />
case 8:		mm = "September";<br />
break<br />
case 9:		mm = "October";<br />
break<br />
case 10:	mm = "November";<br />
break<br />
case 11:	mm = "December";<br />
break<br />
}</p>
<p>_root.date_mc.date_txt = (hr + ":" + mnt)<br />
_root.date_mc.date_txt2 = (daytext + "," + dd + " " + mm + " " + yyyy)</p>
<p>date_btn.onRollOver = function(){<br />
_root.date_mc.gotoAndStop(2);<br />
}<br />
date_btn.onRollOut = function(){<br />
_root.date_mc.gotoAndStop(1);<br />
}<br />
[/code]</p>
<p>ok the code is pretty much self explanitary &#8211; and is explained here -&gt; [url]http://www.actionscript.org/tutoria&#8230;ime/index.shtml[/url]</p>
<p>but i will go over the changes i made ::: the last part</p>
<p>[code]_root.date_mc.date_txt = (hr + ":" + mnt)<br />
_root.date_mc.date_txt2 = (daytext + "," + dd + " " + mm + " " + yyyy)</p>
<p>date_btn.onRollOver = function(){<br />
_root.date_mc.gotoAndStop(2);<br />
}<br />
date_btn.onRollOut = function(){<br />
_root.date_mc.gotoAndStop(1);<br />
}<br />
[/code]</p>
<p>as you can see the original tut just had a static display showing date/time &#8211; now i have altered it so that time is displayed until you mouseover and then it switches to date &#8211; this is easily done</p>
<p>the first 2 lines assign the values to the 2 different txt fields<br />
then the button actions tell it which frame in date_mc to look at &#8211; now because the different txt fields are on different frames only one is visible either date/time</p>
<p>could also have been done using visible = false;</p>
<p>eg ::::</p>
<p>code:&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;[code]date_btn.onRollOver = function(){<br />
date_txt._visible = false;<br />
date_txt2._visible = true;<br />
}<br />
[/code]</p>
<p>but i like to keep everything neatly in its own movieclips</p>
<p>v_Ln</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-displaying-datetime-in-flash-mx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; Create an Old Style Movie in Flash</title>
		<link>http://www.thetazzone.com/tutorial-create-an-old-style-movie-in-flash/</link>
		<comments>http://www.thetazzone.com/tutorial-create-an-old-style-movie-in-flash/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 01:53:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[flash tutorials]]></category>
		<category><![CDATA[general tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=817</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=892">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=892#">Select all</a></dt>
<dd><code>This tutorial is written by Valhallen who has kindly allowed us to host it on the TAZ in the hope it may benifit members of our community!<br />
</code></dd>
</dl>
<p>I haven&#8217;t written anything for a while so I thought i&#8217;d do YET ANOTHER Flash Tutorial<br />
In this tutorial I&#8217;ll describe how to make an old movie style effect like the one seen here in my web-site intro&#8230;am afraid however that due to a hosting problem the rest of the site is down atm but I hope to get it back up very soon<br />
Anyways on with the tutorial</p>
<p>Create your flash movie</p>
<p>Insert a new layer above the rest used in your movie</p>
<p>Create a new movie clip and name it speckles</p>
<p>Create another new movie clip and call it dots</p>
<p>Ok now in the speckles movie clip draw well your speckles obviously &#8211; not too many as you don&#8217;t want your movie to look too crowded&#8230;..</p>
<p>Do the same for the dots movieclip</p>
<p>Now place both movieclips in your new layer outside of the movie&#8230;.</p>
<p>Click on speckles and give it an instance name &#8211; I&#8217;ll just call it speckles again</p>
<p>Open the actions panel and insert this actionscript&#8230;.</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=892#">Select all</a></dt>
<dd><code>onClipEvent(load){<br />
if (this._name&lt;&gt;"speckles"){<br />
this._x=random(600);<br />
this._y=random(400);<br />
deedee=random(100);<br />
this._xscale=deedee;<br />
this._yscale=deedee;<br />
}<br />
}</code></dd>
</dl>
<p>don&#8217;t forget to change the instance name in bold to whatever you have called it and the numbers in blue to the dimensions of your movie clip</p>
<p>now you need to create another new movieclip name it actions<br />
this movieclip does not need anythign inside it as it will simply control our speckles action.</p>
<p>Place a copy of actions in the layer outside of the movie same as you have done for speckles and open the actions panel<br />
insert this actionscript</p>
<p>code:&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=31&amp;t=892#">Select all</a></dt>
<dd><code>onClipEvent(enterFrame){<br />
for (l=0; l&lt;=2; l++)<br />
{<br />
_root.speckles.duplicateMovieClip( "speckles"+l, l+1);<br />
}<br />
if (l=2){<br />
l=0;<br />
}<br />
}<br />
</code></dd>
</dl>
<p>remember once again to change the name in bold</p>
<p>Now just do the same for the dots movie clip</p>
<p>You will need a new action movieclip as well tho</p>
<p>!! Remember to change the instance letter in the actionscript !!</p>
<p>the instance letter is in blue and needs to be different for each movieclip!</p>
<p>Also by changing the number in green you can alter the number of copies of the movieclip that appear on screen at any one time.</p>
<p>well hope somebody found this of use =^_^=</p>
<p>v_Ln</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-create-an-old-style-movie-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
