Ask a Question related to Macromedia Flash, Design and Development.
-
Diederik #1
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
-
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... -
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... -
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... -
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... -
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... -
Laiverd.COM #2
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
-
Diederik #3
Re: Dynamic textbox
Laiverd.COM wrote:
Thanks. This was almost what I was looking for.> Sure:
>
> myTextField.text = "Your name is " + _root.name;
>
> John
>
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
-
Laiverd.COM #4
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
-
Diederik #5
Re: Dynamic textbox
Laiverd.COM wrote:
That's right.> You mean somewhere in the middle of already existing text?
>
> John
>
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
-
Laiverd.COM #6
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
-
Laiverd.COM #7
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
-
learningNET #8
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
-
learningNET #9
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



Reply With Quote

