How can I place Locale.loadString ("IDS_001") on button.label

I am retrieving the system locale and must place the fields of the table in their respective places.

For example, one of them being


IDS_001

This works and refers to what I expected probably. But why she returns several instances, I can't figure out yet.

          public var vIDS_001:String;

          Locale.autoReplace = true;
           
                 var localeName:String = LocaleID.DEFAULT;
                 var nf:StringTools = new StringTools(localeName);
                               trace("Actual local ID: " + nf.actualLocaleIDName);
           var defLang:String = nf.actualLocaleIDName;          
                                          trace( "Last Operation Status: " + nf.lastOperationStatus );  
                    
           Locale.setDefaultLang(defLang);
           Locale.setLoadCallback(localeCallback);
           //Locale.addXMLPath("defLang", "../en/PinPointPremium_en.xml");
                      Locale.addXMLPath("defLang", "../" + defLang + "/PinPointPremium_" + defLang + ".xml");
           
           function localeCallback(success:Boolean) {
            if (success) {
                // trace(Locale.stringIDArray); // IDS_GREETING
                 trace(Locale.loadString("IDS_001"));
                 var vIDS_001 = (Locale.loadString("IDS_001"));
                 trace("+++" + vIDS_001);
            } else {
                 trace("unable to load XML");
            }
           }


Actual local ID: en-GB
Last Operation Status: noError
PinPoint the Entered Address
+++PinPoint the Entered Address
PinPoint the Entered Address
+++PinPoint the Entered Address
Test Movie terminated.

This is the code for the button, and I'm trying to figure out how to get this information from IDS_001 in the btnGPS.label. No matter what I try, it-error

             btnGPS = new Button();
          btnGPS.width = stage.stageWidth - 20;
          btnGPS.height = 25;
          btnGPS.x = 10;
          btnGPS.alpha = 0.9;
                // btnGPS.label = "PinPoint My Current Location";
          btnGPS.setStyle("textFormat", btnFormat);
          btnGPS.y = stage.stageHeight - 46;
          btnGPS.addEventListener(MouseEvent.CLICK, btnGPSMouseClickHandler);
          addChild(btnGPS);

None of these following works instead of the original

          
                //btnGPS.label = Locale.loadString("IDS_001");
          //btnGPS.label = IDS_001;
                //btnGPS.label = vIDS_001;

Theoretically, the loading of the XML of the locale must fill the occurrences of IDS_001 - but now I'm completely lost. Been watching this for a few days and now can not see the real picture. Someone has any idea how to solve this please... I know that it is so simple, but I can't get it.

Thank you

I tried this:

Locale.setLoadCallback (localeCallback);

Locale.loadLanguageXML("en");

function localeCallback(success:Boolean):void

{

If (success)

{

BTN.label = Locale.loadString ("IDS_001");

}

on the other

{

}

}

and it works for me, with a buttoncomponent named "btn" on stage.

The moment where I take this line out of the callback function, I get the same errors as you:

TypeError: Error #2007: text parameter must be non-null.

to flash. text::TextField / set text()

to Sun fl.controls::LabelButton / set

Tags: Adobe Animate

