상세 컨텐츠

본문 제목

adobe actionscript AS PC, IOS, ANDROID 등등 문자 폰트 setup 셋팅 IME

ADOBE

by AlrepondTech 2020. 9. 23. 03:47

본문

반응형

 

 

 

 

=================================

=================================

=================================

 

 

 

 

 

var edit:TextField = new TextField();

*일본 히라가나 문자 만 쓸수 있게

edit.restrict = "\u3040-\u309F";

//or 또는

edit.restrict  = "ぁ-んー"

 

*일본 카타카나 문자 만 쓸수 있게

edit.restrict = "\u30a0-\u30ff";

//or 또는

edit.restrict  = "ァ-ヶー""

 

*일본 히라가나 카타카나 같이

edit.restrict = "\u3040-\u309F\\\u30a0-\u30ff";

edit.restrict = "ぁ-んー\\ァ-ヶー"

 

*한중일 한문

edit.restrict = "\u4E00-\u9FFF\\\u3400-\u4DBF\\\uF900-\uFAFF";

 

*히라가나, 카나카나, 한중일 한문

 

edit.restrict = "\u3040-\u309F\\\u30a0-\u30ff\\\u4E00-\u9FFF\\\u3400-\u4DBF\\\uF900-\uFAFF";

 

//or 또는

 

edit.restrict = "ぁ-んー\\ァ-ヶー\\\u4E00-\u9FFF\\\u3400-\u4DBF\\\uF900-\uFAFF";

 

 

 

 

=================================

=================================

=================================

 

 

 

출처: http://berry2.tistory.com/m/post/509

 

CJK 유니코드

 

Unicode#

 

 

UTF-8 인코딩에서 각 언어별 표현 영역#UTF-8 인코딩에서 한글을 표현하는 영역#

BlockUnicode codeUTF-8 Hex   비          고  

Hangul Jamo U+1100 ~ U+11FF 0xE1 0x84 0x80 ~ 0xE1 0x87 0xBF 한글자모
Hangul Compatibility Jamo U+3130 ~ U+318F 0xE3 0x84 0xB0 ~ 0xE3 0x86 0x8F 한글호환자모
Hangul Syllables U+AC00 ~ U+D7AF 0xEA 0xB0 0x81 ~ 0xED 0x9E 0xA3 한글

 

UTF-8 인코딩에서 일본어를 표현하는 영역#

BlockUnicode codeUTF-8 Hex   비          고  

Hiragana U+3040 ~ U+309F 0xE3 0x81 0x81 ~ 0xE3 0x82 0x9F 일본어 히라가나
Katakana U+30A0 ~ U+30FF 0xE3 0x82 0xA0 ~ 0xE3 0x83 0xBF 일본어 카타카나

 

UTF-8 인코딩에서 한중일 한자를 표현하는 영역#

BlockUnicode codeUTF-8 Hex   비          고

CJK Unified Ideographs U+4E00 ~ U+9FFF 0xE4 0xB8 0x80 ~ 0xE9 0xBF 0xBF 한중일 공통 한자
CJK Unified Ideographs Extension A U+3400 ~ U+4DBF 0xE3 0x90 0x80 ~ 0xE4 0xB6 0xBF 한자 확장 A
CJK Unified Ideographs Extension B U+20000 ~ U+2A6DF 0xF0 0xA0 0x80 0x80 ~ 0xF0 0xAA 0x9B 0x9F 한자 확장 B
CJK Compatibility Ideographs U+F900 ~ U+FAFF 0xEF 0xA4 0x89 ~ 0xEF 0xAB 0xBF 한중일 호환 한자

History

Last edited on Jun 16, 2009 22:09 by 휘슬

 

 

 

 

=================================

=================================

=================================

 

 

 

출처: https://gist.github.com/aki-null/1079686

 

Hashtag Regex

 hashtag_regex

Raw

1  

Owner

aki-null commented on 13 Jul 2011

Objective-Cのソースコードに貼り付けるためにエスケープされています

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

 

 

 

=================================

=================================

=================================

 

 

 

출처: http://clack.tistory.com/m/post/378

 

input mode의 textField에 입력가능한 문자의 범위를 지정할 수 있다.

 

특정 범위의 문자만 포함하거나, 특정 범위의 문자를 제외하거나 할 수 있다.

 

 

ActionScript3.0 참조 설명서에 나와있는 예제 ( TextFiled.restrict )

 

 

