Detect device language and change text field accordingly

Im working in Flash Pro with AIR for Android.
I have a single text field and would like to change the language in that text field to match the mobile devices language.
How Can I detect the devices language and then change the textfield to match the language?

import flash.system.Capabilities;
switch (Capabilities.language)
    case "en" :
        TxtField.text = "LANGUAGE English"
        break;
    case "fr" :
        TxtField.text = "LANGUAGEFrench";
        break;
    case "es" :
        TxtField.text = "LANGUAGESpanish";
        break;
    default :
        TxtField.text = "Whatever.";
//Use Capabilities.languages[0] for the country code. eg. en-US
//switch (Capabilities.languages[0])
//case "en-US" :
//TxtField.text = "LANGUAGE English. American"
//break;
//case "en-GB" :
//TxtField.text = "LANGUAGE English. Great Britain";
//break;
//default :
//TxtField.text = "Whatever.";

Similar Messages

  • Subscript & Superscript in dynamic and input text field in Flash

    Yes, <sub> & <sup> tags are not supported by
    Flash but you can
    use Subscript & Superscript in dynamic and input text
    field in Flash:
    Download & install Subscript & Superscript fonts
    from
    http://www.subscriptfont.com
    or
    http://www.superscriptfont.com
    You will need to restart Flash software after installed
    fonts.
    Create a dynamic text field with Arial font embeded. Set the
    HTML property to true.
    Create a dynamic text field with Subscript font embeded.
    Create a dynamic text field with Superscript font embeded.
    Use HTML tag to set text to subscript or superscript like
    below:
    Some text<font face="Superscript">©</font>
    If you are using ActionScript to test the htmlText, use
    script like below:
    my_txt.htmlText = "Some text<font
    face='Superscript'>TM</font>";
    They are better than CG since it goes lower than the baseline
    and it's real subscript..

    Hi Nirnalatha,
    I have newly joined this forum and while going through the
    posts I came across your post which I thought I could help out. But
    I think I am too late for the reply.
    I am also into Flashlite development couple of months from
    now. Coming to your questions:
    1. Textbox problem: I am surprised to know that E70 mobiles
    (Device central list has E70-1 only) does not show input text box
    when cursor is in input box. Anyways its a good thing that you dont
    get an additonal input box. Like all J2ME applications you will be
    able to type the text inline. Infact we had reverse problem where I
    was told to create inline edit input box instead of flashlite input
    box. I think this is the mobile setting. Check the device features
    in the Adobe Device Central under Flash - Standalone player - Text
    and Fonts features. It will be mentioned whether inline text is
    allowed or not.
    2. Soft keys issues: You need to use
    fscommand2("SetSoftKeys", "Previous", "Next");
    and use a key listener in order to override the Mobile
    Softkey commands. Check out the flashlite help which clearly
    explains this.
    Hope I have given youa way to solve ur problem.

  • I used to have a +.- displayed in upper left corner to click and change text size. My sister used my computer and now I can no longer find this feature.

    I used to have a +.- displayed in upper left corner to click and change text size. My sister used my computer and now I can no longer find this feature

    Do you still have all toolbars visible (View > Toolbars)?
    Did you use an extension or the standard zoom buttons that you can find in the toolbar palette in the View > Toolbars > Customize window ?
    Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily.

  • InDesign CC 2014 very slow performance when dragging images and changing text

    InDesign CC 2014 very slow performance when dragging images and changing text.
    Running on 2010 Macpro 2.4GHz. 8GB RAM. Any solutions? I've read through many forums on this and tried several fixes.

    Have exact same issue on  my Windows 7 machine. Resetting preferences is a workaround.
    So I start InDesign whilst holding down these keys.
    Ctrl + Alt + Shift (Windows) or Cmd + Ctrl + Opt + Shift (Mac)
    Whilst inDesign is usable again with this fix- I have to do it every time so it trashes all my preferences so NOT GOOD long term fix. Otherwise InDesign freezes and can only be stopped by forcing a quit.
    I have manually deleted the preference files and I have created a brand new admin account - but still no luck - will be onto support tomorrow

  • Merge pdf's forms, change text field name and Acrobat x pro closes automatically

    I merged 20 pdfs in one interactive pdf, but when I try to change the name of the text fields (in orden to make the interactive independent from the other fields) the program close automatically. I tried to change the name of the text fields in each pdf before merge and it's the same problem. what can i do?

    I merged 20 pdfs in one interactive pdf, but when I try to change the name of the text fields (in orden to make the interactive independent from the other fields) the program close automatically. I tried to change the name of the text fields in each pdf before merge and it's the same problem. what can i do?

  • Safari 5.1.2 keeps changing text field randomly on text input

    Hello everybody.
    Safari keeps changing the text field on input, do you know how to correct this issue?
    Here is an example:
    Let's say I load www.google.com, it appears in the safari window as usual.
    Suppose I begin to type a search in the google search field at the top right of the safari window (not the one on the google page)
    if when doing this the sentence is long for the search, at some point randomly, the rest of the text will be entered this time in the google search text field on the google page! (which is the very next text field) So when I hit enter it makes google search half of my request...
    Safari changed the text field I was into with no warning. I want to say I do not press tab at any moment.
    This is annoying really, and this does not appear anywhere else than in Safari. It seems the issue is not systematic, but appears quite often.
    I have no universal access setting except "enable access for assistive device"
    I had to check this box upon installing a software in the past but I can't remember what it was.
    Perhaps the problem I have is linked to some window refreshing?
    Thank you for your suggestions or help
    Mac Pro, 10.6.8

    Try deleting the cache associated with Safari ...
    Quit Safari.
    Go to ~/Library/Caches/com.apple.Safari/Cache.db.
    Move the Cache.db file to the Trash.
    Relaunch Safari to test.
    I had to check this box upon installing a software in the past but I can't remember what it was.
    Open System Preferences > Universal Access
    Make sure the box next to:  Enable access for aassitive devices is deselected.

  • Using external XML document to update / change text fields inside of published captivate output.

    Hello
    I currently have a project where the client has requested to have the ability to update the text fields inside the project at a later date.
    This is due to the nature of the content changing rather rapidly, i would like to set this up so the client can manage this them selfs.
    What would the best way to do this be?
    I'm thinking XML, an external XML sheet were by Captivate imports the text from this XML sheet and then displays it within the specific text fields contained within the captivate output.
    This way the client would just update the external XML document(cut and paste the text in) and then the text would be dynamically updated in the published Captivate document.
    any help would be amazing !
    Thanks in advance
    Nick

    Hi Lieve
    But isn't this thread more about an end user having an ability to change text after the Captivate has been published and delivered? I could see where that might be useful if making changes then publishing to create a new output. But I'm interpreting that the situation here is that a Captivate project has been published and delivered, and some mechanism is desired that allows the recipient to modify an external XML file to influence changes in the already compiled Captivate output.
    Cheers... Rick

  • Dynamic Text and changing Text in AS3

    I have a Dynamic Text box in my Library.  I drag it to my main stage and give it a name..it is now a movieclip. The name is 'mcAdmin'.  I added an event listener for MOUSE_OVER.  I want the text to change color, but for now I'm just trying to change the text; however, it's not displaying the change in text I want.  I do a trace, and the change is in there on the output window, but it is not displayed as such.  How can I :
    1) use AS3 to change the font color of the text
    2) use AS3 to change the text and have it display?
    function onMouseOver_txtAdmin(e:MouseEvent):void
    Mouse.cursor="button";
    //Current mcAdmin text is 'Administration'
    //I want to change the color of Administartion on Mouse_Over
    //but to test if I can get to anything, I'm just trying to change the text.
    mcAdmin.text="Hello";
    trace(mcAdmin.text);
    mcPPMB.alpha=.5;
    mcASB.alpha=.5;
    mcISO.alpha=.5;
    mcEA.alpha=.5;
    mcAdmin.alpha=1;
    mcAdmin.scaleX=1.25;
    mcAdmin.scaleY=1.25;
    Thanks.

    1st
    give the textfield a name, if it hasn't already (sounds like you put it in a movieclip).
    to change the text set the text property of your text field
    like this
    myTextField_txt.text = "here is the text";
    or if it is inside a movieclip
    myClip_mc.myTextField_txt.text = "here is the text";
    To change the color you would need to put a TextFormat on it. To keep the same fontsize, font etc. you could first get the TextFormat from your existing Textfield, change the color of the TextFormat and set it on the TextField.
    // get the Textformat of the first character
                var TF:TextFormat = myTextField.getTextFormat(0,1)
    // set the font color
                TF.color = 0xff0000;
    // put it on the whole text
                myTextField.setTextFormat(TF)

  • Report error when using combo box and one text field is empty

    I'm building an interactive pdf in adobe pro 9. My problem is the following: I have one text field where you can enter a numeric code and that is used to populate another text field when I choose an option on one combo box.For example: suppose I write the code 123 in the text field "A" and that the combo box has two options ("data" and "-"). When I select "-", another text field "B" is empty, while when I select "data" i populate the text field "B" using the code entered "A" with the text "data_123". In order to do this I use the standard javascript code in the Format>Custom tab of the combo-box.
    My questions are:
    - how can I prevent the pdf to proceed selecting an option in the combo box when the field "A" is empty?
    - how can I update the field "B" every time that I change the text in "A"? I found that the text is "B" is updated only when I press the selection in the combo box.

    You can set the combo box to read-only in the Validate event of the A field:
    // Validate script for text field
    getField("combo1").readonly = !event.value;
    To update the value of B when A changes, you can expand the script above to something like:
    // Validate script for text field
    var f1 = getField("combo1");
    var f2 = getField("B");
    // If there is an entry in the A field...
    if (event.value) {
        f1.readonly = false;  // Make sure the combo box is activated
        f2.value = f1.value === "-" ? "" : "fa.value + event.value;  // Update the value of field B
    } else {
        f1.readonly = true;  // Deactivate the combo box
        f2.value = f2.defaultValue;  // Reset field B
    You might also want to reset the combo box somewhere in there, but it's not clear to me when you would want to do that.

  • Changing text  field (need more positions) of variant ZUK01 in FF67

    I am using a variant called ZUK01 in FF67. In that variant I have a Line item text field, but with not enough positions.
    Is it possible to change the field properties so I can change the positions of the field?
    I want to use the variant but need to feel in more text then I have positions.
    Is it possible to change it? So yes where can I find it?

    Hi,
    You could go to OT43 tcode (screen variant maintenance for manual bank statement); double click on your variant and note down your Field name (for text); then click on "Technical names" and note down the table and field for that field name. Then, from SE11; you can find out how many characters that field (data element) allows. Then, you can talk to ABAP team member for the possibilities: to enhance that data element or use another field for your purpose.
    Mani

  • Help changing text fields background

    Hello, I need help changing the field text background color. In some forms I use read only field texts, and I would like those ones to have a different color (like gray) so it is easy to see they are read only..
    How can I do that??
    Thanks for your help!!

    Nobody knows how to do it?

  • Cfpdfform (CF8) changes text-field font of an adobe 9 pdf form to Courier

    I'm having problems getting cfpdfform to render the text-field font as it exists in the source pdf form.
    The source pdf form was created in Acrobat 9 Standard.
    When I download the pdf from the server using cfcontent, the text-fields look as expected, retaining their designated font (and the pdf has the desired fonts embedded).
    However, when I do a cfpdfform action="populate", the text-field font is switched with Courier (even though the desired fonts remain embedded).
    This happens regardless of what font I pick.
    I have verified that the font exists on the server and in cf admin.
    Here's my code:
    <!--- populate --->
    <cfpdfform action="populate"
               source="#pdfPathFile#"
               destination = "#pdfPathFile#"
               overwrite = "yes">
        <cfpdfformparam name="student_name" value="first name and last name" />
        <cfpdfformparam name="certificate_title" value="a cool certificate title" />
        <cfpdfformparam name="certificate_date" value="1/1/2010" />
    </cfpdfform>
    <!--- make read-only --->
    <cfpdf action = "write"
           destination = "#pdfPathFile#"
           source = "#pdfPathFile#"
           flatten = "yes"
           overwrite = "yes"  />
    <!--- return the content --->
    <cfcontent
        file = "#pdfPathFile#"
        deleteFile = "yes"
        reset = "yes"
        type = "application/pdf" />
    Commenting out the cfpdf action = "write" block produced the same outcome.
    Using different source and destination filenames (vs overwriting  existing one) didn't make a difference, either.
    Any ideas on how I can get cfpdfform to respect my predefined text-field fonts?
    I truly appreciate your time.

    The problem was resolved.
    Turned out to be the way the pdf was created by Adobe 9 Standard that made cfpdfform misbehave.
    Three things we did seemed to have made the pdf acceptable by cfpdfform:
    1. Downloaded the latest updates for Adobe 9 Standard
    2. Checked on the text-field "Multi-line" property
    3. Checked off the text-field "Rich Text Formatting" property
    Cheers.

  • How to store/manipulate Date and long text fields with Dictionary project

    I am able to save string values into my backend (SQL Server) database in my web dynpro project but I am getting errors dealing with my date string and my long text (comments) field. 
    I want to figure out both how I need to define the fields in the dictionary project, how to define the context variables in web dynpro, and how to code the statements to pull the values out of the context and into fields I can use in my SQL insert. 
    Currently I have the date defined in the dictionary project as "date" and the comments as a 256-character string. 
    In the web dynpro context I have the date field defined as "date" and the comments field defined as "string".  Should I define a 256-character string type and use that as field type??
    In the code I am using the following to get the values:
         String s9 = (String) wdContext.nodeReceipt().getElementAt(wdContext.nodeReceipt().getLeadSelection()).getAttributeValue("Comments");
    String s5 = (String) wdContext.nodeReceipt().getElementAt(wdContext.nodeReceipt().getLeadSelection()).getAttributeValue("DateReceived");
    SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
         try {
         Date dt = sdf.parse(s5);
         } catch (Exception e) {
              e.printStackTrace();
    I then try to insert all of my values with the following code:
    InitialContext ctx = new InitialContext();
      javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("jdbc/SAP/BC_JMS");
      java.sql.Connection con = ds.getConnection();
      java.sql.Statement stmt = con.createStatement();
      stmt.executeUpdate("insert into AVD_GEN_REC(VENDOR,DATE_RECEIVED,TOTAL_PIECES,LOGGED_BY," +
           "ADDRESSED_TO,BLDG_NO,CARRIER,TRACKING_NO, COMMENTS) values('s1','s5','s2','s6','s3','s7','s4','s8','s9')");
       } catch (Exception e) {
             wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Exception "+e.getMessage());
    Any help/ideas would be appreciated...

    The comment error seems to have resolved itself but I still get an error with the date field:
    Exception The SQL statement "INSERT INTO "AVD_GEN_REC" ("VENDOR","DATE_RECEIVED","TOTAL_PIECES","LOGGED_BY","ADDRESSED_TO","BLDG_NO","CARRIER","TRACKING_NO","COMMENTS") VALUES ('s1','d5','s2','s6','s3','s7','s4','s8','s9')" contains the semantics error[s]: type check error: new value (element number 2) is not assignable to column "DATE_RECEIVED" 
    The DATE_RECEIVED is defined in the data dictionary as "date", the context variable "DateReceived" is also a "date", and the statement to pull d5 is being stored to a "Date".  Is there a difference between the "Date" and "date"?
    Date d5   = wdContext.currentReceiptElement().getDateReceived();

  • Drag and drop text fields

    Hey.  trying to drag and drop a text field.  So I have created a text field, and saved it as a swf.  I then load it in using xml and the loader class.  When I go to pick it up, i get the error
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.text::TextField@10d59b51 to flash.display.Sprite.
        at GalleryNew_fla::MainTimeline/pickUp()[GalleryNew_fla.MainTimeline::frame1:81]
    It is specifically pointing to
    function pickUp(event:MouseEvent):void {
        getPosition(event.target);
        stage.addChild(event.target as DisplayObject);
        Sprite(event.target).startDrag(true);
    Should I be casting it to something else or something?
    cheers

    I will try and explain what I am doing better, because I am problably doing this tottally wrong, I am just mixing a lot of code to get something together.
    Basically, I have several buttons.  If a button is pressed, it displays objects in a sort of holder.  These objects might be images, animations etc.  When these are placed in the holder, they can be dragged and dropped.  If they are not dropped in the right location, they go back to their position in the holder.
    So, my first two buttons work great.  These just deal with images.  button5, which I am working on now, is dealing with textfields.  So, it should load my textfield swfs, place them in the holder, and made to be drop and draggable.  Problem is, I am using the code which i used for the images, which is where I might be going wrong.
    If I show you the code, maybe you could suggest a better way to do things
    Cheers
    import caurina.transitions.*;
    var xml:XML;
    var xmlList:XMLList;
    var urlLoader:URLLoader;
    button1.addEventListener(MouseEvent.CLICK, click_handler);
    button2.addEventListener(MouseEvent.CLICK, click_handler2);
    button5.addEventListener(MouseEvent.CLICK, click_handler5);
    function click_handler(event_object:MouseEvent) {
         removeChildren(photoContainer);
         while (arrayThumb.length > 0) {
              arrayThumb.pop();
         loadXML("pics.xml");
    function click_handler2(event_object:MouseEvent) {
         removeChildren(photoContainer);
         while (arrayThumb.length > 0) {
              arrayThumb.pop();
         loadXML("pics2.xml");
    function click_handler5(event_object:MouseEvent) {
         removeChildren(photoContainer);
         while (arrayThumb.length > 0) {
              arrayThumb.pop();
         loadXML("pics5.xml");
    function removeChildren(doc:DisplayObjectContainer):void {
         while (doc.numChildren > 0) {
              doc.removeChildAt(0);
    function loadXML(xmlS:String):void {
         var urlRequest:URLRequest=new URLRequest(xmlS);
         urlLoader = new URLLoader();
         urlLoader.load(urlRequest);
         urlLoader.addEventListener(Event.COMPLETE,urlLoaded);
    var arrayThumb:Array=[];
    var photoContainer:Sprite = new Sprite();
    addChild(photoContainer);
    photoContainer.mask=thumb_holder;
    function urlLoaded(event:Event):void {
         urlLoader.removeEventListener(Event.COMPLETE,urlLoaded);
         xml=XML(event.target.data);
         xmlList=xml.children();
         for (var i:int=0; i<xmlList.length(); i++) {
              var thumb:Thumbnail=new Thumbnail(xmlList[i].url);
              arrayThumb.push(thumb);
              arrayThumb[i].y=150.5;
              arrayThumb[i].x=i*110+280;
              photoContainer.addChild(thumb);
              arrayThumb[i].addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
              arrayThumb[i].addEventListener(MouseEvent.MOUSE_UP, dropIt);
    var xPos:int;
    var yPos:int;
    function getPosition(target:Object):void {
         xPos=target.x;
         yPos=target.y;
    function pickUp(event:MouseEvent):void {
         getPosition(event.target);
         stage.addChild(event.target as DisplayObject);
         Sprite(event.target).startDrag(true);
    function dropIt(event:MouseEvent):void {
         Sprite(event.target).stopDrag();
         if (event.target.hitTestObject(getChildByName("movie"))) {
              var my_loader:Loader = new Loader();
              var myString:String=event.target.url;
              var newString:String=myString.replace("pics/","");
              my_loader.load(new URLRequest("pics2/" + newString));
              movie.addChild(my_loader);
              this.photoContainer.addChild(event.target as DisplayObject);
              event.target.x=xPos;
              event.target.y=yPos;
         } else {
              this.photoContainer.addChild(event.target as DisplayObject);
              event.target.x=xPos;
              event.target.y=yPos;
    var minScroll:Number=0;
    var maxScroll:Number=track.width-handler.width;
    var draging:Boolean=false;
    var bounds:Rectangle=new Rectangle(handler.x,handler.y,maxScroll,0);
    handler.buttonMode=true;
    handler.addEventListener(MouseEvent.MOUSE_DOWN,beginDrag);
    function beginDrag(event:MouseEvent):void {
         handler.startDrag(false,bounds);
         draging=true;
         handler.addEventListener(Event.ENTER_FRAME,checkingProgress);
         stage.addEventListener(MouseEvent.MOUSE_UP,endDrag);
    function endDrag(event:MouseEvent):void {
         handler.stopDrag();
         draging=false;
    function checkingProgress(event:Event):void {
         var procent:Number=handler.x/maxScroll;
         if (draging) {
              Tweener.addTween(photoContainer,{x:(475-procent*(photoContainer.width-thumb_holder.width)),time:1});

  • Can I have a pop down menu on the left and then text fields directly to the right? I can only get them to be one above the other.

    Hi All,
    I am building a form and would like to create a pop down menu on the left (and ideally with the options being colour boxes boxes but this does not seem possible), and then have three text separated text lines on the right of the pop down menu for notes related to the pop down choices.
    Do you know if this is possible?
    Thanks,
    Matt

    It sounds like you're creating the form in FormsCentral. You have limited options in the FormsCentral designer as far as layout. You can place multiple fields on a line, or one field per line. If you create the design/layout in a program like InDesign or Word, generate a PDF, and add the fields form in Acrobat, you have complete flexibility over the placement of the fields.
    The items in a dropdown field are limited to text that are all the same color.

Maybe you are looking for