2011-05-16 4 views
1

그래서 모듈을 만들고 사용자가 텍스트 상자의 화면에 질문을 쓸 수있게해야합니다. 누구든지이 작업을 수행하는 방법을 알고 있습니까?AS3에서 화면에 쓰는 방법

package screens 
{ 

import flash.filters.*; 
import flash.text.*; 
import mapSystem.screenSystem.*; 
import mapSystem.*; 
import screens.*; 
import caurina.transitions.Tweener; 



public class screen4 extends screenBase 
{ 


     public function screen4(pSystem:mapManager) 
     { 
      super(pSystem); 
      numActions = 1; 

     } 



    public override function onAction() 
     { 
      if (actionStep == 1) 
      { 
        map.fID("54"); 
      } 
     } 


     public override function onEnter() 
     { 
      map.zoomTo("full"); 
     } 
    } 
} 

답변

2

텍스트를 입력 사용자의 경우, 단순히 텍스트 필드를 만들고 TextFieldType.INPUT 자사의 "유형"속성을 설정 :

이것은 내가 모든 화면에 사용하는 기본 설정입니다. 이 데이터를 검색하려면 textFields "텍스트"소품에 액세스하십시오.

  • 업데이트 - "AS3의 텍스트 필드] 튜토리얼"에

확인 = 간단한 구글 검색, 첫번째 히트 내가 꼴은 당신을 위해에 몇 가지를 추가 this tutorial했다. 그것의 상당히 기본적이고 잘 문서화 된, 그래서, 경험의 수준에 따라, 밝혀야한다.

//Creating the textfield object and naming it "myTextField" 
var myTextField:TextField = new TextField(); 

//Here we add the new textfield instance to the stage with addchild() 
addChild(myTextField); 

//Here we define some properties for our text field, starting with giving it some text to contain. 
//A width, x and y coordinates. 
myTextField.text = "input text here"; 
myTextField.width = 250; 
myTextField.x = 25; 
myTextField.y = 25; 


//@b99 addition 
myTextField.type = TextFieldType.INPUT; 


//This is the section for our text styling, first we create a TextFormat instance naming it myFormat 
var myFormat:TextFormat = new TextFormat(); 

//Giving the format a hex decimal color code 
myFormat.color = 0xAA0000; 

//Adding some bigger text size 
myFormat.size = 24; 

//Last text style is to make it italic. 
myFormat.italic = true; 

//Now the most important thing for the textformat, we need to add it to the myTextField with setTextFormat. 
myTextField.setTextFormat(myFormat); 

희망 하시겠습니까?

+0

미안하지만, 아직도 새로운 것, 나는 당신이 말하는 것을 얻는다. 그러나 정확하게 어디에서 시작해야하는지 혼란스럽게 생각한다. – kirsten

+0

나는 그것을 알아 냈다. 그것은 훌륭했다! 도와 줘서 고마워! – kirsten

+0

좋은 소리. 다행 이네 다행 이네. 아직도 내 업데이 트를 한번보세요 ... 건배! – Bosworth99

관련 문제