다음 예제에서는 대문자, 공백 및 숫자만 텍스트 필드에 입력할 수 있습니다.

my_txt.restrict = "A-Z 0-9";

다음 예제에서는 소문자를 제외한 모든 문자를 포함합니다.

my_txt.restrict = "^a-z";

백슬래시를 사용하여 ^ 또는 -를 입력할 수 있습니다. 또한 \-, \^, \\ 등의 백슬래시 시퀀스를 사용할 수 있습니다. 백슬래시는 문자열의 실제 문자여야 하므로 ActionScript에 지정될 때는 이중 백슬래시를 사용해야 합니다. 예를 들어 다음 코드에는 대시(-)와 캐럿(^)만 포함됩니다.

my_txt.restrict = "\\-\\^";

문자열의 아무 위치에서나 ^를 사용하여 포함 문자와 제외 문자를 전환할 수 있습니다. 다음 코드는 대문자 Q를 제외한 대문자만 포함합니다.

my_txt.restrict = "A-Z^Q";

\u 이스케이프 시퀀스를 사용하여 restrict 문자열을 구성할 수 있습니다. 다음 코드는 ASCII 32(공백)에서 ASCII 126(물결 표시)까지의 문자만 포함합니다.

my_txt.restrict = "\u0020-\u007E";

기본값: null.

 

 

ActionScript3.0 참조 설명서에 나와있는 부분은 영어와 숫자 특수문자만 나와있는데

 

한글은 어떻게 해야할까?

 

my_txt.restrict = "ㄱ-힣";  이렇게 하면 'ㄱ' 부터 '힣' 까지 자음, 모음으로 조합가능한 모든 한글 범위를 설정할 수 있다.

 

하지만 예상치 못한 문제가 있다. 한글만 입력될줄 알았던 inputText에 중국어 및 한자가 입력이 된다.

 

이것저것 테스트 중에 해결방법을 찾았다. "가-힣"  으로 범위를 설정하면 완성된 한글만 입력이 가능한데,

 

ㄱ, ㅗ, ㅠㅠ 이런식으로 자음 또는 모음으로만 구성된 한글은 입력이 안되도록 설정하는것인데

 

한자나 중국어 들의 범위가 한글의 자음과 모음으로만 구성된 미완성된 한글들과 같은 범위대 내에 속해 있는것 으로 판단된다.

 

아마 1byte로 되어있는 영어나 특수문자 외의 문자들은 한 글자를 표현하는데 3byte 이상이 필요하기 때문에 같은 대역에 있는것 같다.

 

my_txt.restrict = "A-Z a-z 0-9 ㄱ-힣"; // 한자입력 가능my_txt.restrict = "A-Z a-z 0-9 가-힣"; // 한자입력 차단

 

 

 

=================================

=================================

=================================

 

 

 

출처: http://b.hatena.ne.jp/entry/cocoasaurus.com/blog/2009/04/as3-4.html

 

[AS3] テキストフィールドを入力制限するいくつかの方法 - initialize

// tf テキストフィールドの入力をひらがなのみにする tf.restrict = "ぁ-ん"; // tf テキストフィールドの入力を全角カタカナのみにする tf.restrict = "ァ-ヶ"; // tf テキストフィールドの入力を半角カナのみにする tf.restrict = "\uff66-\uff9f\\(\\)\\<\\>"; // tf テキストフィールドの入力を数字のみにする tf.restrict = "0-9";

 

 

=================================

=================================

=================================

 

 

 

출처: http://www.geocities.jp/sunsun0703/air/index.html

 

テキスト入力ボックスに入力可能な文字を制限するには?

例:半角数字のみ <s:TextInput restrict="0-9" /> 例:半角英字のみ <s:TextInput restrict="a-zA-Z" /> 例:ひらがなのみ <s:TextInput restrict="ぁ-んー" /> 例:全角カタカナのみ <s:TextInput restrict="ァ-ヶー" />

 

 

 

=================================

=================================

=================================

 

 

출처: http://clack.tistory.com/378

 

input TextField 입력가능 문자 제한 ( restrict )

input mode의 textField에 입력가능한 문자의 범위를 지정할 수 있다.

 

특정 범위의 문자만 포함하거나, 특정 범위의 문자를 제외하거나 할 수 있다.

 

 

ActionScript3.0 참조 설명서에 나와있는 예제 ( TextFiled.restrict )

 

 

