In the Label alignment Center

Hello
I work in flex 4.

I use a string named str varaible and I stored
Str = "would become computer literal to alll his things in six months with a computer."

I want the str variable is divided into San and William. I used to divide the str variable by using the following lines

if(Str.Length>50)
{
San = str.substring (0, str.lastIndexOf ("", 50));
slithe = str.substring (str.lastIndexOf ("", 50) + 1);
firstLine();
Alert.Show (William);
}
on the other
{
San = str;
slithe ="";
firstLine();

}

So I want to create labels of words each using these lines


private void firstLine (): void
{
Alert.Show (San);
var l1:Number = fline.length;
Alert.Show (L1. ToString());

myArr = Fline.Split ("");
myarr1 = slithe. Split("");

var l1:Number = Number (l);
= myarr.length inputValue;
Alert.Show (inputValue.ToString ());
for (var intLoop:int = 0; intLoop < inputValue; intLoop ++)
{
LBL = new Sun;
LBL.ID = "l" + intLoop;
LBL. Text = myarr [intLoop];
LBL1 = new Sun;
LBL1.ID = "l" + intLoop;
LBL1. Text = myarr1 [intLoop];

lbl.addEventListener (MouseEvent.MOUSE_OVER, onLabelOver);
lbl.addEventListener (MouseEvent.CLICK, onLabelClick);
lbl.addEventListener (MouseEvent.MOUSE_OUT, onLabelOut);
lbl.styleName = "hai1";

LBL1.addEventListener (MouseEvent.MOUSE_OVER, onLabelOver);
LBL1.addEventListener (MouseEvent.CLICK, onLabelClick);
LBL1.addEventListener (MouseEvent.MOUSE_OUT, onLabelOut);
LBL1.styleName = "hai1";

labelBox.addChild (lbl);
labelBox1.addChild (lbl1);

}
labelBox.styleName = "lblalign";

}

After I shared the words Add the words (lbl) in labelBox and labelBox1.
Here the LabelBox and LabelBox1

< mx:HBox id = "labelBox" x = "54" y = "263" width = "389" height = "18" color = "#FFFFFF" alpha = "0.40" backgroundColor = "#000101" >
< / mx:HBox >
< mx:HBox id = "labelBox1" width = "389" height = "20" color = "#FFFFFF" alpha = "0.40" backgroundColor = "#000000" x = "54" y = "280" >

< / mx:HBox >


This is displayed as follows
Would become computer literal to alll
its things in six months with a computer

but my requirement is to align this line towards the Center.

Would become computer literal to alll
its things in six months with a computer

Is this possible.
If possible ways give me some ideas.

concerning
Athi

Hi Athiroy,

Specify the properties... horizontalAlign = "center" on HBox, if you want to align the label horizontally Center.

If you want to vertically align Center... then specify verticalAlign = "middle" for HBox

horizontalAlign = "center" verticalAlign = "middle" color = "#FFFFFF" alpha = "0.40" backgroundColor = "#000101" >

Thank you

Jean Claude

Tags: Flex

