<?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>Web Design Dev &#187; creating flash websites</title>
	<atom:link href="http://www.webdesigndev.com/tag/creating-flash-websites/feed" rel="self" type="application/rss+xml" />
	<link>http://www.webdesigndev.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 16:30:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Flash Website Tutorial</title>
		<link>http://www.webdesigndev.com/flash/flash-website-tutorial</link>
		<comments>http://www.webdesigndev.com/flash/flash-website-tutorial#comments</comments>
		<pubDate>Sat, 28 Jun 2008 18:28:39 +0000</pubDate>
		<dc:creator>Web Design</dc:creator>
				<category><![CDATA[Flash Tutorials]]></category>
		<category><![CDATA[creating flash websites]]></category>
		<category><![CDATA[flash tutorial]]></category>
		<category><![CDATA[flash website]]></category>

		<guid isPermaLink="false">http://www.webdesigndev.com/?p=36</guid>
		<description><![CDATA[In this tutorial we will show you how you can make an advanced flash website with some great features. This tutorial covers pagetransitions, flash preloaders, disabled button and the first steps for tweening with actionscript 2.0.]]></description>
			<content:encoded><![CDATA[<h2>Creating a flash website using actionscript 2.0</h2>
<table width="264" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><img src="/flashwebsite/ico_cat_ps.gif" alt="" width="20" height="19" hspace="5" vspace="5" /></td>
<td><a href="/flashwebsite/layout.psd">Download PSD</a></td>
<td><img src="/flashwebsite/ico_cat_fl.gif" alt="" width="20" height="19" hspace="5" vspace="5" /></td>
<td><a href="/flashwebsite/1.fla">Download FLA </a></td>
</tr>
</tbody>
</table>
<p>Result of the <a title="flash website" href="http://www.webdesigndev.com/flash/learn-how-to-create-a-flash-website">flash website</a> tutorial, click to view in flash:</p>
<p><a href="/flashwebsite/1.swf" target="_blank"><img src="/flashwebsite/49.jpg" alt="" width="702" height="701" border="0" /></a></p>
<p>Before I begin &#8211; for those of you who want an easy way out of this tutorial, you can <a href="http://www.wix.com/amazingwebsites/editoreasy?utm_campaign=af_webdesigndev.com&amp;experiment_id=af_webdesigndev.com10" target="_blank">create a free  flash website with Wix</a> that will look like a very professional website. Now for those who are still interested in going through with the tutorial, I will continue.</p>
<h2>Step1 &#8211; Making a Flash Preloader</h2>
<p>Open a new flash file.</p>
<p><img src="/flashwebsite/1.jpg" alt="" width="656" height="424" /></p>
<p>And give it these settings.</p>
<p><img src="/flashwebsite/2.jpg" alt="" width="372" height="339" /></p>
<p>First we are going to make the preloader.<br />
Make a new movie clip. Insert &#8212;&gt;&gt; New Symbol (Ctrl+F8)</p>
<p><img src="/flashwebsite/3.jpg" alt="" width="414" height="139" /></p>
<p>Now you are in the preloader movie clip.</p>
<p>And make 3 layers with 100 frames. Name the maskT, text and textW.</p>
<p><img src="/flashwebsite/4.jpg" alt="" width="1025" height="180" /></p>
<p>Make another symbol and call it loading_mc.</p>
<p><img src="/flashwebsite/5.jpg" alt="" width="413" height="152" /></p>
<p>In that movie clip type in loading.</p>
<p><img src="/flashwebsite/6.jpg" alt="" width="678" height="145" /></p>
<p>Once you have made that movie clip then duplicate it. And call it loading1_mc.</p>
<p><img src="/flashwebsite/8.jpg" alt="" width="219" height="360" /></p>
<p>And in that movie clip make the text green.</p>
<p><img src="/flashwebsite/50.jpg" alt="" width="741" height="309" /></p>
<p>Now open your preloader_mc and drag the movie clip loading_mc on to the stage.<br />
Make sure that you are in the layer textW.</p>
<p>Don&#8217;t forget to center it on the stage.</p>
<p><img src="/flashwebsite/7.jpg" alt="" width="215" height="146" /></p>
<p>And in the layer called text you drag the loading1_mc into it. And center<br />
it.</p>
<p>Now in the first frame of the maskT layer we will draw a rectangle. Like<br />
this.</p>
<p><img src="/flashwebsite/9.jpg" alt="" width="678" height="193" /></p>
<p>Still in the maskT layer go to frame 100 and right click to convert to key<br />
frame.</p>
<p><img src="/flashwebsite/10.jpg" alt="" width="197" height="406" /></p>
<p>Now drag the rectangle on top of the text.</p>
<p><img src="/flashwebsite/11.jpg" alt="" width="153" height="98" /></p>
<p>Place your cursor in between frame 1 and 100 from the maskT layer, right click<br />
and add a motion tween.</p>
<p><img src="/flashwebsite/12.jpg" alt="" width="209" height="81" /></p>
<p>Now move with the cursor on the layer, right click and select mask.<br />
This will add the layer text under the mask.</p>
<p><img src="/flashwebsite/13.jpg" alt="" width="193" height="205" /></p>
<p>Now go back to your scene1 and change the name of the first layer to preloader.</p>
<p>Now drag your preloader_mc onto the stage.</p>
<p>While in the first layer press F9 to open up the actions window. Click on the movie<br />
clip in the stage and the paste this in the window.</p>
<p><img src="/flashwebsite/14.jpg" alt="" width="762" height="465" /><br />
<span style="color: #00cc00;"><br />
onClipEvent (load) {<br />
total = _root.getBytesTotal();<br />
}<br />
onClipEvent (enterFrame) {<br />
loaded = _root.getBytesLoaded();<br />
perc1ent = int(loaded/total*100);<br />
perc1 = &#8220;&#8221;+perc1ent+&#8221;%&#8221;;<br />
gotoAndStop(perc1ent);<br />
if (loaded == total) {<br />
_root.gotoAndPlay(2);<br />
}<br />
}</span></p>
<p>Now click on the layer and go to the actions window and give it this code</p>
<p><span style="color: #00cc00;">stop();</span></p>
<p>Now make a second layer and convert it to a key frame.(F6) and paste this code.</p>
<p>This code tells flash to check the bytes that are loaded .if it’s loaded then go<br />
to frame3 if not stay in frame 1.</p>
<p>You may think what happened to frame2 . Well you are in it.</p>
<p><span style="color: #00cc00;">if(_root.getBytesLoaded() ==<br />
_root.getBytesTotal()){<br />
gotoAndPlay(3);<br />
}<br />
else{<br />
gotoAndPlay(1);<br />
} </span></p>
<h2>Step 2 &#8211; Making the Smooth Page Transitions</h2>
<p>Start by importing your PSD to flash, if you do not know how to do this, read our <a title="Permanent Link to Importing Images in to Adobe Flash" href="http://www.webdesigndev.com/flash/importing-images-in-to-adobe-flash" rel="bookmark">Importing Images in to Adobe Flash Tutorial.<br />
</a><a><br />
href=&#8221;http://www.webdesigndev.com/flash/importing-images-in-to-adobe-flash&#8221;&gt;<br />
</a>Now make a new movie clip and name it content_mc. And drag the square<br />
on it.<br />
<img src="/flashwebsite/17.jpg" alt="" width="700" height="407" /></p>
<p>Now make a second layer in scene1 and call it content.<br />
Click on the third frame and press F6 to make it a key frame.</p>
<p>Now drag your content_mc to the stage and center it horizontal.</p>
<p><img src="/flashwebsite/16.jpg" alt="" width="701" height="706" /></p>
<p>Select frame 15 and convert it to a key frame. Now right click between frame<br />
3 and 15 and make a motion tween.</p>
<p>In frame 3 and change its brightness to -100%</p>
<p>lets make the pages first. the content to fill these is up to you. I will show<br />
you how to do those page transitions that so many people want to know.</p>
<p>I will show you a very easy way to do this.</p>
<p>Lets me the pages first . make a new movie clip and call it homePage_mc.</p>
<p>Make a layer for each thing that you add. Will be allotting better if you<br />
want to change some things later on.</p>
<p>I have 2 layers. a layer with bigger text and the some text to fill this page.</p>
<p><img src="/flashwebsite/28.jpg" alt="" width="623" height="290" /></p>
<p>Now change some text for the other pages . Since I don&#8217;t use this site I will<br />
only change the main text .</p>
<p>So you will see that the pages change. Once you made all the pages we will implant<br />
them into scene1.</p>
<p>So go to scene1 and add 2 new layers , call it <span style="color: #00cc00;">pages</span><br />
and the other 1 <span style="color: #00cc00;">actionsMain</span>.<br />
.<br />
First insert frames on frame 140 for the layers <span style="color: #00cc00;">content</span><br />
, <span style="color: #00cc00;">pages</span> and <span style="color: #00cc00;">actions.</span><br />
Add a <span style="color: #00cc00;">stop();</span> in the actionsmain on frame<br />
35.</p>
<p>In the pages layer you need to add key frames . So when we link the buttons<br />
that know where to go to.</p>
<p>Add key frame in the following frames : 35 , 45 , 54 , 59 , 69 , 78 , 82 , 92,<br />
101 , 105 , 115 , 124</p>
<p>Now do the same for the actions layer.</p>
<p>It should look like this.</p>
<p><img src="/flashwebsite/29.jpg" alt="" width="1149" height="38" /></p>
<p>In the pages layer select frame 35 . Now drag your homePage_mc on the stage and<br />
place it like this.</p>
<p><img src="/flashwebsite/31.jpg" alt="" width="701" height="419" /><br />
Copy frame 35 and paste in frames 45 and 54.</p>
<p>Now change the alpha of the movie clip homePage_mc to 0%.</p>
<p><img src="/flashwebsite/32.jpg" alt="" width="699" height="430" /><br />
Now right click between 35 and 45 and 45 &#8211;54 and add a motion tween.<br />
Like this.</p>
<p><img src="/flashwebsite/33.jpg" alt="" width="206" height="129" /></p>
<p>Add the other movie clips to the other key frames. After that you have this.</p>
<p><img src="/flashwebsite/34.jpg" alt="" width="1335" height="120" /><br />
Select your actionsmain layer and in the key frames 45 , 69 , 92 and 115 add a<br />
stop in your action script.<br />
This is to make sure that it doesn&#8217;t loop all the time.<br />
<span style="color: #00cc00;">stop(); </span><br />
And now label the frames.<br />
35 = <span style="color: #00cc00;">home</span><br />
59 = <span style="color: #00cc00;">about</span><br />
82 = <span style="color: #00cc00;">port</span><br />
105 = <span style="color: #00cc00;">contact</span></p>
<p>Now comes the tricky part. All the AS . you need to get this right or we will<br />
get allot of errors. <img src='http://www.webdesigndev.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /><br />
All of this will go in the actionsmain layer. . So when the page opens the<br />
buttons are already in pause state.<br />
<span style="color: black;">Code for frame 36</span><span style="color: #00cc00;"><br />
home_mc.gotoAndStop(&#8220;pause&#8221;);//if you hit this frame then the button<br />
will go to the pause state<br />
over1_btn.enabled= false ; //here you say that when you go over that button<br />
it can&#8217;t do anything</span></p>
<p>frame 60<br />
<span style="color: #00cc00;">about_mc.gotoAndStop(&#8220;pause&#8221;);<br />
over2_btn.enabled= false ; </span></p>
<p>frame 83<br />
<span style="color: #00cc00;">port_mc.gotoAndStop(&#8220;pause&#8221;);</span><br />
<span style="color: #00cc00;">over3_btn.enabled= false ;</span></p>
<p>frame 106 <span style="color: #00cc00;"><br />
contact_mc.gotoAndStop(&#8220;pause&#8221;);</span><br />
<span style="color: #00cc00;">over4_btn.enabled= false ;</span></p>
<p>Now we will tell flash were to go when a button is released. And we will give<br />
it a little timeout. If you put in 1000 then that’s 1 second.<br />
So we will give in 500 , that’s a half second.<br />
Code for frame 54<br />
<span style="color: #00cc00;">stop();</span></p>
<p><span style="color: #00cc00;">function moveOn()<br />
{<br />
gotoAndPlay(target);</span></p>
<div id="in_post_ad_middle_1" style="margin: 5px;padding: 0px;"><a href="http://www.wix.com/amazingwebsites/editoreasy?utm_campaign=af_webdesigndev.com&experiment_id=af_webdesigndev.com1middlepostnewLP" target="_blank" rel="nofollow">
<img src="http://www.webdesigndev.com/expressions_website3.gif" width="300" height="250" alt="create a free website" /></a></div><p>}<br />
setTimeout(this, &#8220;moveOn&#8221;, 500);// this will delay the transition<br />
by 1/2 second<br />
over1_btn.enabled= true ; //this will make sure that the button works again</p>
<p>home_mc.gotoAndPlay(&#8220;h2&#8243;); //and that the button play&#8217;s the rest<br />
of the animation</p>
<p><span style="color: black;">Frame 78 </span><span style="color: #00cc00;"><br />
stop();</span></p>
<p><span style="color: #00cc00;">function moveOn()<br />
{<br />
gotoAndPlay(target); //this is were the flash will go after you clicked a<br />
button </span></p>
<p><span style="color: #00cc00;">}<br />
setTimeout(this, &#8220;moveOn&#8221;, 500);<br />
over2_btn.enabled= true ;<br />
about_mc.gotoAndPlay(&#8220;h2&#8243;);</span></p>
<p><span style="color: black;">Frame 101</span><span style="color: #00cc00;"><br />
stop();</span></p>
<p><span style="color: #00cc00;">function moveOn()<br />
{<br />
gotoAndPlay(target);</span></p>
<p><span style="color: #00cc00;">}<br />
setTimeout(this, &#8220;moveOn&#8221;, 500);<br />
over3_btn.enabled= true ;<br />
port_mc.gotoAndPlay(&#8220;h2&#8243;);</span></p>
<p><span style="color: black;">Frame 124</span><span style="color: #00cc00;"><br />
stop();</span></p>
<p><span style="color: #00cc00;">function moveOn()<br />
{<br />
gotoAndPlay(target);</span></p>
<p><span style="color: #00cc00;">}<br />
setTimeout(this, &#8220;moveOn&#8221;, 500);<br />
over4_btn.enabled= true ;<br />
contact_mc.gotoAndPlay(&#8220;h2&#8243;);</span></p>
<p><span style="color: #00cc00;"><br />
</span><span style="color: black;">T</span><span style="color: black;">his is<br />
what you should have now.</span></p>
<p><img src="/flashwebsite/35.jpg" alt="" width="992" height="77" /></p>
<h2>Step 3 &#8211; Enable and Disable Buttons</h2>
<p>Again make a new symbol , and name it home_mc. Now make 4 layers. Call them left , right , text and actions.</p>
<p>In the text layer type in home and the select that text and press</p>
<p><img src="/flashwebsite/21.jpg" alt="" width="676" height="202" /></p>
<p>F8 to convert it to a movie clip. name this homeText_mc</p>
<p>Now in your movie clip home_mc Add this image. to layers left and right in<br />
the first frame.</p>
<p><img src="/flashwebsite/20.jpg" alt="" width="215" height="492" /></p>
<p>Convert it to a movie clip called indi_mc.</p>
<p>And place them on the side of the text.</p>
<p><img src="/flashwebsite/22.jpg" alt="" width="132" height="49" /></p>
<p>Add a key frame in frame 7 of the layers left and right.</p>
<p>Go back to the second frame and move the indi_mc away from the text by 15<br />
pox each. 1 to the left the other to the right.</p>
<p><img src="/flashwebsite/23.jpg" alt="" width="178" height="51" /></p>
<p>And give them in the first frame 0% alpha. Now copy these 2 frames and paste<br />
them in to frame14.</p>
<p>And give it a between the key frames a motiontween.</p>
<p><img src="/flashwebsite/25.jpg" alt="" width="638" height="58" /><br />
Now give frame 8 a key frame in the layers left , right and actions.</p>
<p>In the actions layer give in <span style="color: #00cc00;">stop();</span> in<br />
the first frame , frame 7 and give frame 1 label <span style="color: #00cc00;">h1</span><br />
, frame7 <span style="color: #00cc00;">pause</span> and frame 8<span><br />
style=&#8217;color:#00CC00&#8242;&gt;h2</span>.</p>
<p>You should have this now.</p>
<p><img src="/flashwebsite/36.jpg" alt="" width="274" height="78" /></p>
<p>Now you have to do the same with the other buttons.</p>
<p>When you have that then go to scene1 and add a folder. And call it buttons.</p>
<p><img src="/flashwebsite/37.jpg" alt="" width="163" height="102" /><br />
And add 8 layers and place them in that folder.</p>
<p>Now give them the names like below.</p>
<p><img src="/flashwebsite/38.jpg" alt="" width="241" height="171" /></p>
<p>Make key frames in these 8 layers . In frame 23.</p>
<p>Now drag the buttons you just made in the right layer. homeB = <span><br />
style=&#8217;color:#00CC00&#8242;&gt;home_mc</span> , aboutB = <span style="color: #00cc00;">about_mc</span><br />
, &#8230;.</p>
<p>And now drag the swirls into position. Select the each and give them these<br />
names and put them in the right layer.</p>
<p><img src="/flashwebsite/44.jpg" alt="" width="386" height="307" /></p>
<p><img src="/flashwebsite/39.jpg" alt="" width="701" height="706" /></p>
<p>Give these movie clips instance names. So that flash knows that you mean them<br />
in the action script.</p>
<p><img src="/flashwebsite/42.jpg" alt="" width="702" height="308" /></p>
<p>Do this for the other movie clips too. Name them the same as the movie clips.</p>
<p>Now we are going to make a button. Like this.</p>
<p><img src="/flashwebsite/40.jpg" alt="" width="159" height="175" /></p>
<p>Drag that button into the layer inviB in scene1.and place it right on top of<br />
the home_mc. Now copy and paste the button 3 more times and place</p>
<p>Them on top of the other 3 movie clips. And name them like below.</p>
<p><img src="/flashwebsite/41.jpg" alt="" width="293" height="254" /><br />
Now with those 4 buttons selected put the alpha to 0%.</p>
<p>Make a new layer on top of the rest and call it buttonactions. And give it<br />
this code.</p>
<p>I<br />
n this code you will say what flash needs to do when you go over , or press ,<br />
&#8230; a movie clip.</p>
<p><span style="color: #00cc00;">//button home_mc//<br />
over1_btn.onRelease = function(){<br />
play();<br />
target=&#8221;home&#8221;;<br />
}<br />
over1_btn.onRollOver = function(){<br />
home_mc.gotoAndPlay(&#8220;h1&#8243;);<br />
}<br />
over1_btn.onRollOut = function(){<br />
home_mc.gotoAndPlay(&#8220;h2&#8243;);<br />
}<br />
over1_btn.onReleaseOutside = function(){<br />
home_mc.gotoAndStop (&#8220;pause&#8221;);<br />
}<br />
//button about_mc//<br />
over2_btn.onRelease = function(){<br />
play();<br />
target=&#8221;about&#8221;;<br />
}<br />
over2_btn.onRollOver = function(){<br />
about_mc.gotoAndPlay(&#8220;h1&#8243;);<br />
}<br />
over2_btn.onRollOut = function(){<br />
about_mc.gotoAndPlay(&#8220;h2&#8243;);<br />
}<br />
over2_btn.onPress = function(){<br />
about_mc.gotoAndStop (&#8220;pause&#8221;);<br />
}</span></p>
<p><span style="color: #00cc00;">//button port_mc//<br />
over3_btn.onRelease = function(){<br />
play();<br />
target=&#8221;port&#8221;;<br />
}<br />
over3_btn.onRollOver = function(){<br />
port_mc.gotoAndPlay(&#8220;h1&#8243;);<br />
}<br />
over3_btn.onRollOut = function(){<br />
port_mc.gotoAndPlay(&#8220;h2&#8243;);<br />
}<br />
over3_btn.onReleaseOutside = function(){<br />
port_mc.gotoAndStop (&#8220;pause&#8221;);<br />
}<br />
//button contact_mc//<br />
over4_btn.onRelease = function(){<br />
play();<br />
target=&#8221;contact&#8221;;<br />
}<br />
over4_btn.onRollOver = function(){<br />
contact_mc.gotoAndPlay(&#8220;h1&#8243;);<br />
}<br />
over4_btn.onRollOut = function(){<br />
contact_mc.gotoAndPlay(&#8220;h2&#8243;);<br />
}<br />
over4_btn.onReleaseOutside = function(){<br />
contact_mc.gotoAndStop (&#8220;pause&#8221;);<br />
}</span></p>
<p>Let’s make the animation when the buttons enter the screen.</p>
<p>Select the topL_mc and place it right above your screen.And place the<br />
buttomL_mc right under it.</p>
<p><img src="/flashwebsite/45.jpg" alt="" width="385" height="361" /></p>
<p>Now add a key frame in frame 33 for those 2 layers .In frame 33 move them on<br />
how they were from the beginning.</p>
<p>Click between frame 23 and 33 and a motiowtween.</p>
<p>Now for the mask. add a key frame in 23 and draw a rectangle that will cover<br />
your buttons.</p>
<p><img src="/flashwebsite/46.jpg" alt="" width="262" height="250" /></p>
<p>Make a key frame in 33 and go back to 23 and place it like this.</p>
<p><img src="/flashwebsite/47.jpg" alt="" width="335" height="427" /></p>
<p>And add a motiontween.</p>
<p>Now for the last piece . The header/logo. You can use any logo or banner you<br />
want . This is to show you how you can tween with AS.</p>
<p>So take the logo and make it a movie clip.</p>
<p>And call it logo_mc</p>
<p><img src="/flashwebsite/43.jpg" alt="" width="387" height="355" /></p>
<p>Make a new layer in scene1. make a key frame in frame 10 and drag Logo_mc<br />
into the stage and place it on the left side.</p>
<p>Take a look on the Y axis.</p>
<p><img src="/flashwebsite/48.jpg" alt="" width="447" height="414" /></p>
<p>Select the logo and press F9 to open Up the actions window. And give this code.</p>
<p>The first part will tell the movie clip where to start. and the second 1 will<br />
say where to stop.</p>
<p><span style="color: #00cc00;">onClipEvent (load) {<br />
//here you say where to start<br />
this._y = -170;<br />
}<br />
onClipEvent (enterFrame) {<br />
//this will tell the As on were to stop the animation. the 25 is what speed<br />
you want it to move.<br />
if (this._y&lt;100) {<br />
this._y += 25;<br />
}</span></p>
<p>}</p>
<p>SO , press Ctrl+enter and you are done.</p>
<p>You should have learned some new but very simple things that you can use to<br />
make your own site. If you feel like this is too much work, you can <a href="http://www.wix.com/amazingwebsites/editoreasy?utm_campaign=af_webdesigndev.com&amp;experiment_id=af_webdesigndev.com" target="_blank">create a free professional flash website with Wix</a>.</p>
<p>Visit later for more <a title="Flash tutorials" href="http://www.webdesigndev.com/flash/learn-how-to-create-a-flash-website">Flash tutorials</a>.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.webdesigndev.com/flash/flash-website-tutorial/feed</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: basic
Object Caching 398/410 objects using disk: basic

Served from: www.webdesigndev.com @ 2012-02-13 00:48:14 -->