Similar Questions

  • How can I place locale specified resources?

    for example,.

    There are 2 images, one is for en-US, the other is for zh - CN

    How can I set it so that it will automatically be recognized by cascades?

    Thank you.

    There is no automatic mechanism to do this.
    You can add the path of the image in the translation files or use a standardized name model and replace the images in onlocalechanged.

  • How can I place a STOP button on my toolbar. I would like to stop firefox from loading a page by pressing the STOP button, but I can't find it in the toolbar options.

    How can I place a STOP button on my toolbar. I would like to stop firefox from loading a page by pressing the STOP button, but I can't find it in the toolbar options.

    First of all, if you have the menu bar show. (File-Edit-View-History-Bookmarks-Tools-Help), then you won't see the orange FireFox button because in the new version of FireFox button replaces the menu bar. You can believe that's the way you want by clicking on 'View', then place your cursor over "Toolbars" and check or uncheck menu bar. If you have the display on menu bar, click on 'View' then drag down to "Toolbars", then descend to the right and go to 'customize '; a click on it. Then, when the next screen appears, even if 'Reload' is not displayed on this topic, it appears somewhere upwards in your toolbar. (Mine was above the Google search box). Put your cursor on it and drag-and - drop to the left of your address bar. The "Stop" button should be left more than the button 'recharge' in order to get two separate buttons for these tasks. If the 'Reload' button is further to the left, then you get a single button that performs the tasks at the same time. I hope this helps.

  • My taskbar is vertical on the right side of the screen. How can I place horizontally at the bottom of the screen?

    Original title: taskbar

    My taskbar is vertical on the right side of the screen. How can I place horizontally at the bottom of the screen?

    Right-click on the taskbar and make sure that lock the taskbar is not checked. Now click on taskbar and keep the left button of the mouse down and drag the mouse to the bottom of the screen - possibly the taskbar should move to the bottom of the screen. Right-click on the taskbar and make sure lock taskbar is checked

  • How can I place first CS5 CS6 initially bypassing the CC formula?

    How can I place first CS5 CS6 initially bypassing the CC formula?  I just downloaded first CS6 but need an update of the serial number to use it as I currently have CS5.  Where can I get the CS5, CS6 upgrade?  Thank you.

    Try this phone number +.

    Creative cloud now includes the features of Creative Suite Master Collection and Design Premium

  • How can I place two images on the screen?

    Hello

    I need to compare two images on the screen to see the colors are the same.

    How can I place two or three images on screen from Lightroom?

    Thank you for reading

    Lightroom allows you to use the comparison mode in the library Module, select the two images desired and press c.

    Also in the library Module is mode of investigation where you can select two or more wanted images, then press n.

  • How can I place an illustrator as a background texture in muse?

    need help! How can I place an illustrator as a background texture in muse?

    Export the Illustrator file .svg file and import it in Muse.

  • How can I place a video clip in CS6 in an irregular shape

    How can I place a video clip in CS6 in an irregular shape please

    Do the white and then use a matte.

  • How can I place a text box on the other in the left column of my head?

    Greetings! Below, you will find something that I worked on a link. Now I have to change the left side of the header that contains the text box "Hiring" in a box on top of each other using the same amount of space. I also need to make these 2 boxes pop out when you click them but only one at a time. How can I place a text over another box using the same amount of space without any screwing? I could also use some help getting these images that say 'HIRE' and 'FIELD NEWS' inside boxes instead of above them.

    Thank you in advance. http://www.bestmarketingnames.com/xbanneredit.php

    Despite the CF McBlob comments that I share, I'll try to answer your question immediately. Just add this new markup above your other div scroll like this:

  • I just download v4.0. How can I get the third arrow back button navigation, which allows the selection of a page forward or back?

    I just download v4.0. How can I get the third arrow back button navigation, which allows the selection of a page forward or back?

    Don't know how to get the exact button back (sorry) I dig around too much to do...
    But! Today, I found by chance that by clicking and holding on the back button the same box to popup in last-12-sites and you can stream on the list to return to that particular site.

    Not exactly what you (and me) tried but at least the functionality is there.

    Good luck!

  • In safe MODE, search with the administrator account can not find secpol.msc, otherwise how can I access local policies?

    I need to disable the Mode of UAC Group Policy by accessing local policies in W7 but start/search can't find secpol.msc. Access is denied to the different files of the user, search on internet Explorer 9 wit request options for the approval of the system of. Iamthe single personal onthis computer administrator at home. Start/Search can not find secpol.msc, nor can I change the default search even IE9 mode without failure. How can I Devil Mode of UAC Group Policy and eliminate the ghost system administrator?

    If you have Windows 7 Home Premium then it didn't GOT secpol.

    Why do you feel the need to turn off UAC on a computer at home? You should not really, you know, and in fact there is absolutely no need to do.

    So what user files you are denied access to? Is it Documents and Settings perhaps?

  • How can I share local drives exclusively between my 4 computers on the network?

    Hello
    Now I'm sharing local drives between my computers setting to share with everyone and which works very well but I'm worried about my brothers and sisters, to access my files.
    I want my 4 computers to share their local hard drives exclusively between them so, how can I do?
    I tried to add permissions for each computer individually but every time I have to try give me a message "the next object is not a domain listed in the Select location dialog box, and is therefore not valid" here is a screenshot of this:
    http://img502.imageshack.us/img502/4425/82018296.PNG

    And btw my computers all have the same user name and password are.
    Thanks for the help I appreciate it sincerely from the bottom of my heart =)

    In the network and sharing settings / advanced sharing settings / turn sharing protected by password. Use a unique name for the corresponding user password on your four computers.
    Set the Public sharing or disable as your prefer for your public folders and organize your files accordingly.

  • How can I place an indd - just the text file?

    Hello.

    This is a snippet of my code.

    var tfiImport = File("C:/Users/Me/Documents/YS/Exported Stories/YS_full_pg.indd");
            tfYS[0].insertionPoints.item(-1).place(tfiImport);
    
    

    I'm trying to import an indd file in a pre-existing text block. The framework becomes excess, because the indd file is placed in actual size.

    The indd is a text file with different styles applied. I just want retrieve this text with styles and place it in my text, auto to flow if necessary.

    How can I do?

    Any help would be appreciated.

    Hi SK,

    you would open the InDesign document and duplicate the text at your insertion point.

    Both documents are open.

    The insertion point where you want to "place" the formatted text is selected.

    There is at least a block of text with a paragraph in the document where you want to duplicate.

    Example:

    var targetDocument = app.documents[0]; // The active document
    var sourceDocument = app.documents[1];
    
    var targetInsertionPoint = app.selection[0].insertionPoints[0];
    
    sourceDocument.textFrames[0].paragraphs[0].duplicate(LocationOptions.AFTER,targetInsertionPoint);
    

    Example:

    To duplicate the whole text of a story where you know a block of text of this story:

    sourceDocument.textFrames[0].parentStory.texts[0].duplicate(LocationOptions.AFTER,targetInsertionPoint);
    

    Search for the text in the documentation for DOM object and its methods.

    Adobe InDesign CS6 (8,0) object model JS: text

    Also app.open () method:

    Adobe InDesign CS6 (8,0) object model JS: Application

    Uwe

  • How can I place a navigation menu in a slide show?

    Hello

    I want to have a widget of empty composition with the scrolling of the images at the top of my home page and in the navigation to sit on top of it. When I placed the items in menu above the image, it seems, until the Gallery moves to the next image and disappears from the navigation. Of course, he sits as part of the image is moved with the image - how can I avoid this happening?

    Any suggestions would be welcome.

    Thank you.

    Hello

    There are two options that you can use.

    Either use a slide show instead of the Composition widget Widget.

    Or you can place first the Menu Widget outside the Widget and then use the arrow keys to move and place it above the widget of Composition.

    I hope this helps.

    Kind regards
    Sachin

  • How can I place a copy of the book of fonts on the desktop

    can I place a copy of the book of fonts on the desktop?

    Never move applications from the Applications folder.

    Instead of launching the book of fonts of your dock.

    The icon of the application book fonts looks like a book with a big F.

Maybe you are looking for