Ask a Question related to Macromedia Flash, Design and Development.

  1. #1

    Default Dynamic textbox

    Flash MX question:
    Is it possible to insert a variable inside a dynamic textbox with scrollbar?

    Like this:
    Your name is [var: _root.name]??


    thx,
    Diederik

    Diederik Guest

  2. Similar Questions and Discussions

    1. Accessing Textbox Text After Postback in Dynamic Control
      I have an aspx page, which loads a custom usercontrol (UCtrlA). UCtrlA has a drop down list, and depending on what is selected in UCtrlA's drop...
    2. Adding a dynamic textbox control to a datagrid with Datatable datasource
      Hi, I have a datagrid, and I want to bind this to a datatable, and I would like to have textbox controls and one button control. The problem...
    3. html tags in dynamic textbox
      Hi everyone I read a lot of messages here regarding problems approaching mine... but no solution. I have a dynamic textbox, whose variable name...
    4. Dynamic font and colour changes to textbox
      Hi NG, I have a movieclip called: wordcontainer and this clip contains a textbox called : wordtextbox and I can set the movieclip to display a...
    5. VERY STRANGE BUG? Adding a textbox control causes other textbox control to fail???
      I've had this happen a few times too. I'm still not positive of what exactly causes it but all that's happening is the control that no longer...
  3. #2

    Default Re: Dynamic textbox

    Sure:

    myTextField.text = "Your name is " + _root.name;

    John

    --
    ----------------------------------------------------------------------------
    -----------
    RESOURCES
    [url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
    ----------------------------------------------------------------------------
    -----------
    TUTORIALS at
    [url]www.laiverd.com[/url]
    Flash & PHP Emailform
    Using textfiles in Flash
    ----------------------------------------------------------------------------
    -----------


    Laiverd.COM Guest

  4. #3

    Default Re: Dynamic textbox

    Laiverd.COM wrote:
    > Sure:
    >
    > myTextField.text = "Your name is " + _root.name;
    >
    > John
    >
    Thanks. This was almost what I was looking for.
    There is a lot of text in the textfield already. Since I had to add
    something extra at the end I had to fix it like this:

    myTextField.text = myTextField.text + "Your name is " + _root.name;

    Is there a way to add something in the middle?

    --
    Diederik

    Diederik Guest

  5. #4

    Default Re: Dynamic textbox

    You mean somewhere in the middle of already existing text?

    John

    --
    ----------------------------------------------------------------------------
    -----------
    RESOURCES
    [url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
    ----------------------------------------------------------------------------
    -----------
    TUTORIALS at
    [url]www.laiverd.com[/url]
    Flash & PHP Emailform
    Using textfiles in Flash
    ----------------------------------------------------------------------------
    -----------


    Laiverd.COM Guest

  6. #5

    Default Re: Dynamic textbox

    Laiverd.COM wrote:
    > You mean somewhere in the middle of already existing text?
    >
    > John
    >
    That's right.
    I tried this to put it at the end:

    myTextField.text = myTextField + "Your name is " + _root.name;

    But now I'm not able to use bold, italic or colored text.

    --
    Diederik

    Diederik Guest

  7. #6

    Default Re: Dynamic textbox

    Possible, but not easy. Use any of the String methods to find the substring
    after which (or before which) you want to insert text. The problem obviously
    is, when you have that substring multiple times in your text. As for the
    bold and Italic part: if yo HTML-enable your text, and use
    textfield.htmlText = "<b>bold</b>" then bold will be displayed bold; <i> for
    italics.

    John

    --
    ----------------------------------------------------------------------------
    -----------
    RESOURCES
    [url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
    ----------------------------------------------------------------------------
    -----------
    TUTORIALS at
    [url]www.laiverd.com[/url]
    Flash & PHP Emailform
    Using textfiles in Flash
    ----------------------------------------------------------------------------
    -----------


    Laiverd.COM Guest

  8. #7

    Default Re: Dynamic textbox

    In addition; if you let the user decide where to insert text, you might be
    interested in the Selection class.

    John

    --
    ----------------------------------------------------------------------------
    -----------
    RESOURCES
    [url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
    ----------------------------------------------------------------------------
    -----------
    TUTORIALS at
    [url]www.laiverd.com[/url]
    Flash & PHP Emailform
    Using textfiles in Flash
    ----------------------------------------------------------------------------
    -----------


    Laiverd.COM Guest

  9. #8

    Default Dynamic TextBox

    I am creating a number of textboxes dynamically(depending upon the user
    input) and am unable to retrieve that data to store in the DB. When I click
    the submit button, the code is unable to find the dynamic textbox by that
    name. I am creating the textboxes using a method that gets called after the
    user input. Please advise.

    I am creating the textboxes using the code below:
    private void changeWeight()
    {
    for( int i=1;i<=int.Parse(txtNum.Text); i++)
    {
    TextBox txtWt = new TextBox();
    txtWt.ID = "txtPWeight"+i.ToString();
    Response.Write(txtWt.ID+"<br>");

    phWeight.Controls.Add(txtWt);
    phWeight.Controls.Add(new LiteralControl("</td></tr><tr><td>"));
    }
    }

    To retrieve data:
    private string EnterPositivePlateInfo(int CellNo, int PlateNo)
    {
    string boxName = "txtPWeight" + PlateNo.ToString();
    TextBox tb= phWeight.FindControl(boxName) as TextBox;

    if( tb !=null);
    else
    Response.Write("Does not work "+boxName+"<br>");
    return somestring; //returns sql insert statement
    }

    learningNET Guest

  10. #9

    Default RE: Dynamic TextBox

    I found the solution on one of the other threads (Answer by: William F.
    Robertson, Jr.). The trick was to use:
    string s = Request.Form["txtPWeight" + PlateNo.ToString()];
    It saved the textbox value in variable s.

    "learningNET" wrote:
    > I am creating a number of textboxes dynamically(depending upon the user
    > input) and am unable to retrieve that data to store in the DB. When I click
    > the submit button, the code is unable to find the dynamic textbox by that
    > name. I am creating the textboxes using a method that gets called after the
    > user input. Please advise.
    >
    > I am creating the textboxes using the code below:
    > private void changeWeight()
    > {
    > for( int i=1;i<=int.Parse(txtNum.Text); i++)
    > {
    > TextBox txtWt = new TextBox();
    > txtWt.ID = "txtPWeight"+i.ToString();
    > Response.Write(txtWt.ID+"<br>");
    >
    > phWeight.Controls.Add(txtWt);
    > phWeight.Controls.Add(new LiteralControl("</td></tr><tr><td>"));
    > }
    > }
    >
    > To retrieve data:
    > private string EnterPositivePlateInfo(int CellNo, int PlateNo)
    > {
    > string boxName = "txtPWeight" + PlateNo.ToString();
    > TextBox tb= phWeight.FindControl(boxName) as TextBox;
    >
    > if( tb !=null);
    > else
    > Response.Write("Does not work "+boxName+"<br>");
    > return somestring; //returns sql insert statement
    > }
    >
    learningNET Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139