<?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>Free Flash Tutorials at FlashMint Tuts &#187; flash components</title>
	<atom:link href="http://tuts.flashmint.com/tag/flash-components/feed/" rel="self" type="application/rss+xml" />
	<link>http://tuts.flashmint.com</link>
	<description>Advanced Flash Tutorials and tips</description>
	<lastBuildDate>Wed, 17 Mar 2010 14:16:09 +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>Creating Contact Module Tutorial with AS3</title>
		<link>http://tuts.flashmint.com/creating-contact-module-tutorial-with-as3/</link>
		<comments>http://tuts.flashmint.com/creating-contact-module-tutorial-with-as3/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 13:33:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Tutorials]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[contact module]]></category>
		<category><![CDATA[flash components]]></category>
		<category><![CDATA[flash tutorials overview]]></category>
		<category><![CDATA[flash xml]]></category>

		<guid isPermaLink="false">http://tuts.flashmint.com/?p=403</guid>
		<description><![CDATA[Do you want to create a Contact Module using popular scripts? In this tutorial, we&#8217;ll create a Advanced Contact Module with ActionScript 3.0 &#8211; XML and PHP. Don&#8217;t worry! You don&#8217;t need to know PHP Script. During the tutorial, I&#8217;ll explain you coding and designing parts of the creation process. Also, we will use XML [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-404" title="preview" src="http://tuts.flashmint.com/wp-content/uploads/preview2.jpg" alt="" width="220" height="137" />Do you want to create a Contact Module using popular scripts? In this tutorial, we&#8217;ll create a Advanced Contact Module with ActionScript 3.0 &#8211; XML and PHP. Don&#8217;t worry! You don&#8217;t need to know PHP Script.  During the tutorial, I&#8217;ll explain you coding and designing parts of the creation process. Also, we will use XML to make an easy upgrade. The Module can be improved and used each project. The Steps are very easy. Just follow the steps carefully and apply them. </p>
<p><span id="more-403"></span></p>
<h3>Step 1: Preparing The Folder</h3>
<p>First, Create a new folder called &#8220;AS3 Contact Module&#8221; Open the new blank projects like the following:</p>
<p>1. Contact.fla &#8211; Flash Project</p>
<p>2. Contact.html &#8211; HTML Page to show swf file.</p>
<p>3. Contact.swf &#8211; Main Swf File</p>
<p>4. contactImg.jpg &#8211; The image of The Module</p>
<p>5. ContactPHP &#8211; PHP Script</p>
<p>6. ContactXML &#8211; XML Script</p>
<p><img class="size-full wp-image-408 alignnone" src="http://tuts.flashmint.com/wp-content/uploads/17.jpg" alt="" width="513" height="113" /></p>
<h3>Step 2: Flash Project</h3>
<p>Open a new AS3 Project File. You can see the properties of the project below.</p>
<p><img class="alignnone size-full wp-image-411" src="http://tuts.flashmint.com/wp-content/uploads/24.jpg" alt="" width="274" height="354" /></p>
<h3>Step 3: Background Properties</h3>
<p>Select Rectangle Tool (or Press &#8220;R&#8221;) and create a rectangle without outline. The size of the rectangle can be changed. Now, Crop the rectangle like the following and reduce the alpha value to 20. Align it at the top of the module.</p>
<p><img class="alignnone size-full wp-image-412" src="http://tuts.flashmint.com/wp-content/uploads/34.jpg" alt="" width="547" height="305" /></p>
<h3>Step 4: XML Text Fields</h3>
<p>Create 2 dynamic texts to type the information of the module. They use XML File to call texts.  You can see their instance names below. I&#8217;ll give the actionscript explanations at the end of the designing.</p>
<p><img class="alignnone size-full wp-image-413" src="http://tuts.flashmint.com/wp-content/uploads/44.jpg" alt="" width="714" height="411" /></p>
<h3>Step 5: Import The Image</h3>
<p>Go to &#8220;Insert &gt; New Symbol&#8221;. Create a new blank MovieClip. Move it to the stage from library. Apply the properties like the following.</p>
<p><img class="alignnone size-full wp-image-414" src="http://tuts.flashmint.com/wp-content/uploads/55.jpg" alt="" width="720" height="413" /></p>
<h3>Step 6: Contact Form</h3>
<p>Now, We can start to create contact form. Let&#8217;s start with the background of the input text. Press &#8220;R (Rectangle Tool)&#8221; and draw a shape. The size of the shape is 200&#215;20. Then fill the shape with this colours: Main Color: #252525, Outline Color: #333333. If you want, you can add a drop shadow effect.</p>
<p><img class="alignnone size-full wp-image-415" src="http://tuts.flashmint.com/wp-content/uploads/64.jpg" alt="" width="708" height="411" /></p>
<h3>Step 7: Input Texts</h3>
<p>Input text allows you to type text and show them. Therefore, we must use them in our contact form. Create 4 input texts and 1 dynamic text. Align them according to the backgrounds. You can see the properties below.</p>
<p><img class="alignnone size-full wp-image-416" src="http://tuts.flashmint.com/wp-content/uploads/74.jpg" alt="" width="716" height="416" /></p>
<h3>Step 8: Send Button</h3>
<p>To use &#8220;Submit Function&#8221; we must create a button. You can use same background to create it. Use a static text to show &#8220;SEND&#8221; text. Because we will not change it.</p>
<p><img class="alignnone size-full wp-image-417" src="http://tuts.flashmint.com/wp-content/uploads/82.jpg" alt="" width="712" height="411" /></p>
<h3>Step 9: Coding The Design</h3>
<p>We have just finished the designing.I will explain the actionscript in the code area. Now, We can start to write the codes. Let&#8217;s start with XML Actions. Type these codes to the first frame.</p>
<pre>/*To Define The Main Varibles*/
var urlLoader:URLLoader = new URLLoader();
var imgLoader:Loader = new Loader();
var loadFunction:URLLoader=new URLLoader  ;

/*XML Request*/
function XMLFunction(XMLPath:String):void {
    urlLoader.load(new URLRequest(XMLPath));
	urlLoader.addEventListener(Event.COMPLETE, onSuccess);
}
//The Name of the XML File
XMLFunction("ContactXML.xml");

/*XML - Flash Actions*/
//We'll define "info, title and image" varibles to use them in XML File.
function onSuccess(e:Event):void {
	var xml:XML=new XML(e.target.data);
	contactInfo.htmlText=xml.info;//We use HTML to show any type of texts
	contactInfo.autoSize=TextFieldAutoSize.LEFT;//AutoSize-Left
	contactTitle.htmlText=xml.title;
	contactTitle.autoSize=TextFieldAutoSize.LEFT;
    imgLoader.load(new URLRequest(xml.@image));
	imageMc.addChild(imgLoader);
}
</pre>
<h3>Step 10: Coding The Design</h3>
<p>To show and hide input text. The codes are same but we have to change them because we want to show different text on the input texts.</p>
<pre>/*Focus In - Focus Out*/
/*An object dispatches a FocusEvent object when the user changes the focus
from one object in the display list to another.*/

//Name Text Actions
nameText.text="NAME";
nameText.addEventListener(FocusEvent.FOCUS_IN, focusInName);
nameText.addEventListener(FocusEvent.FOCUS_OUT, focusOutName);

function focusInName(evt:Event) {
	if (nameText.text=="NAME") {
		nameText.text="";
	}
}

function focusOutName(evt:Event) {
	if (nameText.text=="") {
		nameText.text="NAME";
	}
}

//E-Mail Text Actions
emailText.text="E-MAIL";

emailText.addEventListener(FocusEvent.FOCUS_IN, focusInEmail);
emailText.addEventListener(FocusEvent.FOCUS_OUT, focusOutEmail);

function focusInEmail(evt:Event) {
	if (emailText.text=="E-MAIL") {
		emailText.text="";
	}
}

function focusOutEmail(evt:Event) {
	if (emailText.text=="") {
		emailText.text="E-MAIL";
	}
}

//Subject Functions
subjectText.text="SUBJECT";

subjectText.addEventListener(FocusEvent.FOCUS_IN, focusInSubject);
subjectText.addEventListener(FocusEvent.FOCUS_OUT, focusOutSubject);

function focusInSubject(evt:Event) {
	if (subjectText.text=="SUBJECT") {
		subjectText.text="";
	}
}

function focusOutSubject(evt:Event) {
	if (subjectText.text=="") {
		subjectText.text="SUBJECT";
	}
}

//Message Functions
messageText.text="MESSAGE";

messageText.addEventListener(FocusEvent.FOCUS_IN, focusInMessage);
messageText.addEventListener(FocusEvent.FOCUS_OUT, focusOutMessage);

function focusInMessage(evt:Event) {
	if (messageText.text=="MESSAGE") {
		messageText.text="";
	}
}

function focusOutMessage(evt:Event) {
	if (messageText.text=="") {
		messageText.text="MESSAGE";
	}
}
</pre>
<h3>Step 11: Coding The Design</h3>
<p>To communicate between Flash and PHP.</p>
<pre>/*/PHP - Flash Actions/*/

//Make a PHP Script Request to Post to the server

var urlRequest:URLRequest=new URLRequest("ContactPHP.php"); //The Name of the PHP Script
urlRequest.method=URLRequestMethod.POST;

//Send Button
sendBtn.addEventListener(MouseEvent.CLICK, SubmitFunction);

/*Text Field Validation*/
function SubmitFunction(e:MouseEvent):void {
	if (nameText.text == "NAME" || emailText.text == "E-MAIL" ||
	subjectText.text == "SUBJECT" || messageText.text == "MESSAGE" ) {
		resultText.text="PLEASE FILL OUT ALL REQUIRED FIELDS";

	} else if ( !emailValidate(emailText.text) ) {
		resultText.text="VALID E-MAIL ADDRESS.";//If E-Mail field is empty the e-mail will not be sent.
	} else {
		resultText.text="SENDING...";//If everything is correct the message'll be sent.

		var dataEmail:String = "name=" + nameText.text
		   + "&amp;email=" + emailText.text
		   + "&amp;subject=" + subjectText.text
		   + "&amp;message=" + messageText.text;
</pre>
<h3>Step 12: Coding The Design</h3>
<p>E-Mail Validation Actions.</p>
<pre>function emailValidate(s:String):Boolean {
	var p:RegExp=/(\w|[_.\-])+@((\w|-)+\.)+\w{2,4}+/;
	var r:Object=p.exec(s);
	if (r==null) {
		return false;
	}
	return true;
}
</pre>
<h3>Step 13: Coding The Design</h3>
<p>I&#8217;m going on with the URL Actions.</p>
<pre>/*URL Actions*/

var URLvariables:URLVariables=new URLVariables(dataEmail);

URLvariables.dataFormat=URLLoaderDataFormat.TEXT;
urlRequest.data=URLvariables;
loadFunction.load(urlRequest);
loadFunction.addEventListener(Event.COMPLETE, responseFunction );
	}
}

/*Status of the E-Mail*/

function responseFunction(e:Event):void {
	var loader:URLLoader=URLLoader(e.target);
	var emailStatus=new URLVariables(loader.data).success;
	//If E-Mail is sent successfully, the visitor'll see this message.
	if (emailStatus=="yes") {
		resultText.text="THANK YOU! YOUR MESSAGE WAS SENT SUCCESSFULLY.";
		//If E-Mail can not be sent, the visitor'll see this message.
	} else {
		resultText.text="AN ERROR OCCURED!";
	}
}
</pre>
<h3>Step 14: Creating XML File</h3>
<p>To show the text on the Flash, we must create a XML File. Open XML File you saved and type these codes. You can change the information.</p>
<p><img class="alignnone size-full wp-image-418" src="http://tuts.flashmint.com/wp-content/uploads/92.jpg" alt="" width="783" height="227" /></p>
<h3>Step 15: Creating PHP File</h3>
<p>To send visitor information you have to have a e-mail account. Open PHP Script you saved. Change the &#8220;emailAddress and siteName&#8221; with yours. The PHP Script contains an automatic response system.</p>
<pre>&lt;?php

//Type the receiever's e-mail address
$emailAddress = "info@email.com";
//Type your Site Name
$siteName = "Company Name";

$contact_name = $_POST['name'];
$contact_email = $_POST['email'];
$contact_subject = $_POST['subject'];
$contact_message = $_POST['message'];

if( $contact_name == true )
{
	$sender = $contact_email;
	$receiver = $emailAddress;
	$client_ip = $_SERVER['REMOTE_ADDR'];

	$email_body = "The Name Of The Sender: $contact_name \nEmail: $sender \n\nSubject: $contact_subject
\n\nMessage: \n\n$contact_message \n\nIP ADDRESS: $client_ip \n\n$siteName";

	$emailAutoReply = "Hi $contact_name, \n\nWe have just received your E-Mail. We will get
in touch in a few days. Thank you!  \n\n$siteName ";

	$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
	$autoReply = "From: $receiver\r\n" . "Reply-To: $receiver \r\n" . "X-Mailer: PHP/" . phpversion();

	mail( $sender, "Auto Reply: $contact_subject", $emailAutoReply, $autoReply );

	if( mail( $receiver, "New E-Mail - $contact_subject", $email_body, $extra ) )
	{
		echo "success=yes";
	}
	else
	{
		echo "success=no";
	}
}

?&gt;
</pre>
<h3>Conclusion</h3>
<p>Congrulations!You&#8217;re done! You can test your movie. You have created a contact module with ActionScript 3.0, XML and PHP. Everything is ready. You must only send the folder to your server and start to use.</p>
<p><strong>Here&#8217;s how your new amazing contact form should look:</strong></p>
<p><img class="alignnone size-full wp-image-424" src="http://tuts.flashmint.com/wp-content/uploads/contact-screenthos.jpg" alt="" width="701" height="396" /></p>
<p>You can also <strong>check the form in action</strong> <a href="http://tuts.flashmint.com/wp-content/uploads/contact-form/Contact.html" target="_blank">here</a>.</p>
<p>If you have any question, please leave a reply here. I hope you enjoyed this tutorial and thanks for reading!</p>
<div id="fb-like" style=""><iframe src="http://www.facebook.com/plugins/like.php?href=http://tuts.flashmint.com/creating-contact-module-tutorial-with-as3/&amp;layout=button_count&amp;show_faces=false&amp;width=50&amp;action=like&amp;font=&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:50px; height:25px"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://tuts.flashmint.com/creating-contact-module-tutorial-with-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create A Simple Image Gallery In Flash CS4</title>
		<link>http://tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-flash-cs4/</link>
		<comments>http://tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-flash-cs4/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 13:04:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Tutorials]]></category>
		<category><![CDATA[flash components]]></category>
		<category><![CDATA[flash gallery]]></category>

		<guid isPermaLink="false">http://tuts.flashmint.com/?p=130</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<table width="100%" border="0" cellspacing="10 cellpadding="0">
<tr>
<td>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery3_565718416"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery3.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery3.swf"
			name="fm_imagegallery3_565718416"
			width="400"
			height="300">
	<!--<![endif]-->
		<br />

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object></td>
<td valign="top">In this tutorial we will show you how to create a <strong>simple image gallery with thumbnails in Flash CS4</strong>. We will apply a couple of simple, yet nice transitions to the images and thumbnails. This will require you to get the hands a bit dirty in animation and action scripting. However, this is going to be easy and fun! So here we go.</td>
</tr>
</table>
<p><span id="more-130"></span><br />
<h3>Step 1.</h3>
<p>Create a new file with ActionScript 3.0 and modify the document like it&#8217;s shown on the screenshot below. You can enter the document properties via the admin panel (follow the highlights in red) or pressing <strong>Ctrl+J</strong>.</p>
<p style="text-align: center;"><img class="size-full wp-image-131 aligncenter" title="1c" src="http://tuts.flashmint.com/wp-content/uploads/1c.jpg" alt="1c" width="600" height="326" /></p>
<h3>Step 2.</h3>
<p>Add four images from your computer to your library. To do this press <strong>File =&gt; Imort =&gt; Import to library</strong>. You can also import the images directly to the stage, by pressing <strong>Ctrl+R</strong>.</p>
<p>Next, create three new layers and give them the names <strong>Buttons</strong>,<strong> Images</strong> and <strong>Actions</strong>. To rename a layer, double click on it and type the text.  See the shot below.</p>
<p style="text-align: center;"><img class="size-full wp-image-132 aligncenter" title="2c" src="http://tuts.flashmint.com/wp-content/uploads/2c.jpg" alt="2c" width="600" height="372" /></p>
<p>Notice that the first frame of each layer has a small circle on it. This is a <em>blank keyframe</em>. Once you put anything on the stage, the circle transforms into black dot which corresponds to the <em>filled keyframe</em>.</p>
<p>Go to the Buttons layer and select the first frame on the timeline. <strong>Drag the images from your library to the stage</strong> (in case you haven&#8217;t imported them right to the stage already) and modify their size to <strong>114&#215;85 px</strong>. Be sure to drag the images to our document area which we&#8217;ve made black earlier.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/3c.jpg"><img class="size-full wp-image-133 aligncenter" title="3c" src="http://tuts.flashmint.com/wp-content/uploads/3c.jpg" alt="3c" width="600" height="289" /></a></p>
<p>Now you have your thumbnails on the stage. Set image alignment selecting <strong>Align</strong> in <strong>Window menu</strong>, or just press <strong>Ctrl+K</strong>. Align pics to the bottom and distribute horizontal center like it&#8217;s shown below.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/4c.jpg"><img class="size-full wp-image-134 aligncenter" title="4c" src="http://tuts.flashmint.com/wp-content/uploads/4c.jpg" alt="4c" width="600" height="328" /></a></p>
<h3>Step 3.</h3>
<p>Our thumbnails are going to be buttons, so now we need to convert the images into the Button symbols. Using the<strong> Selection Tool</strong>, right click on the first thumbnail image and choose <strong>&#8220;Convert to Symbol&#8221;</strong>, or simply hit <strong>F8</strong>. In the opened window set the type Button and name the symbol <strong>btn1</strong>. Click &#8220;OK&#8221; to save the changes. Do this for the other three images and give them the names <strong>btn2</strong>, <strong>btn3</strong> and <strong>btn4</strong>, respectively.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/5c.jpg"><img class="size-full wp-image-135 aligncenter" title="5c" src="http://tuts.flashmint.com/wp-content/uploads/5c.jpg" alt="5c" width="600" height="425" /></a></p>
<p>Now we have to give each of these the same <em>Instance Name</em> which is a name to refer to your symbol or object in ActionScript. Instance Name can be set in the Properties panel which you can enter by selecting the necessary object on the stage. Instance Name of the <strong>btn1</strong> button will be <strong>btn1</strong> and so forth.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/6c.jpg"><img class="size-full wp-image-136 aligncenter" title="6c" src="http://tuts.flashmint.com/wp-content/uploads/6c.jpg" alt="6c" width="300" height="155" /></a></p>
<p>Right click on the first frame of the Buttons layer, select <strong>Copy Frames</strong>, go to the fourth frame and <strong>Paste Frames</strong> the same way. Or you can just drag the first frame up to the fourth cell to copy it. You timeline should have the following look by now.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/7c.jpg"><img class="size-full wp-image-137 aligncenter" title="7c" src="http://tuts.flashmint.com/wp-content/uploads/7c.jpg" alt="7c" width="600" height="392" /></a></p>
<h3>Step 4.</h3>
<p>OK, let&#8217;s put the images that we will be exactly viewing in our gallery. Switch to the <strong>Images layer</strong> and select the first frame on the timeline. Drag the image that corresponds to the first thumbnail from your library to the stage. Size it down to the <strong>358&#215;268 px</strong> and set its position to the <strong>93&#215;18</strong>. Of course, you may set your own dimensions and place the pictures whatever you like; this is just what we use for this tutorial.</p>
<p>Insert three more blank keyframes (<strong>F6</strong>) and do the same operation with the rest of the images.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/8c.jpg"><img class="size-full wp-image-138 aligncenter" title="8c" src="http://tuts.flashmint.com/wp-content/uploads/8c.jpg" alt="8c" width="600" height="363" /></a></p>
<p>Now go back to the timeline, select the first frame and go to the Properties panel. Here we will set the <em>Frame Label</em>. It&#8217;s important to remember about this because we&#8217;re going to reference frame labels in the ActionScript later. We&#8217;ve got four frame labels: <strong>model</strong>, <strong>dreamy</strong>, <strong>dancing </strong>and<strong> teacher</strong>, respectively.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/9c.jpg"><img class="size-full wp-image-139 aligncenter" title="9c" src="http://tuts.flashmint.com/wp-content/uploads/9c.jpg" alt="9c" width="600" height="360" /></a></p>
<h3>Step 5.</h3>
<p>So far we&#8217;ve got a thumbnail gallery where each of the thumbs is a button. Our next step is to <strong>add some action script</strong> so we could click on the button to play the right frame. Go to the <strong>Actions layer</strong> and drag the first frame up to the fourth cell. Your timeline should have the following look by this moment:</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/10c.jpg"><img class="size-full wp-image-140 aligncenter" title="10c" src="http://tuts.flashmint.com/wp-content/uploads/10c.jpg" alt="10c" width="300" height="258" /></a></p>
<p>Go back to the first frame in the Actions layer and hit <strong>F9</strong> to open the <strong>Actions window</strong>. Copy and paste the following code into your Actions window. Don&#8217;t worry, we will explain in great detail what happens shortly.<br />
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><span class="kw7">stop</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
btn1<span class="sy0">.</span><span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play1<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">function</span> play1<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span> <span class="br0">&#40;</span><span class="st0">&quot;young&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span>
btn2<span class="sy0">.</span><span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play2<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">function</span> play2<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span> <span class="br0">&#40;</span><span class="st0">&quot;thoughtful&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span>
btn3<span class="sy0">.</span><span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play3<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">function</span> play3<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span> <span class="br0">&#40;</span><span class="st0">&quot;dancing&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span>
btn4<span class="sy0">.</span><span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play4<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">function</span> play4<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span> <span class="br0">&#40;</span><span class="st0">&quot;old&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span></pre></div></div><br />
After you have copied and pasted the above code, go to <strong>Control =&gt; Test Movie</strong> or press <strong>Ctrl + Enter</strong> to see the result gallery. Here is what you should get:</p>
<p style="text-align: center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery_16072236"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery.swf"
			name="fm_imagegallery_16072236"
			width="400"
			height="300">
	<!--<![endif]-->
		  
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Let&#8217;s look closer at what you&#8217;ve just done and learn more about AS functions.  The first thing you see in your code window is Stop action.</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><span class="kw7">stop</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>Any effect you create in Flash repeats continuously when you test or publish your movie. Stop action is used to actually stop it from looping. You can apply the Stop action to any keyframe and the movie will stop playing at that exact point.</p>
<p>The next code line is</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;">btn1<span class="sy0">.</span> <span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play1<span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>This script means that <strong>btn1</strong>, our instance name, referring to the first button in our thumbnail gallery, is responding to a mouse click and calls for the function <strong>play1</strong>.</p>
<p>And here goes the definition of that function</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><span class="kw3">function</span> play1<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span><span class="br0">&#40;</span><span class="st0">&quot;model&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span></pre></div></div>
<p>In this line:</p>
<ul>
<li><em><strong>function play1</strong></em> tells us the name of the function;</li>
<li><em><strong>(event:MouseEvent)</strong></em> defines the type of the event , which is interaction with the mouse here,</li>
<li> <em><strong>void</strong></em> is a special type used to specify that the function doesn&#8217;t return any data;</li>
<li> <em><strong>gotoAndStop (&#8220;model&#8221;)</strong></em> causes the playhead to jump to the frame model and stops from progressing further.</li>
</ul>
<p>All right, this is the initial script that allows our image gallery to work properly. As you see, this piece of code repeats for the rest of the buttons, we <strong>change only instance names and frame labels</strong>.</p>
<h3>Step 6.</h3>
<p>To add some spice to our images when they come in, let&#8217;s learn how to animate them in Flash CS4.</p>
<p>So, go up to your <strong>Images layer</strong> and select the first frame. To be able to add some animation to our images, we need to convert them to movie clip symbols. To do this hit <strong>F8</strong> and select <strong>Movie Clip</strong> in the Type menu. Repeat this operation for each of the four images. Let the names be <strong>movie1</strong>, <strong>movie2</strong>, <strong>movie3</strong> and <strong>movie4</strong>.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/11c.jpg"><img class="size-full wp-image-141 aligncenter" title="11c" src="http://tuts.flashmint.com/wp-content/uploads/11c.jpg" alt="11c" width="600" height="450" /></a></p>
<p>Choose the Selection tool from your toolbar and <strong>double click on the first movie clip</strong> we&#8217;ve just created. Now we can animate it.</p>
<p>Right click on the movie clip on the stage and select <strong>Create Motion Tween</strong>.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/12c.jpg"><img class="size-full wp-image-142 aligncenter" title="12c" src="http://tuts.flashmint.com/wp-content/uploads/12c.jpg" alt="12c" width="600" height="331" /></a></p>
<p>You can see that it automatically inserts some frames; the number of frames inserted depends on your frame rate. By default Flash CS4 has a frame rate of 24 frames per second. So basically you have the number of frames that would equal one second. Let&#8217;s <strong>cut it down to 15 frames per second</strong> &#8211; just drag the border of the 24th frame down to the one we need.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/13c.jpg"><img class="size-full wp-image-143 aligncenter" title="13c" src="http://tuts.flashmint.com/wp-content/uploads/13c.jpg" alt="13c" width="600" height="146" /></a></p>
<p>Now<strong> let&#8217;s create a sleek fade-in effect</strong> by means of some color effects and motion tween. Select the image on the stage while the playhead is on the last frame. Go to the object properties, choose <strong>Alpha</strong> in the <strong>Style menu</strong> and put it 0%.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/14c.jpg"><img class="size-full wp-image-144 aligncenter" title="14c" src="http://tuts.flashmint.com/wp-content/uploads/14c.jpg" alt="14c" width="600" height="336" /></a></p>
<p>Move the playhead back and forth and you will see that <strong>we&#8217;ve created a fade-out effect</strong> for our image &#8211; it&#8217;s completely transparent on the last keyframe. Right click anywhere on the motion tween area and select <strong>Reverse Keyframes</strong>. Now we have the fade-in effect applied to the picture.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/15c.jpg"><img class="size-full wp-image-145 aligncenter" title="15c" src="http://tuts.flashmint.com/wp-content/uploads/15c.jpg" alt="15c" width="600" height="246" /></a></p>
<p>Click <strong>Ctrl+Enter</strong> to test your movie. You should see something like this:</p>
<p style="text-align: center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery11_1726532673"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery11.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery11.swf"
			name="fm_imagegallery11_1726532673"
			width="400"
			height="300">
	<!--<![endif]-->
		
<p style="text-align: center;">
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Movie plays over and over again and we don&#8217;t want this loop happen. Stop action comes in handy here. Return to your movie clip window, right click on the motion tween area and select <strong>Convert to Frame by Frame Animation</strong>. Then go to the last frame and hit <strong>F9</strong>. Type <strong><em>stop()</em></strong> in the Actions window and that should fix the problem.</p>
<p>Here is the result:</p>
<p style="text-align: center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery21_491666533"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery21.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery21.swf"
			name="fm_imagegallery21_491666533"
			width="400"
			height="300">
	<!--<![endif]-->
		
<p style="text-align: center;">
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<h3>Step 7.</h3>
<p>Another cute effect we&#8217;re going to apply is <strong>rollover</strong>. Wouldn&#8217;t it be nice to have the thumbnails change a bit when the mouse hovers over? And that&#8217;s pretty easy to do, here we go!</p>
<p>Double click on the first button in the thumbnail line, which is <strong>btn1</strong>. You can see four frames on your timeline &#8211; <strong>Up</strong>, <strong>Over</strong>, <strong>Down</strong> and <strong>Hit</strong>. These are the states of our button.</p>
<ul>
<li>The <strong><em>Up</em></strong> frame is the inactive stage when nothing is happening, the button is displayed as it is.</li>
<li>The <strong><em>Over</em></strong> is the stage when the mouse hovers over the button.</li>
<li>The <strong><em>Down</em></strong> frame is the stage when the button is clicked on.</li>
<li>The purpose of the <em><strong>Hit</strong></em> frame is to define the clickable area or the coordinates of the button.</li>
</ul>
<p>So, insert blank keyframes (<strong>F6</strong>) into each of the frames.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/16c.jpg"><img class="size-full wp-image-146 aligncenter" title="16c" src="http://tuts.flashmint.com/wp-content/uploads/16c.jpg" alt="16c" width="600" height="323" /></a></p>
<p>Go to the Over and select the button on the stage. In order to modify the way it is rendered, we need to convert it into a graphic symbol. Press <strong>F8</strong> and select <strong>Graphic</strong> in the Type menu. Now go to the object properties and do some changes to the color effect. You may do whatever you want, we changed the RGB parameters, for example (see the screenshot below).</p>
<p>Switch to the Down frame and apply some effects if you want the button to change its state when you click on it. In this case, we&#8217;ve added more red to it.</p>
<p>Move on to the Hit area and using the <strong>Rectangular Tool</strong> draw an area you want to be clickable on your button.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/17c.jpg"><img class="size-full wp-image-147 aligncenter" title="17c" src="http://tuts.flashmint.com/wp-content/uploads/17c.jpg" alt="17c" width="600" height="346" /></a></p>
<p>Repeat this step for the other three buttons and press <strong>Ctrl+Enter</strong> to see the result. It should be similar to this:</p>
<p style="text-align: center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery3_2015798987"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery3.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery3.swf"
			name="fm_imagegallery3_2015798987"
			width="400"
			height="300">
	<!--<![endif]-->
		
<p style="text-align: center;">
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>This is it, folks. Now you know how to create a simple image gallery with thumbnails and spice it with some nice effects. If you have any questions, please leave them in comments.</p>
<div id="fb-like" style=""><iframe src="http://www.facebook.com/plugins/like.php?href=http://tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-flash-cs4/&amp;layout=button_count&amp;show_faces=false&amp;width=50&amp;action=like&amp;font=&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:50px; height:25px"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-flash-cs4/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>How to Edit Flash XML Template</title>
		<link>http://tuts.flashmint.com/how-to-edit-flash-xml-template/</link>
		<comments>http://tuts.flashmint.com/how-to-edit-flash-xml-template/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:30:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Tutorials]]></category>
		<category><![CDATA[flash components]]></category>
		<category><![CDATA[flash templates]]></category>
		<category><![CDATA[flash xml]]></category>

		<guid isPermaLink="false">http://tuts.flashmint.com/?p=93</guid>
		<description><![CDATA[If you seek to create a flash website with minimal expenses, buying or downloading a free flash template is probably the best solution for you. Though, any template demands customization. The least you need to do with is insert your logo, contact info, text and pictures. But it is also very likely that you will [...]]]></description>
			<content:encoded><![CDATA[<div>If you seek to create a <a href="http://www.flashmint.com/" target="_self">flash website</a> with minimal expenses, buying or downloading a free flash template is probably the best solution for you. Though, any template demands customization. The least you need to do with is insert your logo, contact info, text and pictures. But it is also very likely that you will need to make some changes in the menu structure (add or remove some components), you might want to change some of the colors, i.e. button colors, colors on the background or anything else.<br />
If you don&#8217;t want to pay for customization you can do it yourself, all you need to know for this are just some basic steps.<br />
This tutorial was written especially for you, so that you don&#8217;t have to pay money for <a href="http://www.flashmint.com/show-type-flash.html" target="_self">flash templates</a> customization and don&#8217;t get lost in your xml files when trying to do it yourself.<br />
As an example I&#8217;ve taken one of the Flash Mint website templates, and I shall use it as an example for you, so that you can understand what I will be talking about.<br />
As you purchase or download a flash template you receive it as a template package which consists of all the template-related files, including source code files and content. After you have figured out what changes you want to do about your template, you need to open this folder. All the changes you need will be done with the files in this folder.</div>
<div><span id="more-93"></span></div>
<div>
<p><strong>Website structure (main menu)</strong><br />
The structure of your flash template is determined in XML file. Mine is called &#8220;structure&#8221;, yours might have a different but still somewhat similar to this name. This document lists all the components of the main menu, as well as the sub menu components. If you want to delete, add or change elements from the main menu you need  to:<br />
1. Open the structure xml file.<br />
2. To delete one of the menu elements you need to find this item in the code. Then highlight this piece of code and press delete. For example, to delete the News section from my main menu I highlight the whole phrase in the code that describes this element and delete it.<br />
<strong><span>Template file folder</span></strong><strong><span> →</span></strong><strong><span> Structure file → </span><span class="m">&lt;</span><span class="t">item</span> <span class="t">name</span><span class="m">=&#8221;</span></strong><strong>NEWS</strong><strong><span class="m">&#8220;</span> <span class="m">&#8230; /&gt; </span><span>→ DELETE</span></strong><br />
3. To add an element to the main menu, first you have to add the same piece of code as for the other elements, only with the item name you need. Save the file.<br />
<strong><span>Structure file → </span><span class="m">&lt;</span><span class="t">item</span> <span class="t">name</span><span class="m">=&#8221;</span></strong><strong>NEW BUTTON</strong><strong><span class="m">&#8220;</span> <span class="m">&#8230; /&gt; </span><span>→ INSERT</span></strong><br />
4. But in such a way you will add only a new button to the main menu. It will lead you to the same page where the button you&#8217;ve copied the code from did. To make it lead to another page you need to create one. The easiest way to do it is to use a sample of the existing one (like if you need a second news block to show not only company news, but world news as well) or to buy a flash component  and simply insert it to your website (for example, you&#8217;ve purchased a template and you want to have an event planner on it).<br />
<strong><span>Template file folder </span>→ </strong><strong><span>NEW BUTTON FOLDER </span></strong><strong>→ </strong><strong>INSERT</strong><br />
To make your main menu button lead where you need, you have to write a new path to it. To do this, in the phrase you&#8217;ve inserted you need to change the value for componentPath and componentSWF. The new componentPath value will be a name of the new folder you need to insert into your folder with template files. If you have purchased a new flash component, you can insert the folder with this component files. If you are adding an element  similar to one of the existing ones, you can copy and rename its folder, and then customize the content of it according to the steps described below.<br />
<span>Structure File </span><strong>→ </strong><span class="m">&lt;</span><span class="t">item</span> <span class="t">name</span><span class="m">=&#8221;</span><strong>NEW BUTTON</strong><span class="m">&#8220;</span><span class="t"> type</span><span class="m">=&#8221;</span><strong>component</strong><span class="m">&#8220;</span><span class="t"> componentPath</span><span class="m">=&#8221;</span><strong>NEW BUTTON</strong><span class="m">&#8220;</span><span class="t"> componentSWF</span><span class="m">=&#8221;</span><strong>newbutton.swf</strong><span class="m">&#8220;</span><span class="t"> visible</span><span class="m">=&#8221;</span><strong>true</strong><span class="m">&#8221; /&gt;</span><br />
5. If you only need to change the name for one of the existing buttons, you can do it simply by giving a new value to <span>&lt;item name=&#8221;NEW NAME&#8221;.</span><br />
<em><strong>Colors of the main menu</strong></em><br />
If you need to change the colors of the main menu buttons, find a file in the template file folder, called colors. This file must be in the main folder, not in one of the component folders, as it describes properties of the main menu. To do the changes you need to put a new value for the color tag that describes the color of a certain element. The value is usually described by a special code, assigned to each of the web colors.<strong><br />
<span>Template file folder </span></strong><strong>→ colors file </strong><strong>→ </strong><strong><span class="m">&lt;</span><span class="t">buttons</span> <span class="t">mouseOver</span><span class="m">=&#8221;</span></strong><strong>0xa000d4&#8243;&#8230;/&gt;</strong><br />
<strong> <em>Logo </em></strong><br />
To put your logo on the template you need to put new logo picture into the folder instead of the old one. Mine is in the folder called Images.  Make sure the size and image type fits.<br />
<strong>Template file folder</strong> <strong>→ Images </strong><strong>→ Insert new image</strong></p>
<p><strong><br />
Homepage <a href="http://tuts.flashmint.com/wp-content/uploads/homepage.jpg"><img class="alignright size-full wp-image-94" title="homepage" src="http://tuts.flashmint.com/wp-content/uploads/homepage.jpg" alt="homepage" width="470" height="457" /></a></strong><br />
The homepage of my template is a slide show of pictures, where I have three pictures changing each other with a certain delay. I can substitute these pictures with the ones I need.<br />
1. First of all, I&#8217;ve got to look through files and folders in my template file folder  and find out where the pictures form my home page are. I&#8217;ve found mine in a folder called &#8220;Gallery&#8221;. It includes three pictures that I can see on my homepage as a slide show.<br />
To change the pictures to different ones I can put new pictures into my folder with pictures. To make them show up instead of the old ones, I need to put the names of these pictures into the code.<br />
<strong>Template file folder → Gallery </strong><strong>→ insert new images</strong><br />
2.If you want to have more pictures, you can just copy the code that inserts one (or more) picture, insert it once more and add the names of the pictures you want to show up.<br />
3.Now I need to find a code file describing how these pictures substitute each other and what is the delay time. In my template file folder there is a folder called data. It contains an XML file called &#8220;Gallery&#8221;. This file describes what pictures and how often appear on my homepage and other pages of my website as a background.<br />
4. To change the delay (make pictures change more/less often)  you just need to change the value for delay in this code file. The delay value is measured in seconds, so you can put &#8220;12&#8243;, &#8220;5&#8243;, &#8220;30&#8243; or any other number.<br />
<strong>Template file folder → Data </strong><strong>→ Gallery file </strong><strong>→</strong><strong> &lt;image &#8230;&#8230;delay=&#8221;new value&#8221;&#8230;/&gt;</strong><br />
6. Do not forget to save the code file each time you&#8217;ve done the changes, in other way they will not be applied.</p>
<p><strong></strong></div>
<div><strong>Slide show <a href="http://tuts.flashmint.com/wp-content/uploads/slide-show.jpg"><img class="alignright size-full wp-image-95" title="slide-show" src="http://tuts.flashmint.com/wp-content/uploads/slide-show.jpg" alt="slide-show" width="470" height="381" /></a></strong></div>
<div>
<p>1. My template includes a slide show component. If yours does not and you need it, you can get one from Flash Mint&#8217;s <a href="http://www.flashmint.com/show-type-flash-components.html" target="_self">flash components</a> gallery. Anyway, you will definitely need to customize this component, because you need to put your photos into the slide show. You might also want to change the background color and the color of buttons or the picture title.<br />
2. To do anything about your slide show you need to open a folder that has all the files describing your slide show. In my template files folder I have a slide show folder, it contains a folder with the pictures, an xml file that describes the order in which the pictures appear and one more xml file that describes the colors set for various elements in slide show.</p>
<p>3.  To change the pictures I need to add new pictures in the folder where the old ones are. Do not forget to re-size your pictures so that they fit.<br />
<strong>Template file folder </strong><strong>→ Slideshow folder </strong><strong>→ Items </strong><strong>→ insert new pictures</strong><br />
4. Then you need to put the names of these pictures into the code that describes the order of the pictures.<br />
<strong>Template file folder </strong><strong>→ Slideshow folder </strong> <strong>→ slideshow xml file </strong><strong>→ </strong><span class="m">&lt;</span><span class="t">item</span> <span class="t">image</span><span class="m">=&#8221;</span><strong>items/new image name.jpg</strong><span class="m">&#8221; /&gt;</span><br />
5. If you want to change anything about the colors you can open the XML file which describes the colors for this section of template and do the changes. For my template I can change the background color, the color of buttons and the main title color. To do this I need to put a new value for the color tag that describes the color of a certain element. The value is usually described by a special code. Such codes are assigned to all of the web colors. You can look up the one you need, for instance, <a id="na6d" title="here" href="http://www.computerhope.com/htmcolor.htm">here</a>.<br />
<strong>Template file folder </strong><strong>→ Slideshow folder</strong> <strong>→ colors xml file </strong><strong>→ new color numbers</strong></p>
<p><strong>News <a href="http://tuts.flashmint.com/wp-content/uploads/news.jpg"><img class="alignright size-full wp-image-96" title="news" src="http://tuts.flashmint.com/wp-content/uploads/news.jpg" alt="news" width="470" height="307" /></a></strong><br />
The news section is probably the one that demands to be changed more often than any other one. In my template news show up as a picture with short description, and as you click on it, you can read the whole text. In such a way, I need to put the pictures to be displayed and two pieces of text. And as for any other section of my website I can change the general colors.<br />
1. To add/delete news from the news section you need to find a folder with these files in your template files folder. Mine is called &#8220;dynamic_news&#8221;.<br />
2. Here I can find one more folder which is called &#8220;Items&#8221;  and it has all the news-related pictures in it. I can put new pictures here, though it is still important to remember about the image size.<br />
<strong>Template file folder → Dynamic News </strong><strong>→ items </strong><strong>→ New pictures for news</strong><br />
3. To make the new pictures displayed in my news, I have to open a code file (lies in the news folder). Here for each of the news there are several parameters given. Item thumbnail (the picture), title (title of the piece of news), description (a short text displayed by the picture), content (the whole text of this piece of news).<br />
To make your picture displayed you need to put your new picture name as a value for item thumbnail.<br />
<strong>Dynamic news → News XML file</strong> <strong>→</strong><span><span class="m"> &lt;</span><span class="t">item</span><span class="t"> thumbnail</span><span class="m">=&#8221;</span></span><span>items/category1/</span><strong>New Image for news 1.jpg<span class="m">&#8220;</span> </strong><span><span class="t">title</span></span><strong><span class="m">=&#8221;</span></strong><strong>News Title for news<span class="m">&#8220;</span></strong><br />
4. In a similar way  you can give a new title to your news, insert new texts for description and the whole text of the news. Just paste a new text between the description and content tags and do not forget to save your file.<br />
<strong>Dynamic news → News XML file </strong><strong>→ </strong><span class="m">&lt;</span><span class="t">content</span><span class="m">&gt; <strong>NEW CONTENT</strong>. &lt;</span><span class="t">/content</span><span class="m">&gt;</span><br />
5. You can edit the basic colors for this page as well. Just follow a procedure similar to the one described in Step 5 for the slide show.</p>
<p><strong>Media <a href="http://tuts.flashmint.com/wp-content/uploads/media.jpg"><img class="alignright size-full wp-image-97" title="media" src="http://tuts.flashmint.com/wp-content/uploads/media.jpg" alt="media" width="470" height="298" /></a></strong><br />
My template has image and video gallery components. They can be reached from Media in the main menu. Each of these galleries has its own folder in the main folder.<br />
<em><strong>Video gallery</strong></em><br />
1. To edit the contents of the video gallery I need to substitute the old videos with the ones I want to put here. So I insert into the folder with videos my new videos, and then open the code file and change the names for the videos.<br />
<span>Template file folder </span><strong>→ Video gallery </strong><strong>→ Items </strong><strong>→ New Videos</strong><br />
2. In my template besides the videos there are thumbnails for them, which appear as a preview, help navigation. There is also the description text for each video.<br />
3. The thumbnails are located in the same folder as video, so as I insert a new name for the video in the code file, I need to change the name for a thumbnail. Thumbnails are .jpeg files.<br />
4. Then I can insert the new description text into the code file.<br />
<span>Template file folder </span><strong>→ Video Gallery </strong><strong>→ Video XML file </strong><strong>→ &lt;</strong><span class="t">item item_icon</span><span class="m">=&#8221;</span><span>items/1/</span><strong>New video 1.</strong><span>jpg</span><span class="m">&#8220;</span><span class="t"> item</span><span class="m">=&#8221;</span><span>items/1/</span><strong>New video1.</strong><span>flv</span><span class="m">&#8220;</span><span class="t"> title</span><span class="m">=&#8221;</span><strong>New Video 1</strong><span class="m">&#8220;&gt;</span><br />
5. The same procedure must be done for every video, just make sure the names you insert into the code match the ones that are assigned to each video or thumbnail in the items folder.<br />
6. To edit the colors just open the colors XML file and and make the changes the same way like for other components.</p>
<p><em><strong>Image gallery</strong></em><br />
1. To customize your image gallery find a folder which contains the information on this gallery.<br />
2. Change the pictures in this folder to the ones you need. Pay attention to the image size and type.<br />
<strong>Template file folder →</strong><strong> <span>Images Gallery</span> </strong><strong>→ Items </strong><strong>→Insert New images</strong><br />
3. Substitute the names of the pictures in the code. Add the text you need. The procedure is pretty much the same as for videos, you&#8217;ll just be dealing with a different type of files.<br />
<strong>Template file folder → Images gallery </strong><strong>→ Images XML file</strong> <strong>→ new image names</strong><br />
4. To do the color changes just open a code file in this folder which describes colors and apply changes according to the steps described for previous components.</p>
<p><strong>About us <a href="http://tuts.flashmint.com/wp-content/uploads/about-us.jpg"><img class="alignright size-full wp-image-98" title="about-us" src="http://tuts.flashmint.com/wp-content/uploads/about-us.jpg" alt="about-us" width="470" height="217" /></a></strong><br />
In my template the About Us element is a menu that consists of four components. Three of them are text pages (philosophy, Testimonials and Services) and one is a Staff page where there are pictures and text near them.<br />
1.To make changes at the Staff Page I need to open the folder with the files about this page and add the new pictures of staff by putting them into the appropriate folder instead of old ones.<br />
Template file folder <strong>→ Staff page </strong><strong>→ Items </strong><strong>→ Insert New pictures</strong><br />
2. Then I can open the code file of this page and insert new picture names.<br />
<span>Staff page </span><strong>→ Staff page XML file</strong> <strong>→</strong><span class="m">&lt;</span><span class="t">item thumbnail</span><span class="m">=&#8221;</span><strong>items/1/New staff image.jpg</strong><span class="m">&#8220;</span><span class="t"> title</span><span class="m">=&#8221; New </span><strong>Photo 1</strong><span class="m">&#8220;&gt;</span><br />
3. The text can be simply inserted by replacing the old one in this code file for each picture separately.<br />
<span>Staff page </span><strong>→ Staff page XML file</strong> <strong>→</strong> <span class="m">&lt;![CDATA[ <strong>New Content </strong>]]&gt;</span><br />
4. If you need to add more entries than there initially were just duplicate a piece of code and change the values. If you need to have less, simply delete the items you don&#8217;t need.<br />
5. And of course, you can change the colors the same way as for the other components of the menu.</p>
<p>To insert the new text into the text pages just open the folder with the files on this page and replace the content between the content tags in the code file. Do not forget to save the file each time you make changes, so that they get applied!</p>
<p><strong>Contact Page <a href="http://tuts.flashmint.com/wp-content/uploads/contact-page.jpg"><img class="alignright size-full wp-image-99" title="contact-page" src="http://tuts.flashmint.com/wp-content/uploads/contact-page.jpg" alt="contact-page" width="470" height="380" /></a></strong><br />
1. To change your contact data open the contact page folder, and change the data in the code file by substituting the old info with the new one. Save.<br />
<strong>Template files folder →</strong><strong> Contact page </strong><strong>→ </strong><strong>Contact page XML file</strong><br />
2. You can open colors XML file for this page to do the color changes you wish.</p>
<p><strong>Sound</strong><br />
If there is a background sound in your template and you want to change it, just put new tracks instead of old ones in the template file folder. If your track names differ from the old ones you need to change them in the sound code file as well.<br />
<strong>Template file folder</strong> <strong>→Sound XML file </strong><strong>→</strong><span class="m"> &lt;</span><span class="t">item</span> <span class="t">name</span><span class="m">=&#8221;</span><strong>New Track 1 &#8211; Unknown Artist</strong><span class="m">&#8220;</span><span class="t"> url</span><span class="m">=&#8221;</span><strong>New track.mp3</strong><span class="m">&#8221; /&gt;</span></div>
<div id="fb-like" style=""><iframe src="http://www.facebook.com/plugins/like.php?href=http://tuts.flashmint.com/how-to-edit-flash-xml-template/&amp;layout=button_count&amp;show_faces=false&amp;width=50&amp;action=like&amp;font=&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:50px; height:25px"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://tuts.flashmint.com/how-to-edit-flash-xml-template/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