다음 예제에서는 대문자, 공백 및 숫자만 텍스트 필드에 입력할 수 있습니다.

my_txt.restrict = "A-Z 0-9";

다음 예제에서는 소문자를 제외한 모든 문자를 포함합니다.

my_txt.restrict = "^a-z";

백슬래시를 사용하여 ^ 또는 -를 입력할 수 있습니다. 또한 \-, \^, \\ 등의 백슬래시 시퀀스를 사용할 수 있습니다. 백슬래시는 문자열의 실제 문자여야 하므로 ActionScript에 지정될 때는 이중 백슬래시를 사용해야 합니다. 예를 들어 다음 코드에는 대시(-)와 캐럿(^)만 포함됩니다.

my_txt.restrict = "\\-\\^";

문자열의 아무 위치에서나 ^를 사용하여 포함 문자와 제외 문자를 전환할 수 있습니다. 다음 코드는 대문자 Q를 제외한 대문자만 포함합니다.

my_txt.restrict = "A-Z^Q";

\u 이스케이프 시퀀스를 사용하여 restrict 문자열을 구성할 수 있습니다. 다음 코드는 ASCII 32(공백)에서 ASCII 126(물결 표시)까지의 문자만 포함합니다.

my_txt.restrict = "\u0020-\u007E";

기본값: null.

 

ActionScript3.0 참조 설명서에 나와있는 부분은 영어와 숫자 특수문자만 나와있는데

 

한글은 어떻게 해야할까?

 

my_txt.restrict = "ㄱ-힣";  이렇게 하면 'ㄱ' 부터 '힣' 까지 자음, 모음으로 조합가능한 모든 한글 범위를 설정할 수 있다.

 

하지만 예상치 못한 문제가 있다. 한글만 입력될줄 알았던 inputText에 중국어 및 한자가 입력이 된다.

 

이것저것 테스트 중에 해결방법을 찾았다. "가-힣"  으로 범위를 설정하면 완성된 한글만 입력이 가능한데,

 

ㄱ, ㅗ, ㅠㅠ 이런식으로 자음 또는 모음으로만 구성된 한글은 입력이 안되도록 설정하는것인데

 

한자나 중국어 들의 범위가 한글의 자음과 모음으로만 구성된 미완성된 한글들과 같은 범위대 내에 속해 있는것 으로 판단된다.

 

아마 1byte로 되어있는 영어나 특수문자 외의 문자들은 한 글자를 표현하는데 3byte 이상이 필요하기 때문에 같은 대역에 있는것 같다.

 

my_txt.restrict = "A-Z a-z 0-9 ㄱ-힣"; // 한자입력 가능

 

my_txt.restrict = "A-Z a-z 0-9 가-힣"; // 한자입력 차단

 

 

 

 

=================================

=================================

=================================

 

 

 

TextInput  restrict property 에 대해...

<mx:TextInput id="txt" restrict="ㄱ-힣">

restrict = "ㄱ-힣"            :  한글만 입력가능.
restrict = "A-z"              :  영어만 입력가능.
restrict = "0-9"               :  숫자만 입력가능.
restrict = "0-9\-"           : 숫자 '-'만 입력가능.
restrict = "^a-z"             : 소문자 a부터 z까지 제외한 모든문자 입력가능.
restrict = "A-z0-9\@\." : 이메일 형식만 입력가능.
restrict = "\\\"           : '\' 문자만 입력가능.
restrict = "\^"               :  '^' 문자만 입력가능.

여러가지 응용도 하실 수 있겠습니다.

 

 

 

=================================

=================================

=================================

 

 

출처: http://www.as3gamegears.com/input/as3-virtual-keyboard/

 

AS3 Virtual Keyboard is a library to display in-app virtual keyboard for user input. The virtual keyboard is similar to the one available on the Android/iOS platform, emerging from the bottom of the screen.

Some of it features include auto resize, auto align and dynamic key configuration. This lib is useful to allow user input on touch enabled games.

Sample

