Setting dynamic widths for textfields in as3?

I have 3 textfields. they're in a sprite container. 1. date 2. pipe_mc movieclip 3. title field. I need to set it so that the textfield/mc/textfield;s x property changes dynamically when a shorter or longer date gets added into the field, via XML.
Here is the code:
addChild(dateline);
dateline.addChild(date_txt);
dateline.addChild(title_txt);
dateline.addChild(pipe_mc);
date_txt.x = 3;
var spacer:Number = 10;
if (date_txt.textWidth >= 90) {
pipe_mc.x = date_txt.x + date_txt.width + 18;
title_txt.x = pipe_mc.x + pipe_mc.width + spacer;
else if (date_txt.textWidth <= 90) {
pipe_mc.x = date_txt.x + date_txt.width - 18;
title_txt.x = pipe_mc.x + pipe_mc.width + spacer;
pipe_mc.visible = true;
Any help or suggestions are welcome
Thanks

Do you have the textfield set up to be autoSized?  Is there a reason for having three textfields separate rather than combining the text into one textfield with sufficient spacing between the entries?

Similar Messages

  • Set dynamic variant for time

    Hi,
    I have selection options for field as defined as TIME . I need to set dynamic variant for this field as
    TIME should be "from"='current time-30 minutes' and "to"='24:59:59'.
    This report going to run in 00 hours and 30 hours (48 times ie 24 X 2)
    PS : Pl. remember this is for a SAP standard report
    Any Info?

    Naimesh Patel wrote:
    > I digged more deeper and found one FM RS_VARI_V_INIT_TIME which fill the options like Current Time, Current Time +/- ???, From Start of Day to Now etc. and Surprisinly all 3 options are hardcoded in it..!!
    As you suggested due to hardcoded values here , we could not able to do much on this.
    So i came in round away solution. Whenever program A called ( program with TIME selection input) i have called another custom program C . (This custom program will using the following function module RS_VARIANT_CONTENTS, and RS_VARIANT_CHANGE , So get the DEFAULT variant content of program A and change the variant content with LOW as current time - 30 and HIGH with 24:59:59)  as preceding job.
    In PI 7.01 system program A always called in JOB mode
    Thanks for info.

  • How to set the width for a selectManyShuttle component

    Hi,
    I'm using selectManyShuttle component from Oracle ADF Core and some of the items in the showing list are long, therefore the width of selectManyShuttle expands the page. How to set the width property for selectManyShuttle component? After that does selectManyShuttle provide horizontal scrollbar as well?
    Thanks in advance,
    lapi
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]

    Solution here:
    Re: ADF Faces Scrollable Panel or Scroll Bar inside a component
    Regards
    Grant

  • How do I set column width for a table?

    I want to set the same width for all the columns in a particular table. Is there anyway of doing this without having to actually manually adjust each individual column?
    Thanks

    Select the column headers and drag across (A,B,C for example) then select between one of the columns (your pointer will change shape). Select and drag to the new width. All selected columns will change.
    Regards,

  • How to set custom widths for a particular report column?

    how could I set a custom width for a particular report column? Is there a way to do it using css?
    Thank you.

    Hi Leland,
    I have tested this here: [http://apex.oracle.com/pls/otn/f?p=267:18]
    All I have done is add the following into the report's Region Header:
    &lt;style type="text/css"&gt;
    #apexir_EMPNO {width:200px}
    #apexir_ENAME {width:200px}
    #apexir_DEPTNO {width:200px}
    .apexir_WORKSHEET_DATA TR TD {height:100px;}
    &lt;/style&gt;The headers have all be set to be left-aligned. Each column should be 200px wide (even though I'm setting the width on the headers, it will be applied to the entire column unless a cell's contents is wider, in which case the column is made wider). The final entry above adjusts the height of all TDs within the IR table.
    Andy

  • How Can i SEt Dynamic Variant For WEEK on SELECTION Screen.pls help me..

    <b>Hi ALL..
    Pls Help Me for this Problem..i am very confused how can i do that...plese tell me proper process..
    i  want set Dynamice Varient for WEEK on Selection screen..
    I have ALrady SET Dynamice Varient for DATE on Selection Screen.ther isd option is D...but in case of WEEK there is a no option...
    Plese help me..
    thaks in advance..
    pls help me..</b>

    Hello,
    Define your select-option in TVARV (assume Z_THISWEEK). And use a program like:
    DATA:
      zlv_week TYPE KWEEK.
    call function 'DATE_GET_WEEK'       
       exporting date = syst-datum
       importing week = zlv_week.
    SELECT SINGLE *
          FROM tvarvc
         WHERE name = 'Z_THISWEEK'
           AND type = 'S'
           AND numb = '0000'.
    tvarvc-low = zlv_week.
    IF syst-subrc <> 0.
        tvarvc-name     = 'Z_THISWEEK'.
        tvarvc-type     = 'S'.
        tvarvc-opti     = 'EQ'.
        tvarvc-sign     = 'I'.
        tvarvc-numb     = '0000'.
        insert tvarvc.
    ELSE.
      update tvarc.
    ENDIF.
    Regards,
    John.

  • Problem setting different width for images using HorizontalList tag

    Hi,<br />I succeeded using HorizontalList in my AdvancedDataGrid,<br /><br />  <mx:groupedColumns><br />...<br />...<br />  </mx:groupedColumns>  <br />  <mx:rendererProviders>            <br />        <mx:AdvancedDataGridRendererProvider   <br />            dataField="Actual" <br />            renderer="ChartRenderer" <br />            columnIndex="3" <br />            />         <br />    </mx:rendererProviders>  <br /><br />My Chartrenderer:<br /><br /><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" <br />     xmlns:local="*"><br />  <mx:Script><br />    <br />          import mx.collections.ArrayCollection;<br />          import mx.controls.Image;<br />          private var images:Array;                <br />          private var catalog:ArrayCollection;          <br />          private static var cat:Array = [<br />              "kpi_overtime_bar_10.png", "kpi_overtime_bar_20.png",<br />              "kpi_overtime_bar_30.png", "kpi_overtime_bar_40.png"<br />           ];<br />          <br />                    <br />           private function initCatalog(items:Array):void<br />           {<br />              catalog = new ArrayCollection(items);<br />              myList.dataProvider = catalog;<br />           }<br />                                     <br />      <br />    </mx:Script><br />     <mx:VBox height="20" width="40%" xmlns:mx="http://www.adobe.com/2006/mxml"<br />          horizontalScrollPolicy="off" <br />          verticalScrollPolicy="off"><br />          <mx:HorizontalList width="100%" id="myList"  <br />               horizontalScrollPolicy="off"<br />               verticalScrollPolicy="off"<br />               columnCount="4" <br />               creationComplete="initCatalog(cat)"><br />              <mx:itemRenderer><br />                    <mx:Component><br />                         <mx:Image width="50%" height="20"<br />                              maintainAspectRatio="false"/>                                <br />                    </mx:Component><br />               </mx:itemRenderer><br />          </mx:HorizontalList><br />     </mx:VBox><br /><br /></mx:Application><br /><br />This is a test I've done to see if I can palce a list of images in a cell,<br />and I can :)<br /><br />I have 2 problems:<br /><br />1. Here the size of each image is contant, I need a way to set each image in the list to be different,<br />Can I do it? <br />2. I need to load the images dynamically and not from a fixed Array,<br />Can I do it?<br /><br />It will be great to get help.....<br />Thanks<br />Jo

    On Sunday 15 Feb 2009, Yossi Bar wrote:
    > I think not all my descussion detailes were shown,
    I think you should be asking on FlexCoders...
    Tom Chiverton
    Helping to collaboratively enable 24/7 plug-and-play portals
    This email is sent for and on behalf of Halliwells LLP.
    Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the
    registered office together with a list of those non members who are referred to as partners. We use the word partner to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority.
    CONFIDENTIALITY
    This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500.
    For more information about Halliwells LLP visit
    www.halliwells.com.

  • Set default width for text box in Adobe Acrobat X

    Hello!
    I am using the textbox tool to add comments to a document. (not the Typewriter, but the Textbox, since that has more flexibility for formatting the text).
    I know how to set the default proprties for text size, color, background color, etc.
    Cannot figure out however to to set the default width. Every time I try to add a new textbox, it defaults to about 1 or 2 inches wide, so the text wraps around and around, and then I have to resize the box when I am done.
    Is there a way to change the default width?
    Thanks!

    Hi, Amonra
    I drew a box I like, and select, and then, Ctrl+C, and then Ctrl+V.
    And move the pasted box where to need, and resize the length. At least I get same width boxes.
    I don't know how to default it.
    I hope it may help you.

  • How to set max length for TextField ?

    how do i go about setting a max length for a TextField in jdk1.1.8 ?
    a while back there was a topic on this but it was for jdk1.0
    please help

    well if it works in 1.0 it will most likely also work in 1.1.8 if it is depricated you can use the -deprication option during compilation to see what is derpricated and what method i advised to use now.
    there may however be an easyer way in 1.1.8 but i don't know that.
    hope this helps you,
    Robert

  • Setting dynamic recipient for a publication is failing

    I have a publication which has the dynamic recipient set up as a crystal report template. I am trying to change this dynamic recipient template using the below code. However, it does not work-
    string newPublicationQuery = @"SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND = '"
        + InfoStore.CeKind.PUBLICATION + "' AND SI_NAME = '" + newPublicationTitle + "' AND SI_INSTANCE = 0";
    newPublicnInfoObjects = infoStore.Query(newPublicationQuery);
    if (newPublicnInfoObjects != null && newPublicnInfoObjects.Count > 0)
        newPublication = (Publication)newPublicnInfoObjects[1];
        // Get the collection of publication event handlers and add a handler to retrieve dynamic recipients.
        handlers = newPublication.PublicationEventHandlers;
        handler = handlers.GetPublicationEventHandler(2583);
        handlerInfo = handler.Add();
        // Configure the event handler to use a dynamic recipient data provider.
        handlerInfo.PluginClassName = "com.businessobjects.publisher.dynamicrecipients.crystalreports.CRDataProvider";
        // Set the new report template as the dynamic recipient template for the publication
        handlerInfo.DynamicDataDocumentID = newDynRecRepId;
        newPublication.Save();
        infoStore.Commit(newPublicnInfoObjects);
    The code works without any errors. However the dynamic recipient template is still the same old one.
    Can anyone please help? Thanks in advance.

    Thanks for the prompt response Dan.
    I checked the Publication Extension link and didn't see any extensions there. I assumed the event handler is present because the Add() was giving an error (like you say above). And yes, it was because it already had property "SI_ON_READ_RECIPIENTS" in the object.
    I have now done the following changes to the code to see if it helps-
    // Get the collection of publication event handlers and add a handler to retrieve dynamic recipients.
    handlers = newPublication.PublicationEventHandlers;
    handlers.RemovePublicationEventHandler(2583);
    handler = handlers.AddPublicationEventHandler(2583);
    handlerInfo = handler.Add();
    // Configure the event handler to use a dynamic recipient data provider.
    handlerInfo.PluginClassName = "com.businessobjects.publisher.dynamicrecipients.crystalreports.CRDataProvider";
    handlerInfo.DynamicDataDocumentID = newDynRecRepId;
    Above I remove the eventhandler and add it again. However, even this does not work. The publication still has the old dynamic recipient template. Not sure what I am missing here.

  • How to set Dynamic variant  for a program

    Hello experts,
    I want to set variants dynamically on a selection screen. Please help me.
    Thanks,
    Ashwani.

    Hi Ashwani,
    The variant can be set using:
    SUBMIT program name [USING SELECTION-SET <var>]
    USING SELECTION-SET <var>
         This option tells the system to start the called program with the variant <var>.
    For further details you can refer the link below:
    http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm
    Also refer,
    http://sapbrainsonline.com/sap-training/SAP-tutorial-pdf-material_425.html
    Regards,
    Soundarya.
    Edited by: K.Soundarya Singh on Mar 16, 2010 7:16 AM

  • Setting tab width for Text editor

    Simple ? I was unable to see this in the tool help. How do we set the tab width in the Text Editor for solaris.

    Hi,
    Please see the man page of xview.
    The parameter: text.tabWidth in the .Xdefaults file controls the tab width size.

  • How to set column width for Label in Form region?

    In the form region, the label value is a lengthy text, and it does not wrap. How do I make it wrap to a fixed column width?
    Under Home>Application Builder>Application>Page>Edit Page Item,
    i have set "HTML Table Cell Attributes" to width="300", but it still does not wrap. and pushes the field to the right end of the page.
    I am quite sure there are better ways of doing this.

    thanks Simakas for the reply.
    I had set the label template to "Optional" and that was forcing a "nowrap". After unsetting the template, I used your suggestion and it works like a charm. Thanks.

  • How to set dynamic value for field Month when running background job ?

    Dear guys,
    I have a Z* report in our company, in the selection screen there is a period field (Month and Year) and this report running in background job periodically. My Question is how i can set for Month field become dynamic follow month value of date when this report executed ?
    Example :
    When Z* report running in background on 16.04.2008, Month Value will be 04 and when running on 16.05.2008, Month Value will be 05.
    Please advice.
    Regards
    Gunawan

    Dear guys,
    I have a Z* report in our company, in the selection screen there is a period field (Month and Year) and this report running in background job periodically. My Question is how i can set for Month field become dynamic follow month value of date when this report executed ?
    Example :
    When Z* report running in background on 16.04.2008, Month Value will be 04 and when running on 16.05.2008, Month Value will be 05.
    Please advice.
    Regards
    Gunawan

  • Set maximum column for textfield

    in jsf, you can set the maximum column of a textfield size by code llike
    <h:inputText maxlength="15">
    once you type a string of given lengh=15, the cursor cannot move further ie. cannot type more charactes.
    Any similiar one in the swing text components?. have searched and cannot get it. .setColumns(int col); doesnt seems that way.

    Unfortunately not. You could try to use a JFormattedTextField or you inherit from PlainDocument and override insertString()
    BTW: if you post such questions to the [Swing forum|http://forum.java.sun.com/forum.jspa?forumID=57] you might get better/quicker answers

Maybe you are looking for

  • Programming Key Functions in Web Dynpro Java

    Hi, "Amigous" How can I Programming Key Functions in Web Dynpro Java, like F1, F2, F3...?? Thanks in advance. P:D. I don´t have Swine Flu.

  • Switch to Switch Connection

    Hi, for one project we are using HP 1910-24G-PoE (170W) Switch (JE008A) switch. There are total six nos. of switches at different floors, out of these six switches one switch is located in main server room. My first question is can we use SFP port av

  • Is the description tag of the app descriptor used in mobile apps?

    Just a simple question. I know the <description> tag of the app descriptor is used in the desktop AIR installer to tell what's the app about, but, is it ever used when compiling for iOS/Android/BB? The description is usually added manually to the App

  • Output format of a number/BISMT

    Hi experts, i want to have the follwing: I have the BISTM of a material, when I show this in a textview it is shown like '04560214521' But I want to display it as '04560 214 512' => BISMT(5) BISMT5(3) BISMT8(3) How to achieve this (without making a n

  • Is there a way to port director movies as apps without using x code?

    I have many years of experience with Director, but no experience with C++ or Xcode.  As I understand it, there is a long, steep learning curve on X without a good foundation in C++.  Is there a way around using it?  Does it require a lot of Xcoding,