1

我有一个文本文件,它通过 flashvars 加载到 swf 中:

  • 数据存储在Mysql中,
  • 数据使用coldfusion和cfquery存储
  • 通过coldfusion将数据读出到文本文件中
  • 通过将文件名传递给 flashvars,数据被加载到 swf,然后被读入 actionscript。

问题是,所有文本都被初始化,直到第一个

&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();
4

1 回答 1

1

将变量输入到 flash 文件中时,与号用于分隔变量,很像 URL 参数。

所以 flash 是这样写的:

男孩笑着带他回到小路上。“一个大联合国,格兰瑟,”他笑着说

像这样:

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

尝试使用URLEncodedFormat(FORM.content)so 对 flash 的 vars 进行编码。

于 2012-08-31T16:32:24.143 回答