달력

4

« 2024/4 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
by  나비나


TitleWindow를 띄우기 좀 귀찮기도하고 창의 크기를 작게 만들 때!
Alert을 확장해 사용하면 편리하다.
extends까지 해서 Class로 만들어도 상관 없고
나는 귀찮으므로 Alert을 하나 생성해서 편집해 사용하였다.
밑의 소스를 보면 알겠지만 Alert.show() 메소드는 보여주는 Alert의 인스턴스를 리턴해준다.
그래서 그 메소드를 이용해 보여주고 편집하면 된다.

사용자 삽입 이미지


var alert :Alert = Alert.show( "", "부서 정보 입력", Alert.OK | Alert.CANCEL, null,
              eventBtnAddDeptClick, null, Alert.OK );
alert.height = 120;
( alert.getChildAt( 0 ) as DisplayObjectContainer ).removeChildAt( 0 );

var vBox :VBox = new VBox();
vBox.setStyle( "horizontalAlign", "center" );
vBox.width = 144;
vBox.height = 50;

latxName = new TextInput()();
latxName.label = "Name"

latxName.width = 142;
latxName.height = 20;
latxName.setStyle( "backgroundColor", 0x869CA7 );
latxName.setStyle( "textAlign", "center" );
latxName.setStyle( "letterSpacing", 1 );

vBox.addChildAt( latxName, 0 );


latxDescription = new TextInput()();
latxDescription.label = "Description";

latxDescription.width = 142;
latxDescription.height = 20;
latxDescription.setStyle( "backgroundColor", 0x869CA7 );
latxDescription.setStyle( "textAlign", "center" );
latxDescription.setStyle( "letterSpacing", 1 );

vBox.addChildAt( latxDescription, 1 );
( alert.getChildAt( 0 ) as DisplayObjectContainer ).addChildAt( vBox, 0 );



:
Posted by 라면스프