forked from: flash on 2012-5-14
forked from flash on 2012-5-14 (diff: 1)
ActionScript3 source code
/**
* Copyright therahulphysics ( http://wonderfl.net/user/therahulphysics )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/2Jtp
*/
// forked from therahulphysics's flash on 2012-5-14
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldType;
public class TextField_alwaysShowSelection extends Sprite {
public function TextField_alwaysShowSelection() {
var label1:TextField = createCustomTextField(0, 20, 200, 20);
label1.text = "This text is selected.";
label1.setSelection(0, 9);
label1.alwaysShowSelection = true;
var label2:TextField = createCustomTextField(0, 50, 200, 20);
label2.text = "Drag to select some of this text.";
}
private function createCustomTextField(x:Number, y:Number, width:Number, height:Number):TextField {
var result:TextField = new TextField();
result.x = x; result.y = y;
result.width = width; result.height = height;
addChild(result);
return result;
}
}
}
