0

我正在使用 Flash CS 6 和 Air 3.6 来构建 Android 应用程序。我想将StageText用于输入字段。下面的代码仅适用于第一个文本字段。我需要进行哪些更改才能使其适用于两个文本字段?

// NO. 1
var firstfield:StageText = new StageText(); 
firstfield.softKeyboardType = SoftKeyboardType.DEFAULT
firstfield.stage = foobar.stage
firstfield.viewPort = new Rectangle(foobar.x, foobar.y, foobar.width, foobar.height); 

// NO. 2
var secondfield:StageText = new StageText(); 
secondfield.softKeyboardType = SoftKeyboardType.DEFAULT
secondfield.stage = example.stage
secondfield.viewPort = new Rectangle(example.x, example.y, example.width, example.height); 
4

1 回答 1

-1

尝试这样的事情:

var firstfield:StageText = new StageText(); 
firstfield.softKeyboardType = SoftKeyboardType.DEFAULT
firstfield.stage = this.stage;
firstfield.viewPort = new Rectangle(0, 0, 200, 30);
firstfield.x = 0;
firstfield.y = 0;
firstfield.width = 200;
firstfield.height = 30;
addChild(firstfield); 

var secondfield:StageText = new StageText(); 
secondfield.softKeyboardType = SoftKeyboardType.DEFAULT
secondfield.stage = this.stage;
secondfield.viewPort = new Rectangle(0, 40, 200, 30);
secondfield.x = 0;
secondfield.y = 40;
secondfield.width = 200;
secondfield.height = 30;
addChild(secondfield); 
于 2013-04-22T14:20:41.673 回答