Similar Questions

  • Align to right the label text

    How to make the text inside the right side of the label aligned using c ++

    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    ...
    
    TextStyle rightAlignedStyle(SystemDefaults::TextStyles::bodyText());
    rightAlignedStyle.setTextAlign(TextAlign::Right);
    
    ...
    
    Label *label = Label::create()
            .textStyle(rightAlignedStyle);
    
    or
    
    label->setTextStyle(rightAlignedStyle);
    
  • Alignment of the label

    I have four check boxes. The user wants to first on his own line and the other four on the next line. The first has a long label, the others have a single word labels. I can't have the second line of four to align directly under the label of the box above. Line up the labels themselves. I'll try to imitate below, although I realize that sometimes spaces do align well in this message box...

    That's what I want:

    This is the label for the first box X
    2 X 3 X 4 X 5 X


    That's what I have:
    This is the Label for the First Checkbox    X
                                                    two  X    three X    four X    five X
    or, with the label aligned to the left
    This is the Label for the First Checkbox    X
    two                                                  X    three X    four X    five X
    Thanks in advance,
    Alexandra

    I'll take a look at the "quick fix" you sent... Thank you!

    Does not work: applies only to the boxes in a single element.

    I'm assuming that these boxes are the first/only on a line? Otherwise I don't think it would be so difficult... but the layout of the APEX form engine has a particular quirk: the label for the first part of the line still occupies a cell of table in itself. We can't get anything other than this single label in there, and that's causing your problem.

    There are probably a number of ways to work around that. Because it's brands that are the cause of the problem, it must end with integrated labels.

    1. create your own labels in the Pre element for each item text:

    
    

    substituting P22_YN1 with the name of each element (see the label corresponding to the terminology models).

    2 remove the labels of items and the label template for each element of the value Label No.

    3. set the display properties for the first box:

    Start on a new line: Yes field: Yes

    and for others, to:

    Start on a new line: No. : No.

    4 set the message for the first item text box:


    This approach puts all checkboxes in a form table cell. It will also work with them in separate cells by changing start it on new line... The field of values, defining a ColSpan for the first and losing the < br / >.

    In this way don't play nice with the validation messages online. If this is a problem, then a different approach is called for. Creating mock objects at the beginning of lines...?

  • Alignment of the label to mobileiconitemrenderer

    I have a custom element rendered for a list in an application to run on android and finds it difficult to get the label ' ' to align in the Center.

    The code is;

    override public function set data(value:Object):void {}

    If (value! = null) { }

    Super.Data = value;

    setStyle("fontSize",18);

    If (value.assigned) { }

    Label = "[ASSIGNED YOU]."

    setStyle ("textAlign", "Center");

    }

    else {

    setStyle ("color", 0xFFFF00);

    Label = "[PRESS TO ACQUIRE]."

    }

    height = 150;

    iconWidth = 75;

    iconHeight = 75;

    iconFunction = getIcon;

    messageFunction = getMessage;

    }

    }

    The colors and the fontsize appear to work well, but the label remains aligned to the left. I also tried to set the alignment in the list that is the owner of the converter.   Any ideas?

    It looks like you use a preview version very soon.  MobileIconItemRenderer has been renamed to IconItemRenderer, and it seems to work for me, the final version of Flex 4.5:

    one

    two

    three

    override public function set data(value:Object):void {}

    Super.Data = value;

    If (! data)

    return;

    If (data == 'two') {}

    setStyle ("'textAlign","Center");

    }

    }

    ]]>

  • Center (bb10) vertically on the label text

    Hi guys!

    Is there a way to vertically Center the text on the label?

    Suppose you have a label with heithg = 200 and I want to Center vertically.

    Is this possible?

    I think that there is no such thing as a valign, or almost, but if you set the height of the label on the actual height of the text you can then focus on it vertically by applying equal and the margin down (if you use layoutData) or something like

    myLabel.y = (availableHeight - myLabel.height) / 2...

    Note that you can not get the height of the text until the label is rendered or less placed in the display list (otherwise, it returns 0)

    myLabel.validateNow();
    myLabel.height = myLabel.textHeight;
    

    My app: Get set - get up!   Get ready for the revolution snooze.

  • File IDML opening with vertical alignment of text in the box set "Center".

    I got a batch of files, asking me to review. They were saved as files CC as well as .idml. I have used .idml since the sender used plugins files that are not included in the package. Using the .idml, I do not get the warning about the missing plugins. However, when I open the idml files that all text boxes are the vertical value Center instead of top. Very tedious. CC files opened correctly (with the exception of the warning about the missing plugins).

    Is it possible to open the idmls and get the vertical alignment to open as "top"? Or should I use the CC files and ignore the warning on the plugins?

    Thank you!

    Tim

    Guess I'm stuck with opening the idml docs and manually change each vertical alignment of text box.

    With Find\Change you can:

    Find/replace > object tab

    Tye: Blocks of text

    Change object Format: click on specify the attributes to modify > text frame general Options > vertical Justification > Align > Top

    Then find and change or change all

  • Alignment of the label fast?

    Hi all

    I want to align the prompt label and the guest in the coast to coast path, as explained in the link below.

    http://obiee101.blogspot.com/2009/04/OBIEE-prompts-putting-label-in-front_18.html

    I was able to achieve. But is it possible to increase the space between the label and the prompt?

    Thank you for your help in advance.

    Thank you
    Knani

    Change what you have this:

    Replace the 15px at some distance you want.

    Hope that's what you're after,

    J

  • Align the label of an af:inputText on TOP

    I want to align the top of the label of a using whithout af:inputText:

    < af:panelFormLayout labelalignment = "top" >

    Is this possible?

    OBS.: In Adf 11g

    Thank you

    I think you should put in a component separate af:outputLabel.
    You can always do a layout our AF: panelGroupLayout-s.

    
    
    
    
    
    
    

    or

    
    
    
    
    
    
    

    Depends on what makes the rest of the page looks like.

    Edited by: Valhery April 25, 2010 06:52

  • Alignment of the label question form

    In my current application, I have a lot of forms with each with sets of form elements, as follows:

    < mx:Form id = "theForm" >
    < mx:FormItem id = "formName" label = "" name: "width ="100% ">"
    < mx:TextInput id = "formNameText" text = 'Epsilon' / >
    < / mx:FormItem >
    < mx:FormItem id = "formDesc" label = "" name: "width ="100% ">"
    < mx:TextArea id = "formDescText" text = "Lorem sit amet ipsum dolar" / >
    < / mx:FormItem >
    < / mx:Form >

    Which is all very well, but by default the entire text of the label is displayed as well aligned. I would like to change this to left aligned, but I'm not finding a way. I tried on the shape and textAlign textAlign and horizontalAlign on the FormItem, without effect. I went through the reference language for FormItems and found the FormItemLabel object, which is supposed to support textAlign, but who, in CSS, did nothing. Y at - it a property somewhere that controls this, or I have no choice but to rebuild everything that elements in absolute position and empty the form?

    The only way for you to do is to create your own extension to FormItem class. Form and FormItem are deliberately rigid in this sense; That's the purpose of the form and align the labels in this way. The container form MXML, unlike an HTML form, has no special meaning beyond the page layout.

    If you don't want to extend the FormItem class, and then use the container for the grid (not DataGrid) and align objects as you want. Think of the grid as the equivalent in HTML format

    tag.

    If you have Flex Builder 2, make a grid in design mode will be much easier than hand coding it.

  • Select the label with VI Server/scripts

    I am trying to flush out my script code - and one of the functions I did auto pulls the focus of controls recently interrupted/indicators LABEL on the FP - I want to be able to select the text of the label - and I thought it was possible with VI Server Label.Selection.  I use another VI to take Ref VI of VI I am tracking to get the last control on the PC using the script to browse function - that part works fine.

    Label.Selection does not work, even when I set immediately KeyFocus = TRUE before the Label.Selection property.  I even inserted a frame VIFrontPanel.IsForemost is TRUE for the target VI before asking the KeyFocus for control...

    I checked that the target VI is slowed DOWN by reading the State of the VI.

    OBJECTIVE: I try to imitate the selection of the entire label that happens when you drop a new control.

    Any idea would be appreciated.  I've posted on the Board of Scripting - but do not get any response.

    On my Windows machine I would probably use a little trick of mouse function using user32.dll.

    Here, I simply select the first control, place the cursor in the center of the label and the false double click.  Then I move the cursor to the lower right.

  • DeskJet d2430: printer does not appear in the hp Solution Center

    I installed the HP Solution Center. My scanner appears but the printer does not work so I can't align the cartridges or print test pages.

    How can I get the printer on the solution Center

    Welcome to the HP Forums @eclife

    I saw your post on how you manage not to run a test print from the solution Center pages or alignment, and I wanted to stop sharing my own suggestions.

    Try to download and install the full feature software and driver, and then try again: series of printers HP Deskjet D1400, D2400/D4200 Full Feature Software and Driver

    A few links to help:

    Align the ink cartridges

    User manual

    If you have any other questions, let me know.

    Click on the thumb to below testify my help!

    Click on the "accept as Solution" if I'm you guide to a solution!

    Contact HP:

    Step 1. Open the link: www.hp.com/contacthp/

    Step 2. Enter the product number or select Auto detection

    Step 3. Scroll up to "still need help? Fill out the form to select your contact options.

    Step 4. Scroll down and click on: contact HP options - click Get phone number

    File number and phone number appear

  • Suddenly won't scan hp 8600 function, and the hp Solution Center does not connect?

    I have been regularly using scanning, copying and printing to my HP 8600 printer features 4/1. All of a sudden when I click on the printer icon only functions of the printer are listed. When I click on the HP Solutions Center (which I have not had to do was s/u w / a previous printer) the message says: HP Solution Center cannot run b/c your device installation is not complete. PLS, connect the cable usb or re - run the Setup program from the installation to a network installation CD. If this does not work...

    I insert the CD, re-directed the s/u and nothing has changed. Please notify.

    HP 4/1 8600

    Windows 7

    I see that you have had previous HP products, Katharine. I'm glad to know that you have the software installed for the 8600 with success now.

    However, the center of Solution software you used with the previous units is more used to the 8600. The software installed for the 8600 should have placed an icon that resembles the printer with the name of the printer it labeling on your desktop. This icon opens the wizard of HP printer with options to control the printer.

    Good impression!

  • OnImmediateValueChanged cursor does not update the label text by dragging.

    Consider the following:

    Container {
            layout: DockLayout {}
            Label {
                id: label
                textStyle.base: SystemDefaults.TextStyles.BigText
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
            }
    
            Slider {
                fromValue: 0
                toValue: 59
                value: 0
                 onImmediateValueChanged: {
                     label.text = value;
                 }
            }
        }
    

    When you drag the cursor, it does not update the text of the label smoothly. How can I achieve this?

    Found the solution!

    By mistake I used the value parameter and not immediateValue in the onImmediateValueChanged function!

  • How to return to an earlier version of the HP Solution Center?

    Hello

    I have a HP Ultrabook (Windows 7) and an all-in-one (quite old), the HP PhotoSmart C3180, as well as a HP Scanjet G4050. Everything was dandy until I installed the latest version of the HP Solution Center.

    Which led to (1) make the C3180 not scan, and (2) launch its color print record (he can no longer auto-align color prints are fuzzy).

    Of course, I'm tempted to revert to the previous version of the HP Solution Center and stay with it. Could someone explain to me how this is done?

    I currently have version 130.0.44.62 of the installed Solution Center.

    Thank you

    John

    Hi Jayfull,

    I can't wait to hear that you have questions. Unfortunately the previous versions of the software for this printer are not compatible with Windows 7.  You may be able to get some of the components to install another operating system or install it using compatibility mode, but there is no guarantee that any of these options will work. I have included a link to the Microsoft support page to use the software in compatiability mode. Are you able to analyze through fax scan Windows or MS paint? The solution center should not have caused the alignment problems or blurred impressions seen. We must address the possibility of a failure of the printer if you are unable to align. You are able to print the self-test page?  See if you can access the Toolbox through the preferences to perform the alignment, please see the steps below.  Also before trying the software in compatibility mode, click here to run the doctor print and scan. Click on the + sign next to the utility-diagnostic tools, and then click Download next to print and scan the doctor.  We may be able to solve the problems of simple software with Solution Center through utility which can help with the issue.

    Search the Toolbox:

    1. go to the printed case

    2. right click on the printer driver, the printer properties select

    3. in the populous dialog box, on the general tab, click the Preferences button down

    4. click on the features tab

    5. click on the services below to the right printer button

    6. Select the services tab

    7. if available select align cartridges

    To print a self-test report:

    1. press and hold cancel them on the control panel.

    2 press and hold Cancel, press start copy color.

    Print the self-test report

    Make older programs in this version of Windows, click here NOTE: this is a 3rd party site, HP and I are not responsible for the content of this page.

    Let me know the above information and the results of the utility, attempt to page and alignment test.  I'll help you in any way I can.

  • Custom ActiveTextHandler: handle #hashtag and @mention in the label

    Hi all

    Can we do a manager of custom text in the Label control?

    Example: I want to handle '#somehashtag' or '@someuser' when'm typed by the user.

    Currently, only html like 'http' if I using standart ActiveTextHandler, tag would get shares.

    Thank you.

    Yippee... I think it should work...

        Label {
                text: "www.w3schools.com;\">Visit W3Schools"
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
    
                activeTextHandler: ActiveTextHandler {
                    onTriggered: {
                       console.log("Seems to work fine"+event.text);
                    }
    
                }
            }
    

    I used the HTML in the text of the label...

    activeTextHandler can be used to handle the clicked event...

    Note: I havnt been to manage the click... I just checked with newspapers... If I m able to get the event.text.

    -Dishooom

Maybe you are looking for