我有一个文本文件,它通过 flashvars 加载到 swf 中:
- 数据存储在Mysql中,
- 数据使用coldfusion和cfquery存储
- 通过coldfusion将数据读出到文本文件中
- 通过将文件名传递给 flashvars,数据被加载到 swf,然后被读入 actionscript。
问题是,所有文本都被初始化,直到第一个
"e;
而且我不确定如何逃避这一点,我应该在什么时候逃避。
我使用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();