package  {
  import flash.display.Sprite;
  import flash.events.MouseEvent;
  import flash.text.TextField;
  import flash.text.TextFormat;
  import nid.ui.controls.VirtualKeyBoard;

  /**
   * ...
   * @author Nidin P Vinayakan
   */
  public class Main extends Sprite {		
    public function Main() {
      VirtualKeyBoard.getInstance().init(this);

      var txt:TextField = new TextField();
      txt.width = 300;
      txt.height = 100;
      txt.background = true;
      txt.backgroundColor = 0xCCCCCC;
      txt.defaultTextFormat = new TextFormat("Arial", 25, 0x000000,true,null,null,null,null,"center");
      txt.text = "PRESS HERE"
      addChild(txt);
      txt.x = 175;
      txt.y = 10;

      txt.addEventListener(MouseEvent.CLICK, toggleKeyboard);			
    }

    private function toggleKeyboard(e:MouseEvent):void {
      VirtualKeyBoard.getInstance().target = { field:e.currentTarget, fieldName:"Test" };
    }		
  }
}

 

BunbunManJu

October 30, 2013

hi, I downloaded and try to use this. However,after I path it to the source folder of AS3 Virtual Keyboard, i found that there are errors in it. One error is about Arial and the other is about tweener not found. Can you help me with this?

  1. BunbunManJuOppsss… worry. It was a stupid mistake on my side. Sorry 
  2. October 30, 2013
  3. DovyskiNo problem!  Nice you figured it out all by yourself.
  4. October 30, 2013
  5. xavierHello, thank you for making this available.Can you point me on the correct track please?
  6. Regards
  7. I’m trying to add special characters (ñ, á, ü), so I modified KeyBoardUI.as but think I’m missing visual feedback (key registers correctly).
  8. November 12, 2013
  9. DovyskiHey there! I’m not the author of that lib, so this is much more of hunch than a tip: are you embedding all the font glyphs so the textfield can render them properly? I had similar problems in the past and they were all related to glyphs embedding.
  10. You could also try to ping the author of the lib. He probably has a lot more to offer regarding your question.
  11. November 12, 2013

 

 

=================================

=================================

=================================

 

 

    

change

이벤트

 

이벤트 객체 유형: flash.events.Event
속성 Event.type = flash.events.Event.CHANGE

언어 버전:  ActionScript 3.0
런타임 버전:  AIR 3

텍스트 내용이 변경된 후 전달됩니다. 이 이벤트는 변경 시마다 전달되거나, 일련의 변경 사항이 완료될 때까지 전달되지 않을 수 있습니다.

Event.CHANGE 상수는 change 이벤트 객체의 type 속성 값을 정의합니다.

이 이벤트에는 다음과 같은 속성이 있습니다.

속성값

bubbles true
cancelable false. 취소할 기본 비헤이비어가 없습니다.
currentTarget 이벤트 리스너를 통해 Event 객체를 처리하고 있는 객체입니다.
target 값이 수정된 객체입니다. target은 표시 목록에서 이벤트 리스너를 등록한 객체가 아닐 수도 있습니다. 표시 목록에서 현재 이벤트를 처리 중인 객체에 액세스하려면 currentTarget 속성을 사용합니다.

 

 

=================================

=================================

=================================

 

 

    

restrict

속성  

restrict:String

언어 버전:  ActionScript 3.0
런타임 버전:  AIR 3

사용자가 텍스트 필드에 입력할 수 있는 문자 세트를 제한합니다. 시스템은 왼쪽에서 오른쪽으로 restrict 문자열을 검색합니다.

restrict 값은 다음과 같은 텍스트 입력 제한 규칙을 지정합니다.

  • 값이 null인 경우 사용자는 모든 문자를 입력할 수 있습니다.
  • 값이 빈 문자열인 경우 사용자는 어떤 문자도 입력할 수 없습니다.
  • 값이 문자가 포함된 문자열인 경우 사용자는 문자열의 문자만 입력할 수 있습니다.
  • 값에 캐럿(^)이 포함된 경우 사용자는 캐럿 뒤에 있는 모든 문자를 입력할 수 없습니다.
  • 값에서 하이픈(-) 문자를 사용하여 허용되는 입력 문자의 범위를 지정할 수 있습니다.
  • 값에서 \u 이스케이프 시퀀스를 사용하여 restrict 문자열을 구성할 수 있습니다.

특수 문자:

백슬래시를 사용하여 캐럿(^) 또는 대시(-) 문자를 입력합니다. 허용되는 백슬래시 시퀀스는 \-, \^ 및 \\입니다. 백슬래시는 문자열에서 실제 문자여야 합니다. ActionScript에서 백슬래시를 지정할 경우 이중 백슬래시를 사용합니다.

