⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xml.html

📁 基于actionscript3.0的flashLoading控件
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<title>AdvancedLoaderPro Userguide</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/fcms.css" rel="stylesheet" type="text/css">
<link href="css/help_pc.css" rel="stylesheet" type="text/css">
</style>
</head>

<body>
<h1 class="title">Using XML</h1>
<p>&nbsp;</p>

<p class="normal">This tutorial will explain the process of creating a slideshow from XML.</p>
<p>&nbsp;</p>



<p class="normal">1. Open your favourite text editor (for example Notepad on Windows or TextEdit on Mac) and start a new file. Type the following code to start your xml file:</p>

<p><pre>&lt;?xml version="1.0"?&gt;</pre></p>

<p class="normal">This code is a standard xml declaration.</p>

<p>&nbsp;</p>

 

<p class="normal">2. Immediately below that create an opening 'slideshow' tag to enclose your xml file:</p>

<p><pre>&lt;slideshow</pre></p>

<p class="normal">If you would like the images in your slideshow to display in a random order you can now specify the value of the slideshow element's randomDisplay attribute to true, otherwise specify it as false. Then close the slideshow tag:</p>

<p><pre> randomDisplay='false'&gt;</pre></p>

<p>&nbsp;</p>



<p class="normal">3. Type the following code to start an 'image' element that adds an image to your slideshow:</p>

<p><pre>&lt;image</pre></p>

<p class="normal">Add the src attribute which specifies the location of your image (note the space before the 'src' attribute).</p>

<p><pre> src='image1.jpg'</pre></p>

<p class="normal">(If you're specifying the path to your image as a relative path you must specify it relative to the html file that will embed your swf file, not relative to the xml file.)</p>

<p class="normal">Add the link attribute that specifies where the image in the slidehsow should link to (note the space before the 'link' attribute).</p>

<p><pre> link='http://www.flashloaded.com'</pre></p>

<p class="normal">Add the inEffect attribute which specifies which effect should be performed as the image loads (note the space before the 'inEffect' attribute).</p>

<p><pre> inEffect='Slide Down'</pre></p>

<p class="normal">Add the outEffect attribute that specifies which effect should be used to remove the image from view (note the space before the 'outEffect' attribute).</p>

<p><pre> outEffect='Drop Down'</pre></p>

<p class="normal">Close the image tag.</p>

<p><pre>&gt;</pre></p>

<p>&nbsp;</p>



<p class="normal">4. You can now add a caption for your image by creating a 'caption' element and entering the caption between the tags like so:</p>

<p><pre>&lt;caption&gt;This is my 1st caption&lt;/caption&gt;</pre></p>

<p>&nbsp;</p>


<p class="normal">5. In order for your code to be valid XML you must close all elements. You should close the the 'image' element now:</p>

<p><pre>&lt;/image&gt;</pre></p>

<p>&nbsp;</p>



<p class="normal">6. Repeat steps 3, 4 and 5 to create additional images for your slideshow. For the purpose of this tutorial create two more image elements with 'image2.jpg' and 'image3.jpg' as the values of the src attributes.</p>

<p>&nbsp;</p>



<p class="normal">7. Finally, in order to comply with XML syntax, close the slideshow element:</p>

<p><pre>&lt;/slideshow&gt;</pre></p>

<p>&nbsp;</p>





<p class="normal">8. To recap, your XML file should now look like this:</p>

<p><pre>&lt;?xml version="1.0"?&gt;

&lt;slideshow randomDisplay='false'&gt;

	&lt;image src='image1.jpg' link='http://www.flashloaded.com/' inEffect='Slide Down' outEffect='Drop Down'&gt;
		&lt;caption&gt;This is my 1st caption&lt;/caption&gt;
	&lt;/image&gt;

	&lt;image src='image2.jpg' link='http://www.flashloaded.com/' inEffect='Slide Down' outEffect='Drop Down'&gt;
		&lt;caption&gt;This is my 2nd caption&lt;/caption&gt;
	&lt;/image&gt;

	&lt;image src='image3.jpg' link='http://www.flashloaded.com/' inEffect='Slide Down' outEffect='Drop Down'&gt;
		&lt;caption&gt;This is my 3rd caption&lt;/caption&gt;
	&lt;/image&gt;

&lt;/slideshow&gt;</pre></p>

<p class="normal">Save your file as slideshow.xml and close your text editor application.</p>

<p>&nbsp;</p>



<p class="normal">9. Having installed the advancedLoaderPro using the <a href="http://www.adobe.com/exchange/em_download/" target="_blank">Macromedia Extension Manager</a>, open Flash and start a new file.</p>

<p>&nbsp;</p>


<p class="normal">10. Press 'T' to select the Text tool and draw a textfield on the stage. With the textfield still selected press Ctrl+F3 (Windows) or Cmnd+F3 (Mac) to open the properties panel and give the textfield the instance name 'captionText'.</p>
<p><img src="images/fig8.jpg" border="1" class="image"></p>
<p>&nbsp;</p>



<p class="normal">11. Press Ctrl+F7 (Windows) or Cmnd+F7 (Mac) to open the components panel and locate the advancedLoaderPro. Drag a copy of the component onto the stage.</p>
<p>&nbsp;</p>

<p class="normal">12. With the advancedLoaderPro still selected open the properties panel and click 'parameters' tab. Locate the 'XML File' parameter and enter the name you saved the XML file as in step 8 (slideshow.xml).</p>
<p><img src="images/fig9.jpg" border="1" class="image"></p>
<p>&nbsp;</p>

<p class="normal">13. Locate the 'Caption Textfield' parameter and enter the instance name of the textfield you created in step 10 (captionText).</p>
<p><img src="images/fig10.jpg" border="1" class="image"></p>
<p>&nbsp;</p>



<p class="normal">14. Press Ctrl+S (Windows) or Cmnd+S (Mac) to save your file and then press Ctrl+Enter (Windows) or Cmnd+Enter (Mac) to test it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -