<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" type="text/css" href="content.css" />
		<title>
			管理行動裝置的 Flash Lite 檔案記憶體
		</title>
<!-- Changed by: , 21-Mar-2006 -->
<script src="help.js" type="text/javascript" language="Javascript" charset="UTF-8">...</script> 
		
		
<script type="text/javascript">
<!--[CDATA[
handleContext(1);
if (use_ie_6_behavior) {
  document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"content-ie6.css\" />");
}
// ]]-->
</script> 
		
<script src="scripts.js" type="text/javascript" language="Javascript" charset="UTF-8">...</script> <script src="terms.js" type="text/javascript" language="Javascript" charset="UTF-8">...</script> 
	</head>
	<body id="content_body">
<!--googleoff: index-->
<!-- BEGIN PAGE CONTENT WRAPPER -->
		<div id="pneumonic">
			<h1 class="DeviceCentral">DeviceCentral</h1>
		</div>
		<div id="page_content_wrapper">
			<p class="sharedproducts">主題顯示位置： </p><p class="sharedproductindicators"><img src="images/flashSharedIndicator.png" title="Flash" /></p>
<!-- BEGIN BREADCRUMBS -->
			<div id="breadcrumb">
<!-- BEGIN BREADCRUMBS -->
				
<div class="nav"><dl class="page"><dd class="prev"><a accesskey="p" class="prev" href="WSD7F8E1A9-680A-4000-9BA9-D7B01FDD7ECD.html" title="針對行動裝置的 Flash Lite 內容最佳化 ActionScript"><img src="images/prev.gif" alt="上一頁" /></a></dd><dd class="next"><a accesskey="n" class="next" href="WS1459DECC-D858-475c-95CE-7E7D8C281AB2.html" title="在 Flash Lite 中載入行動裝置的資料"><img src="images/next.gif" alt="下一頁" /></a></dd></dl></div><div class="hierarchy"><a href="WS28F6F81C-55B3-4ad5-B632-171637249F5B.html">在 Adobe Device Central 中建立、預視和測試內容</a> /
     <a href="WS3A29C98D-5768-45ea-AB2F-75FAF64078EE.html"><b>建立行動裝置內容的提示</b></a> 
     </div>

<!-- END BREADCRUMBS -->
			</div>
<!-- END BREADCRUMBS -->
<!-- BEGIN PAGE TITLE -->
<!--googleon: index-->
			<h1>
				管理行動裝置的 Flash Lite 檔案記憶體
			</h1>
<!--googleoff: index-->
<!-- END PAGE TITLE -->
<!-- BEGIN CONTENT WRAPPER -->
			<div id="content_wrapper">
<!--googleon: index-->
				<div><p>
                        
                        Flash Lite 會定期從記憶體清除檔案不再參照的任何物件和變數。  這稱為記憶體回收。  Flash Lite 會每隔 60 秒或是在檔案記憶體使用量突然增加 20% 或以上時，執行記憶體回收程序。</p>
<p>雖然無法控制 Flash Lite 執行記憶體回收的方法和時機，您仍然可以刻意釋放不需要的記憶體。  對於時間軸或全域變數，使用 <samp class="codeph">delete</samp> 陳述式以釋放 ActionScript 物件所使用的記憶體。  對於區域變數 (例如，在函數定義中定義的變數)，無法使用 <samp class="codeph">delete</samp> 陳述式來釋放物件的記憶體，但可以將參照物件的變數設定為 <samp class="codeph">null</samp>。 只要該物件沒有其他參照，這樣就能釋放物件所使用的記憶體。</p>
<p>下列兩個程式碼範例顯示如何刪除參照物件的變數，以釋放這些物件所使用的記憶體。  這些兩個範例完全相同，除了第一個範例是建立時間軸變數，而第二個範例則是建立全域變數。</p>
<pre>// First case: variable attached to a movie or 
// movie clip timeline
//
// Create the Date object.
var mcDateObject = new Date();
// Returns the current date as a string.
trace(mcDateObject);
// Delete the object.
delete mcDateObject;
// Returns undefined.
trace(mcDateObject);
//
// Second case: global variable attached to a movie or 
// movie clip timeline 
//
// Create the Date object.
_global.gDateObject = new Date();
// Returns the current date as a string.
trace(_global.gDateObject);
// Delete the object.
delete _global.gDateObject;
// Returns undefined.
trace(_global.gDateObject);</pre>
<p>如前所述，您無法使用 <samp class="codeph">delete</samp> 陳述式來釋放區域函數變數所使用的記憶體， 而要將變數參照設定為 <samp class="codeph">null</samp>，這與使用 <samp class="codeph">delete</samp> 的效果相同。</p>
<pre>function func()
{
	// Create the Date object.
	var funcDateObject = new Date();
	// Returns the current date as a string.
	trace(funcDateObject);
	// Delete has no effect.
	delete funcDateObject;
	// Still returns the current date.
	trace(funcDateObject);
	// Set the object reference to null.
	funcDateObject = null;
	// Returns null.
	trace(funcDateObject);
}
// Call func() function.
func();</pre>
</div>

<!--googleoff: index-->
			</div>
<!-- END CONTENT WRAPPER -->
		</div>
<!-- END PAGE CONTENT WRAPPER -->
		<br clear="both" />
		<div id="related">
			<div class="t">
				<div class="b">
					<div class="l">
						<div class="r">
							<div class="bl">
								<div class="br">
									<div class="tl">
										<div class="tr">
											<div id="related_in">
												<h3>
<script type="text/javascript">document.write(terms_Related_Information);</script> 
												</h3>
												
												<h4>
<script type="text/javascript">document.write(terms_AHV_HELP_RESOURCE_CENTER);</script> 
												</h4>
												<ul class="link-list"><li class="icon external"><a target="_blank" title="此頁面位於全球資訊網" href="http://help.adobe.com/zh_TW/DeviceCentral/1.0/WS4BC3BE1E-4574-4f96-BB90-23BFC3108D34.html">此頁面位於全球資訊網</a></li></ul>
												
											</div>
											<br clear="both" />
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<br clear="both" />
	</body>
</html>