LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


  #1  
Old 12-13-2004, 11:05 PM
denizci2000 denizci2000 is offline
Registered User
 
Join Date: Dec 2004
Location: los angeles
Posts: 3
Rep Power: 0
denizci2000 is on a distinguished road
Creting input textfield

hi guys,
I have little problem here. I have button and it should create textfield which is resizeable, dragable, and dynamic. When the user clicks the button(it will create textfield automatically) he can place the text around the page and also change its size or change the content. I need to know is it possible?
Reply With Quote
  #2  
Old 12-14-2004, 04:28 PM
prisma prisma is offline

Super Moderator
 
Join Date: May 2001
Location: Munich, Germany
Posts: 1,668
Rep Power: 14
prisma is on a distinguished road
Hi and welcome to FlashMove, denizci2000.
Since Flash MX you can alter a textfields position, sizing etc. with actionscript, so yes, it's possible.
__________________
... take me to your coder.
Reply With Quote
  #3  
Old 12-14-2004, 06:54 PM
denizci2000 denizci2000 is offline
Registered User
 
Join Date: Dec 2004
Location: los angeles
Posts: 3
Rep Power: 0
denizci2000 is on a distinguished road
no! I mean you can alter position and resizing but Can you drag and drop the text and resize without giving values. I mean I have a button and after you click the button user should create text field with cursor and write what ever he wnar then can click the text field and drag and drop where he wants. like we do in designing time. The problem is the text field is not dragable because it is not a movie clip or button. But It should be a trick or something. come on guys!
Reply With Quote
  #4  
Old 12-15-2004, 03:03 PM
prisma prisma is offline

Super Moderator
 
Join Date: May 2001
Location: Munich, Germany
Posts: 1,668
Rep Power: 14
prisma is on a distinguished road
Yes it is possible. You can simply place the textfiel inside a movieclip for example.
__________________
... take me to your coder.
Reply With Quote
  #5  
Old 12-15-2004, 06:31 PM
denizci2000 denizci2000 is offline
Registered User
 
Join Date: Dec 2004
Location: los angeles
Posts: 3
Rep Power: 0
denizci2000 is on a distinguished road
but in this case you can't change the size of the textfield do you?
Reply With Quote
  #6  
Old 12-15-2004, 08:58 PM
TheDutch's Avatar
TheDutch TheDutch is offline
Devil Moderator
 
Join Date: Dec 2001
Location: Dutchland
Posts: 708
Rep Power: 12
TheDutch is on a distinguished road
Quote:
TextField.textWidth

Availability
Flash Player 6.

Usage
my_txt.textWidth:Number

Description
Property; indicates the width of the text.

Example
See the example for TextField.textHeight.
Quote:
TextField.textHeight

Availability
Flash Player 6.

Usage
my_txt.textHeight:Number

Description
Property; indicates the height of the text.

Example
The following example creates a text field, and assigns a string of text to the field. A trace
statement is used to display the text height and width in the Output panel. The autoSize
property is then used to resize the text field, and the new height and width will also be displayed
in the Output panel.

this.createTextField("my_txt", 99, 10, 10, 100, 300);
my_txt.text = "Sample text";
trace("textHeight: "+my_txt.textHeight+", textWidth: "+my_txt.textWidth);
trace("_height: "+my_txt._height+", _width: "+my_txt._width+"\n");
my_txt.autoSize = true;
trace("after my_txt.autoSize = true;");
trace("_height: "+my_txt._height+", _width: "+my_txt._width);
Which outputs the following information:
textHeight: 15, textWidth: 56
_height: 300, _width: 100
after my_txt.autoSize = true;
_height: 19, _width: 60
Quote:
TextField.autoSize

Availability
Flash Player 6.

Usage
my_txt.autoSize:String
my_txt.autoSize:Boolean

Description
Property; controls automatic sizing and alignment of text fields. Acceptable values for autoSize are
"none" (the default), "left", "right", and "center". When you set the autoSize property,
true is a synonym for "left" and false is a synonym for "none".
The values of autoSize and TextField.wordWrap determine whether a text field expands or
contracts to the left side, right side, or bottom side. The default value for each of these properties
is false.
If autoSize is set to "none" (the default) or false, then no resizing will occur.
If autoSize is set to "left" or true, then the text is treated as left-justified text, meaning the left
side of the text field will remain fixed and any resizing of a single line text field will be on the right
side. If the text includes a line break (for example, "\n" or "\r"), then the bottom side will also
be resized to fit the next line of text. If wordWrap is also set to true, then only the bottom side of
the text field will be resized and the right side will remain fixed.
If autoSize is set to "right", then the text is treated as right-justified text, meaning the right
side of the text field will remain fixed and any resizing of a single line text field will be on the left
side. If the text includes a line break (for example, "\n" or "\r"), then the bottom side will also
be resized to fit the next line of text. If wordWrap is also set to true, then only the bottom side of
the text field will be resized and the left side will remain fixed.
If autoSize is set to "center", then the text is treated as center-justified text, meaning any
resizing of a single line text field will be equally distributed to both the right and left sides. If the
text includes a line break (for example, "\n" or "\r"), then the bottom side will also be resized
to fit the next line of text. If wordWrap is also set to true, then only the bottom side of the text
field will be resized and the left and right sides will remain fixed.
Example
You can use the following code and enter different values for autoSize to see how the field resizes
when these values change. A mouse click while the SWF file is playing will replace each text field’s
"short text" string with longer text using several different settings for autoSize.

this.createTextField("left_txt", 997, 10, 10, 70, 30);
this.createTextField("center_txt", 998, 10, 50, 70, 30);
this.createTextField("right_txt", 999, 10, 100, 70, 30);
this.createTextField("true_txt", 1000, 10, 150, 70, 30);
this.createTextField("false_txt", 1001, 10, 200, 70, 30);

left_txt.text = "short text";
left_txt.border = true;

center_txt.text = "short text";
center_txt.border = true;

right_txt.text = "short text";
right_txt.border = true;

true_txt.text = "short text";
true_txt.border = true;

false_txt.text = "short text";
false_txt.border = true;

// create a mouse listener object to detect mouse clicks
var myMouseListener:Object = new Object();
// define a function that executes when a user clicks the mouse
myMouseListener.onMouseDown = function() {
left_txt.autoSize = "left";
left_txt.text = "This is much longer text";
center_txt.autoSize = "center";
center_txt.text = "This is much longer text";
right_txt.autoSize = "right";
right_txt.text = "This is much longer text";
true_txt.autoSize = true;
true_txt.text = "This is much longer text";
false_txt.autoSize = false;
false_txt.text = "This is much longer text";
};
// register the listener object with the Mouse object
Mouse.addListener(myMouseListener);
If you found this helpful, download the reference guide for Flash Actionscript from the Macromedia site
__________________

Please don't email or PM me your questions!
Ask your questions on the forums, that will not only help you but also other people with the same kind of questions.
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
execute data from an input textfield madeonearth ActionScript 3.0 1 01-10-2009 06:06 PM
Input textfield background colour FredPike General Flash 1 08-09-2008 11:41 PM
focus stuck in INPUT Textfield after hitting enter multiple times paulcybulski Actionscript 2.0 2 05-07-2008 02:17 PM
[textfield] How to check if input text is more than textfield height? [PAUL FERRIE] Flash MX ActionScript 3 06-30-2005 04:55 AM
How can I get an input textfield get the focus after making it visible in Flash 5? cftranslate General Flash 1 03-06-2003 10:36 AM




All times are GMT. The time now is 10:05 PM.