restrict 속성 설정 예제:

다음 예제에서는 사용자가 대시(-) 및 캐럿(^) 문자만 입력할 수 있습니다.

my_txt.restrict = "\\-\\^";

다음 예제에서는 사용자가 대문자, 공백 및 숫자만 입력할 수 있습니다.

my_txt.restrict = "A-Z 0-9";

다음 예제에서는 소문자만 제외됩니다.

my_txt.restrict = "^a-z";

다음 예제에서는 사용자가 대문자만 입력할 수 있지만 대문자 Q는 제외됩니다.

my_txt.restrict = "A-Z^Q";

다음 예제에서는 사용자가 ASCII 32(공백) 및 ASCII 126(물결 표시) 사이의 문자만 입력할 수 있습니다.

my_txt.restrict = "\u0020-\u007E";

참고: 제한 사항은 사용자 입력에만 적용되며 스크립트는 모든 문자를 텍스트 필드에 삽입할 수 있습니다.

기본값: null.



구현 
    public function get restrict():String
    public function set restrict(value:String):void

 

 

 

=================================

=================================

=================================

 

 

 

출처: http://help.adobe.com/ko_KR/FlashPlatform/reference/actionscript/3/flash/globalization/LocaleID.html

로캘 결정

Flash Player 10.1 이상, Adobe AIR 2.0 이상



로캘은 해당 국가 또는 지역의 특정 언어 및 문화적 규칙 조합을 식별합니다.
로캘 식별자는 문자열로 관리하는 것이 안전합니다. 그러나 로캘과 관련된 추가 정보를 가져오도록 LocaleID 클래스를 사용할 수 있습니다.
LocaleID 객체를 만드는 방법은 다음과 같습니다.
LocaleID 객체가 생성되었으면 로캘 ID에 대한 데이터를 검색할 수 있습니다. getKeysAndValues(), getLanguage(), getRegion(), getScript(), getVariant() 및 isRightToLeft() 메서드와 name 속성을 사용합니다.
이러한 메서드 및 속성으로 검색된 값은 해당 로캘에 대한 로캘 식별자를 통해 직접 추출할 수 없는 추가 정보를 나타낼 수 있습니다.
응용 프로그램에서 날짜 포맷터와 같은 로캘 인식 서비스를 만드는 경우에는 사용할 로캘을 지정해야 합니다. 지원되는 로캘 목록이 운영 체제마다 다르므로 요청된 로캘을 사용하지 못할 수 있습니다.
Flash Player는 먼저 요청된 로캘의 언어 코드와 일치시키려고 시도합니다. 그런 다음 일치하는 쓰기 시스템(스크립트) 및 지역을 검색하여 로캘을 세부적으로 지정합니다. 예를 들면 다음과 같습니다.
이 예제에서 LocaleID() 생성자는 사용자의 언어 코드 "es"와 가장 일치하는 로캘에 대한 정보를 검색합니다.

로캘 ID 설정

다음과 같은 여러 가지 방법으로 응용 프로그램의 현재 로캘을 설정할 수 있습니다.
  • 단일 로캘 ID를 응용 프로그램에 하드 코딩합니다. 이것은 일반적인 방식이지만 응용 프로그램의 국제화를 지원하지 않습니다.
  • 사용자의 운영 체제, 브라우저 또는 기타 사용자 환경 설정의 기본 로캘 ID를 사용합니다. 이렇게 하면 일반적으로 사용자에게 가장 적합한 로캘 설정이 구성되지만 정확하지 않은 경우도 있습니다. 운영 체제 설정이 사용자가 실제로 원하는 설정을 반영하지 않을 위험이 있습니다. 예를 들어 사용자가 공용 컴퓨터를 사용하므로 운영 체제의 기본 로캘을 변경하지 못할 수 있습니다.
  • 사용자의 환경 설정에 따라 로캘 ID를 설정한 후 사용자가 지원되는 로캘 목록에서 선택할 수 있게 합니다. 이 전략은 대개 응용 프로그램에서 둘 이상의 로캘을 지원할 수 있는 경우에 가장 적합한 선택이 될 수 있습니다.
