Displaying text based on variable

I have a variable defined as brushSize.  Depending on the value of brushSize, I want to display text in a dynamic text field that relates to its value.
For brushSize values of 3, 13, 23, 33, and 43 I'd like to  display 1, 2, 3, 4, and 5 respectively.  I'm not really sure where to begin here, but I have tried and failed with something like this:
if( brushSize == 3) {
    brushSizeDisplay("1")
Any suggestions?

When I open up a new flash document and start from scratch, it works fine.  But when I try to apply it to my existing project it isn't translating.  Here is the code for the variable that I wish to determine what specific text to display:
var brushSize:Number = 23;
var brushSizeMax:Number = 43;
var brushSizeMin:Number = 3;
function changeValue(pHow:Number){
    brushSize += pHow;
    if(brushSize > brushSizeMax){
        brushSize = brushSizeMax;
    if(brushSize < brushSizeMin){
        brushSize = brushSizeMin;
    brushSizeText.text = brushSize;
brushUp.onPress = function(){
    changeValue(10);
brushDown.onPress = function(){
    changeValue(-10);
when I try
if( brushSize == 3) {
     brushSizeDisp.text=1;
I get no results.  brushSize is my variable, and brushSizeDisp is the instance name of a dynamic text field that I placed on the stage.

Similar Messages

  • Report "Display Text (Based on LOV)" columns don't like colons - Bug?

    This is a bit hard to explain in text, so I've built a sample app: http://apex.oracle.com/pls/otn/f?p=9608:1
    The app has two pages, which demonstrate two related bugs in the handling of Report "Display as Text (based on LOV)" columns.
    Basically, if the LOV query returns a string that contains colon characters (":") in the display column, the values are matched up correctly, but the colons are stripped from the display.
    If the LOV query returns a string that contains colon characters in the return value column, then the matching fails entirely.
    Removing the colon characters eliminates the problem.
    We actually ran into this in a production environment, after an upgrade from Apex 3.0.0 to 3.2.1. The behavior definitely did not occur in Apex 3.0, but was added at some point between the two versions.

    The colon is actually part of our data (the field in question is a URN namespace).
    And yes, I understand the function of the colon in Apex URL parameter passing. However, I wouldn't expect that sort of parsing to be used against the results returned from an LOV query.
    Also, the LOV is fine in of itself -- a select list based on the LOV displays & returns the expected values. It's only when I use a report column based on an LOV that this behavior creeps in.
    We've found a (fairly painful) workaround -- altering both the report query and the LOV query to to do something like replace(column, ':', '_') -- but that's a manual change to a large number of pages for us.
    This behavior is new to version 3.2.1. It didn't happen in version 3.0.

  • Displaying Text On A Variable

    In the Value Selection Window, I have a variable that will only show the key, even though I have set it to Key and Text. I can input a key value (which is a number) directly into the selection box, but when I try to get a list of values it will only show the keys, I cannot get it to also display the account names (text) so that users will know which account they are selecting. Is there some setting I am missing to prevent this from displaying?

    Hi
    goto infoobject on which this veriable exist
    goto infoobject properties - where you can find the option for display type
    Select key & text
    Below this option you will find text Type -Select long text.
    Hope it will help you
    Hari

  • Problem in Displaying text Variable

    Hi All,
    I have problem in Displaying text Variable in the column header.
    My requirement is as follows.
    Column Level:
    0Calmonth/Year
    Key figures
    Keyfigure1 - Current Month  - Text Variable1
    Keyfigure2 - Previous Month - Text Variable2
    Keyfigure3 - Previous Month - Same as Text Variable2 - Display same month
    So based on each 0Calmonth/year these three keygirues should display in Header section like.
    Selection screen
    0Calmonth/Year - 03.2005 - 06.2005
    Result should be for each month.
    0Calmonth/Year
    03.2005                                04.2005                              05.2005
    03.2005 | 02.2005 | 02.20005  04.2005 | 03.2005 | 03.2005 05.2005 | 04.2005 | 04.2005.
    I have created two text variable with Customer exit.But not able to show exact months in the header section.
    For first three columns months are coming exactly, but from fourth columns it should display next month, but it is not coming.
    I have tried to code, but not successfull.
    Please help me how to go about this.
    Will assign full points.
    Regards,
    Vijay

    hi
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    it might helpful for you
    assign points if helpful

  • Display as text based on pl/sql - how to return value

    Hi,
    I have a item set as "display as text based on pl/sql". How do I get the PL/SQL anonymous block to return the value of the item?
    My function declares and populates a variable called t_output which is the value I want displayed in the item. The PL/SQL I have written is correct as I have tried it in SQLPlus* with DBMS_OUTPUT.PUT_LINE and I get the correct output, but I don't know how to set my item to the value of t_output. I have tried adding ":P73_ITEM := t_output;" into the end of the PL/SQL block.
    Thanks
    Lucy

    Hi Lucy,
    Try this and see.
    make the display as:display as text(saves state)
    source type: sql query
    in source value or expression type
    select func(arguments) from table name;
    Good luck

  • How to dynamically replace variables in SMARTFORM texts based on item data?

    Hi experts,
    I'm currently designing a confirmation of order using Adobe PDF forms. The general layout with tables, pictures and texts was not big deal.
    But one tiny bit doesn't work and I'm becoming more and more desperate about it.
    We need various free texts for our pdf form. I created the texts using smartform texts. Some of these texts need to be slightly dynamic, so I added some dynamic fields in it.
    For example:
         "The material is currently out of stock.You can expect shipping around week &num_week&."
    To replace the dynamic field &num_week& in my interface, I read that I have to name the dynamic field exactly like the corresponding field in my interface. In my case this would be now:
         "The material is currently out of stock.You can expect shipping around week &SLS_PRT_COM-ITEM_DETAIL-ZZ_EXTRAFIELDS-ZZWEEKNUM&."
    To see the text on my form, I added a text object with type 'text module' and the proper textname. Of course I'm able to insert text on my form, save and activate it without problems. But if I want to print the form, nothing happens as the print program exits with an error code.
    After some hours I found out that this problem only occurs if I'm trying to replace the dynamic field with a field from the item table. Using a field from head details or globals like sy-mandt works like a charm.
    So my question is: Is it possible to use item data to replace dynamic fields of a smartform text?
    Greetings and thanks in advance!
    André

    Hi
    Have a look at the links below:
    LiveCycle ES2 * Adobe LiveCycle Designer ES2
    Using floating field in Adobe Forms to display text paragraph with dynamic variables in between
    After adding the floating field it will apeare in the hierarchy pallet above or bellow the text field.
    Good luck
    Shai.

  • Display as text (based on LOV) not working

    hi --
    I've not used this kind of item before, so there's probably some really simple thing I'm missing....
    Have the LOV:
    select objecttype_name display_value, objecttype_id return_value
    from hdb_objecttype_syn order by 1
    Return value is going into page item :P3_objecttype_id (a popup LOV). Have another item, :P3_objecttype_name, which is a display as text (based on LOV) item. When/how is this item supposed to get populated? When I select a value from the LOV, I'd expect the text item to be set to the display value of the LOV, but it is always []. The source type of :P3_objecttype_name is Sql Query, and the query is:
    select objecttype_name from hdb_objecttype
    where objecttype_id = :P3_objecttype_id
    Does the page have to be submitted before the display item is populated? Seems like that wouldn't be very helpful...
    Thanks,
    C

    HI Varad -- I'm afraid I'm new enough to all this to not know how to implement either of your solutions... and that's after scanning the forum for additional info.
    How do I get the page to submit? Is there any way to do this w/o forcing the user to explicitly press a button? (which would be way too much, as there are probably 10 LOVs on this page).
    If I choose to use javascript, 1) on what item and under what attribute do I put the script (is it on the objecttype_name that needs to be populated?), and 2) where can I find an example of what this might look like? I'm not familiar w/ it at all.
    My goal is ultimately to have an LOV that displays both the key value and the name (which I guess can be accomplished by concatenating those together in the LOV select statement), to return the name to the page, and then have the ID automatically filled in to match the key (the example I sent you is backwards, simply because I started building this page w/ only key values displayed, added the name as a test later.) And, I also want the user to be able to type in the ID (no LOV would be attached to it), and have the name automatically populated. I'm guess this could be accomplished in a way similar to having the name filled in after the value is chosen from the LOV... If I can just figure out how to do that!
    Thanks,
    Carol

  • BPS Variable-Cost Element is not displaying Text

    Dear Team,
    We have a peculiar issue one of the BPS Variable defined for Cost Element is not displaying text in one of the Planning Layouts.
    Another variable is displaying text in another layout.
    Surprisingly...when I reused the old variable in the new layout it is also not displaying the text.
    Am I missing something....appreciated your quick support.
    Thanks & Best Regards
    Srinivas

    Have you check the layout Lead-Column setting? Is it set to 'Key/Description'?

  • Cascade LOV display as text (based on LOV) in clasic report

    Hi Experts,
    It is possible to use cascade LOV - item is displayed as text (based on LOV) in clasic report ? (Display AS)
    I would like to reference to another column displayed in the report in LOV.
    Example:
    select description d,
           val_strg2 r
      from domain_cntr
    where cntr_name = 'CH_PRIM_ST_NOTE'
       and val_strg1   = #PRIM_STATUS#
       and active_idc  = 'Y'#PRIM_STATUS# is the column i would like to reference.
    Is it possible ? IN CLASIC REPORT
    regards
    J :D

    Hi,
    >
    Is it possible ? IN CLASIC REPORT
    >
    Yes.
    It may a rather long thing to code, so be ready for it.
    Here is how:
    a. Use APEX_ITEM API in your Report Query. Make sure you specify the p_item_id parameter , using #ROWNUM#
    b. In the Parent LoV wrtie an onChange event trigger that fires a JavaScript function and pass the ID of the element .
    c. In this JavaScript function make an AJAX call to get the &lt;select&gt;...&lt;option...&gt;...&lt;/select&gt; , in short the complete HTML of the child LoV
    d. Push this HTML fragment into the Child Lov. You construct the ID of the target based on the ID of parent . E.g. f01_0001 to f02_0001.
    e. You may additional keep the child invisible or disabled initially, and then make it visible/enable it after it is populated.
    Regards,

  • Where is "Display as Text (based on LOV, saves state)"

    I am developing an application using the version of HTMLDB that comes with OracleXE.
    I have a tabular form, in which the default column for a particular item is sourced from a previously entered item on another page. This is a lookup item and needs to be non-changeable by the user. So I want to use the "Display As" option "Display as Text (based on LOV, saves state)". However, this option is not available in the pull-down for "Display As". The option "Display as Text (based on LOV, does not save state)" is available, but using this option means that the item is not saved to the database.
    Does anyone know why the stateful display as option is not available.
    Thanks in advance,
    Rob

    Scott, thanks for the feedback. The problem is that although the value is displayed correctly, it is NOT saved to the database. Effectively, header information is entered in a previous screen, and one of the entered fields is written to each of the detail lines associated with the header. We are re-platforming an existing application (written in an obscure form of basic), and at this stage changing the schema is not an option. So this header item (which is a foreign key to a "store" table), is meant to be written down to each line, on the screen displayed as the store name, and written to the inserted lines as the lookup id. If I use the dispaly as text save state option teh database is updated correctly, but displays the id rather than name on the screen. The only display as lov option i can see is the one that does not save state. If I use this option the screen displays as I want but the database is not updated. I need to use the display as lov saves state option. but i do not see it.
    Any ideas?
    Thanks for your time.
    Rob

  • Annoying [ ] with "Display as Text (based on LOV, saves state)"

    Hi all,
    I've got a form where some items are shown as “Display as Text”. These values are displayed normally.
    But I also have some items which are shown as “Display as Text (based on LOV, saves state)”. When I run the page and these items don't return a value (because it isn't filled in in another page), we get the annoying []-sings.
    Is there anyone who knows how to fix this, I just want to display nothing when there is no value.

    I've tried this one already.
    I tried to leave it blank, & nbsp ; , text,... but the problem is that our lov is build by a function and it always returns a query, so the LOV is never null.
    I figured something out: made a process after header that has some cursors to get the values from the database and changed the item to a simple display as text-field. There were only 4 that were wrong, so it wasn't to much work.

  • Cannot see Display as Text (based on lov, saves state)

    I have raised this question on the HTMLDB forum (Where is "Display as Text (based on LOV, saves state)" but in case its XE specific I am posting here too.
    I have a tabular form in the XE version of HTMLDB, and wish to use the "Display as Text (based on LOV, saves state)" option. However, this option does is not available to me - are there some conditions necessary for this option to be displayed?
    Thanks, Rob

    Rob,
    I doubt it's an XE specific issue. I've asked for more information in the original thread.
    Sergio

  • Display As Text (based on LOV, saves state)  "p_t03" was assigned by APEX

    Hi All,
    I have an ITEM
    Name: P36_INT
    Display As: Display As Text (based on LOV, saves state)
    Output in my HTML:
    [input type="hidden" name="p_t03" value="YES" />[span id="P36_INT">Interior[/span>
      'p_t03' was assigned by APEX
      In my Javascript I have to access it as the following to get the "YES" value:
      var lintObj = html_GetElement('p_t03');
      Originally it was 'p_t01' but it changed from 'p_t01' to 'p_t03' somehow.. out of my control.
      How do I assign an ID or assign my own name to the "hidden" item?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Scott, thanks for the feedback. The problem is that although the value is displayed correctly, it is NOT saved to the database. Effectively, header information is entered in a previous screen, and one of the entered fields is written to each of the detail lines associated with the header. We are re-platforming an existing application (written in an obscure form of basic), and at this stage changing the schema is not an option. So this header item (which is a foreign key to a "store" table), is meant to be written down to each line, on the screen displayed as the store name, and written to the inserted lines as the lookup id. If I use the dispaly as text save state option teh database is updated correctly, but displays the id rather than name on the screen. The only display as lov option i can see is the one that does not save state. If I use this option the screen displays as I want but the database is not updated. I need to use the display as lov saves state option. but i do not see it.
    Any ideas?
    Thanks for your time.
    Rob

  • Display as text (based on LOV saves state) : possible border ?

    Hi,
    Like mentioned in the subject, I have many Display as text (based on LOV saves state). I would like to have a frame or a border around this field eventhough it's read only, like a regular field. How can I do that ?
    thank you.

    Depending on your visual requirements, you could change the items to Text Fields (disabled or not) then simply make the Read-Only atttribute set to "always" or something that would equate to "always". It would look just like a text field (since it would in fact be one), but would be read-only.
    Sadly, this would require you to change all your items to the new type which would take time.

  • Display as Text based on LOV - formating

    I have a slight problem with
    Display as Text based on LOV report column formating.
    Whatever I try to enter, regardless where CSS Clas, CSS Style - formating simply
    doesn't work. The only formating that works is:
    Number / Date Format.
    Is there a solution for this?
    Thanks,
    Denes Kubicek

    I found a simple workarround and I will post it:
    1. Instead of using LOV I created a function that does the same
    ( using a cursor and returning a value )
    2. Since the field needed to act as a link, I used css to format the output
    and it worked just fine.
    Thanks,
    Denes Kubicek

Maybe you are looking for

  • Jar file is not working

    Hi, I have an Applet packed in a JAR file. It works very well in my local site, but when I upload it to internet it throws a java.lang.ClassNotFoundException: nibbly Of course I've checked names, cases, files are in the same directory. The html code

  • 160 Gb Classic - Audio dropouts, gaps on gapless albums with apple lossless

    Dear All, Since getting my new iPod Classic 160 Gb iPod Classic, I am experiencing audio dropouts that last between one and two seconds. They aren't frequent, occurring maybe one every hour or two of audio playback. They appear to be very random. If

  • Adapter Status Grey and Cache Error in acessing Integration Directory

    Dear All While going through the following path RWB-->Component Monitoring->Adapter Engine->Cache Connectivity Test i got the following result " Cache notification from Integration Repository failedError when accessing the Integration Directory " RWB

  • JPEG icon format

    I have a number of jpeg icons which appear in a generic format in Icon view in the finder, i.e.the icon simply says 'jpeg' and does not give a thumbnail of the image. if I save an image in tiff format (from Photoshop or Preview) the icon shows a thum

  • Microsoft Office  mac Error Report after start the mac

    Hi, How do I completely turn off microsoft error reporting on my mac? Thanks