2012-06-26 48 views
1

我有一個文本文件,被加載到一個swf通過Flash變量:AS2,並且在文本文件"e;停止讀取文本

  • 的數據被存儲在MySQL,
  • 的數據被使用ColdFusion存儲和cfquery
  • 通過coldfusion將數據讀出到文本文件中
  • 通過將文件名傳遞給flashvars,然後將其讀入到actionscript中,將數據加載到swf中。

的問題是,所有的文字被初始化,直到第一

&quote; 

,我不知道如何逃避這一點,在什麼時候,我應該。

我使用ColdFusion存儲原始文本,並將其數據設置爲HTML編輯格式

#HTMLEditFormat(form.content)# /> 

The boy grinned as he led back to the trail. 
"A big un, Granser," he chuckled 

以下是完整的動作

// This will be the starting position of the textbox 

var starting_ypos:Number; 

// Load the Flashvars into the script 
text1.text = myVariable; 
text2.int = mySecondVariable; 

// Make a load vars object 
my_data = new LoadVars(); 

// This will be how fast the text box will scroll 
var scroll_speed:Number = text2.int; 

// Make my on load function 
my_data.onLoad = function() { 

// Fix the double space issue 
var my_text = unescape(this.content).split("\r\n"); 
my_text = my_text.join("\n"); 
my_text = my_text.split("\r"); 
my_text = my_text.join("\n"); 

// Set the text in the text box 
scroll_text.Text = my_text; 

// Set the autosize 
scroll_text.autoSize = true; 

// Set the starting_ypos 
starting_ypos = scroll_text._y; 

}; 

// Load the external text file 
my_data.load(text1.text); 


// Start the scrolling 
this.onEnterFrame = function() { 

// Check for hit test with the mask and the mouse 
if(!mask_mc.hitTest(_root._xmouse, _root._ymouse)) { 

    // Check to see if we are in the mask 
    if(mask_mc.hitTest(scroll_text)) { 

     // Move the textbox 
     scroll_text._y -= scroll_speed; 

    } else { 

     // Reset the text box 
     stop(); 

    } 

} 

} 

// Simple stop command 
stop(); 

回答

1

當輸入變量到Flash文件&符號用於分隔變量,很像URL參數。

所以閃存讀取此:

男孩笑了,因爲他引回蹤跡。 "一個大的聯合國, Granser,"他笑道

就象這樣:

var1 = The boy grinned as he led back to the trail. 
var2 = quot;A big un, Granser, 
var3 = quot; he chuckled 

嘗試使用URLEncodedFormat(FORM.content)所以編碼爲閃光瓦爾。