이 세 번째 옵션을 구현하는 방법은 다음과 같습니다.
  1. 사용자 프로파일, 브라우저 설정, 운영 체제 설정 또는 쿠키에서 사용자의 기본 로캘 또는 언어 목록을 검색합니다. 이 경우 응용 프로그램 자체가 이 논리를 구현해야 합니다. flash.globalization 라이브러리로는 이러한 기본 설정을 직접 읽을 수 없습니다.
  2. 응용 프로그램에서 지원하는 로캘을 결정하고 가장 적합한 로캘을 기본값으로 선택합니다. LocaleID.determinePreferredLocales() 메서드를 사용하여 사용자의 기본 로캘과 운영 체제에서 지원되는 로캘에 따라 가장 적합한 로캘을 찾습니다.
  3. 기본 로캘이 만족스럽지 않은 경우 사용자가 기본 로캘 설정을 변경할 수 있는 방법을 제공합니다.

기타 로캘 및 언어 클래스의 제한 사항

fl.lang.Locale 클래스는 문자열 값을 포함한 리소스 번들을 사용하여 로캘을 기반으로 텍스트 문자열을 바꿀 수 있도록 합니다. 그러나 이 클래스는 숫자, 통화, 날짜 서식 지정, 정렬 및 일치 등의 기타 국제화 기능을 지원하지 않습니다. 또한 이 클래스는 Flash Professional에서만 사용할 수 있습니다.
flash.system.Capabilities.language 속성을 사용하여 운영 체제에 대한 현재 언어 코드 설정을 검색할 수도 있습니다. 그러나 이 속성은 전체 로캘 ID가 아닌 2문자 ISO 639-1 언어 코드만을 검색하고 특정 로캘 세트만을 지원합니다.
AIR 1.5에서 flash.system.Capabilities.languages 속성을 사용할 수 있습니다. 이 속성은 기본 사용자 인터페이스 언어 배열을 제공합니다. 따라서 Capabilities.language의 제한 사항이 없습니다.

 

 

 

=================================

=================================

=================================

 

 

출처: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html

 

var lo:Locale = new Locale("kr"); //"ja" //en

 

    

locale

property  

 

locale:String

Language Version:  ActionScript 3.0
Runtime Versions:  AIR 3

Indicates the locale of the text. StageText uses the standard locale identifiers. For example "en", "en_US" and "en-US" are all English; "ja" is Japanese. See iso639-2 code list for a list of locale codes.

The default value is en.



Implementation 
    public function get locale():String
    public function set locale(value:String):void

 

 

 

=================================

=================================

=================================

 

 

출처: http://help.adobe.com/ko_KR/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7cd5.html

IME 클래스 사용

Flash Player 9 이상, Adobe AIR 1.0 이상



IME 클래스를 사용하면 Flash Player 또는 Adobe AIR 내에서 운영 체제의 IME를 조작할 수 있습니다.
ActionScript를 사용하여 다음을 확인할 수 있습니다.
  • IME가 사용자의 컴퓨터에 설치되어 있는지 여부(Capabilities.hasIME)
  • IME가 사용자의 컴퓨터에서 활성화되어 있는지 아니면 비활성화되어 있는지 여부(IME.enabled)
  • 현재 IME가 사용하는 변환 모드(IME.conversionMode)
입력 텍스트 필드를 특정 IME 컨텍스트에 연결시킬 수 있습니다. 입력 필드 간에 전환할 때 IME를 히라가나(일본어), 최대 폭 숫자, 반폭 숫자, 직접 입력 등으로 서로 전환할 수도 있습니다.
IME를 사용하면 한국어, 중국어 및 일본어 등 ASCII가 아닌 멀티바이트 언어 텍스트 문자를 입력할 수 있습니다.
IME 사용에 대한 자세한 내용은 개발 중인 응용 프로그램을 실행할 운영 체제의 설명서를 참조하십시오. 추가 리소스를 보려면 다음 웹 사이트를 참조하십시오.
참고: 사용자의 컴퓨터에 IME가 활성화되어 있지 않으면 Capabilities.hasIME 이외의 IME 메서드 또는 속성이 호출되지 않습니다. 이때 IME를 수동으로 활성화시키면 ActionScript에서 이후에 IME 메서드 및 속성을 정상적으로 호출할 수 있습니다. 예를 들어 일본어 IME를 사용하는 경우 IME 메서드 또는 속성을 호출하기 전에 해당 IME를 활성화해야 합니다.

IME 설치 여부 및 활성화 여부 확인

IME 메서드나 속성을 호출하기 전에 현재 사용자의 컴퓨터에 IME가 설치되어 있으며 활성화되어 있는지 항상 확인해야 합니다. 다음 코드는 메서드를 호출하기 전에 IME가 설치 여부 및 활성화 여부를 확인하는 방법을 보여 줍니다.
앞의 코드는 먼저 Capabilities.hasIME 속성을 사용하여 IME 설치 여부를 확인합니다. 이 속성이 true로 설정되어 있으면 이 코드가 IME.enabled 속성을 사용하여 사용자의 IME가 현재 활성화되어 있는지 여부를 확인합니다.

현재 활성화된 IME 변환 모드 확인

다국어 응용 프로그램을 작성할 때 사용자가 현재 활성화되어 있는 변환 모드를 확인해야 할 수 있습니다. 다음 코드는 메서드를 호출하기 전에 IME 설치 여부 확인 방법 및 IME가 설치된 경우 현재 활성화된 IME 변환 모드 확인 방법을 보여 줍니다.
앞의 코드는 먼저 IME가 설치되어 있는지 여부를 확인합니다. 다음으로 IMEConversionMode 클래스의 각 상수와 IME.conversionMode 속성을 비교하여 현재 IME에서 사용하고 있는 변환 모드를 확인합니다.

IME 변환 모드 설정

사용자의 IME 변환 모드를 변경할 때 코드가 try..catch 블록에서 래핑되는지 확인해야 합니다. IME에서 변환 모드를 설정할 수 없는 경우에 conversionMode 속성을 사용하여 변환 모드를 설정하면 오류가 발생할 수 있습니다. 다음 코드는 try..catch 블록을 사용하여 IME.conversionMode 속성을 설정하는 방법을 보여 줍니다.
앞의 코드는 먼저 사용자에게 상태 메시지를 표시하는 데 사용되는 텍스트 필드를 만듭니다. 그 다음에는 IME가 설치되어 있는 경우 이 코드가 IME를 활성화하고 변환 모드를 한국어로 설정합니다. 사용자의 컴퓨터에 한국어 IME가 설치되어 있지 않으면 Flash Player 또는 AIR에서 오류가 발생하고 try..catch 블록에서 이 오류가 catch됩니다. try..catch 블록은 앞에서 만든 텍스트 필드에 오류 메시지를 표시합니다.

특정 텍스트 필드에 대해 IME 비활성화

경우에 따라 문자를 입력할 때 사용자의 IME를 비활성화할 수 있습니다. 예를 들어 숫자만 입력할 수 있는 텍스트 필드가 있는 경우 IME를 사용하지 않고 천천히 데이터를 입력할 수 있습니다.
다음 예제에서는 FocusEvent.FOCUS_IN  FocusEvent.FOCUS_OUT 이벤트를 수신하고 그에 따라 사용자의 IME를 비활성화하는 방법을 보여 줍니다.
다음 예제는 phoneTxt와 nameTxt라는 두 가지 입력 텍스트 필드를 만든 다음 두 개의 이벤트 리스너를 phoneTxt 텍스트 필드에 추가합니다. 사용자가 phoneTxt 텍스트 필드를 강조하도록 설정하면 FocusEvent.FOCUS_IN 이벤트가 전달되고 IME가 비활성화됩니다. phoneTxt 텍스트 필드가 강조되지 않으면 FocusEvent.FOCUS_OUT 이벤트가 전달되어 IME를 다시 활성화합니다.

IME 구성 이벤트 수신

구성 문자열을 설정하면 IME 구성 이벤트가 전달됩니다. 예를 들어 사용자가 IME를 활성화하고 일본어로 문자열을 입력한 경우 사용자가 구성 문자열을 선택하는 즉시 IMEEvent.IME_COMPOSITION 이벤트가 전달됩니다. IMEEvent.IME_COMPOSITION 이벤트를 수신하려면 다음 예제와 같이 이벤트 리스너를 System 클래스(flash.system.System.ime.addEventListener(...))의 정적 ime 속성에 추가해야 합니다.
앞의 코드는 두 개의 텍스트 필드를 만들고 해당 필드를 표시 목록에 추가합니다. 첫 번째 텍스트 필드인 inputTxt는 사용자가 일본어 텍스트를 입력할 수 있는 입력 텍스트 필드입니다. 두 번째 텍스트 필드인 outputTxt는 사용자에게 오류 메시지를 표시하거나 사용자가 inputTxt 텍스트 필드에 입력한 일본어 문자열을 반복하여 표시하는 동적 텍스트 필드입니다.

 

 

 

=================================

=================================

=================================

 

 

softKeyboardBehavior

Specifies the default behavior of the application when a virtual keyboard is displayed. The default behavior is to pan the application upward. The runtime keeps the focused text field or interactive object on the screen. Use the pan option if your application does not provide its own keyboard handling logic.

You can also turn off the automatic behavior by setting the softKeyboardBehavior element to none. In this case, text fields and interactive objects dispatch a SoftKeyboardEvent when the soft keyboard is raised, but the runtime does not pan or resize the application. It is your application’s responsibility to keep the text entry area in view.

Parent element:initialWindow

Child elements: none

Content

Either none or pan. The default value is pan.

Example<softKeyboardBehavior>none</softKeyboardBehavior>

supportedLanguages

Identifies the languages supported by the application. This element is only used by iOS, Mac captive runtime, and Android applications. This element is ignored by all other application types.

If you do not specify this element, then by default the packager performs the following actions based on the application type:

  • iOS — All languages supported by the AIR runtime are listed in the iOS app store as supported languages of the application.
  • Mac captive runtime — Application packaged with captive bundle has no localization information.
  • Android — Application bundle has resources for all languages supported by the AIR runtime.

Parent element:application

Child elements: none

Content

A space delimited list of supported languages. Valid language values are ISO 639‑1 values for the languages supported by the AIR runtime: en, de, es, fr, it, ja, ko, pt, ru, cs, nl, pl, sv, tr, zh.

The packager generates an error for an empty value for the <supportedLanguages> element.

Note: Localized tags (such as the name tag) ignore the value of a language if you use the <supportedLanguages> tag and it does not contain that language. If a native extension has resources for a language which is not specified by the <supportedLangauges> tag, a warning is issued and the resources are ignored for that language.

Example<supportedLanguages>en ja fr es</supportedLanguages>

supportedProfiles

Identifies the profiles that are supported for the application.

Parent element:application

Child elements: none

Content

You can include any of these values in the supportedProfiles element:

  • desktop—The desktop profile is for AIR applications that are installed on a desktop computer using an AIR file. These applications do not have access to the NativeProcess class (which provides communication with native applications).
  • extendedDesktop—The extended desktop profile is for AIR applications that are installed on a desktop computer using a native application installer. These applications have access to the NativeProcess class (which provides communication with native applications).
  • mobileDevice—The mobile device profile is for mobile applications.
  • extendedMobileDevice—The extended mobile device profile is not currently in use.

The supportedProfiles property is optional. When you do not include this element in the application descriptor file, the application can be compiled and deployed for any profile.

To specify multiple profiles, separate each with a space character. For example, the following setting specifies that the application is only available in the desktop and extended profiles:

<supportedProfiles>desktop extendedDesktop</supportedProfiles>

Note: When you run an application with ADL and do not specify a value for the ADL -profile option, then the first profile in the application descriptor is used. (If no profiles are specified in the application descriptor either, then the desktop profile is used.)

Example<supportedProfiles>desktop mobileDevice</supportedProfiles>

text

Specifies a localized string.

The xml:lang attribute of a text element specifies a language code, as defined in RFC4646 (http://www.ietf.org/rfc/rfc4646.txt).

The AIR application installer uses the text element with the xml:lang attribute value that most closely matches the user interface language of the user’s operating system.

For example, consider an installation in which a text element includes a value for the en (English) locale. The AIR application installer uses the en name if the operating system identifies en (English) as the user interface language. It also uses the en name if the system user interface language is en-US (U.S. English). However, if the user interface language is en-US and the application descriptor file defines both en-US and en-GB names, then the AIR application installer uses the en-US value.

If the application defines no text element that matches the system user interface languages, the AIR application installer uses the first name value defined in the application descriptor file.

Parent elements:

Child elements: none

Content

An xml:lang attribute specifying a locale and a string of localized text.

Example

<text xml:lang="fr">Bonjour AIR</text>

 

 

 

=================================

=================================

=================================

 

 

기타 관련 사이트

유니코드표 

http://ko.wikipedia.org/wiki/%EC%9C%A0%EB%8B%88%EC%BD%94%EB%93%9C_%EB%B8%94%EB%A1%9D

 

 

=================================

=================================

=================================

 

 

 

반응형


관련글 더보기

댓글 영역