Re: [Flashcoders] changing the width of a dynamic text field

2006-06-08 Thread jcarlos
I think is something related to the name of your textField, if it was created 
in the designing or programming mode 

I got this sample from the ActionScript manual, tested it and it works fine

  this.createTextField (my_txt, this.getNextHighestDepth (), 10, 40, 160, 
120);
  my_txt.background = true;
  my_txt.backgroundColor = 0xFF;
  my_txt.border = true;
  my_txt.multiline = true;
  my_txt.type = input;
  my_txt.wordWrap = true;

  this.createTextField (width_txt, this.getNextHighestDepth (), 10, 10, 30, 
20);
  width_txt.border = true;
  width_txt.maxChars = 3;
  width_txt.restrict = 0-9;
  width_txt.type = input;
  width_txt.text = my_txt._width;
  width_txt.onChanged = function ()
  {
   my_txt._width = this.text;
  };

  this.createTextField (height_txt, this.getNextHighestDepth (), 70, 10, 30, 
20);
  height_txt.border = true;
  height_txt.maxChars = 3;
  height_txt.restrict = 0-9;
  height_txt.type = input;
  height_txt.text = my_txt._height;
  height_txt.onChanged = function ()
  {
   my_txt._height = this.text;
  };

João Carlos Santiago

- Original Message - 
From: Phil Glatz [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: Wednesday, June 07, 2006 6:55 PM
Subject: [Flashcoders] changing the width of a dynamic text field


I have a single dynamic text field (pText) I'd like to dynamically 
 change the width of.  It is multiline with a border, and other options are 
 off.
 
 When I execute the following actionscript:
 
 trace('w1:'+pText._width);
 pText._width=200;
 trace('w2:'+pText._width);
 
 
 the trace output is:
 
 w1:400
 w2:375.7
 
 
 Why isn't the width of the textfield at w2 set to 200?  Seems like it 
 should.  (I'm prepared for a d'oh and slap to the forehead).
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] changing the width of a dynamic text field

2006-06-08 Thread Phil Glatz

At 04:14 AM 6/8/2006, João wrote:
I think is something related to the name of your 
textField, if it was created in the designing or programming mode

I got this sample from the ActionScript manual, tested it and it works fine
  this.createTextField (my_txt, 
this.getNextHighestDepth (), 10, 40, 160, 120);

  ...


Yes; I created it in design mode, rather than 
from actionscript.  Your suggestion works 
perfectly, so I will use actionscript to create the field.


Why wouldn't it work either way?  I have a 
feeling these is something I must do in actionscript before changing the width.


thanks for your suggetsion, Phil


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] changing the width of a dynamic text field

2006-06-08 Thread Lanny McNie

You don't necessarily need to create it with Actionscript, just remove the
transform on it in the IDE.  Text fields that are scaled in the IDE
(stretched) will measure their width adjusted with their scale.

So if you have a 100px wide text field (not stretched), and stretch it to
200px in the IDE (with the transform tool or numerically), the _width of the
field is 100px*2.  If you then set the _width with AS to 200px, the result
will be 400px (200px*2).

It seems to me that this is an odd way for flash to handle text field
scaling, but if you understand whats happening, its easy to circumvent.  As
a developer who frequently receives scaled assets from designers,
CTRL-SHIFT-Z (remove transform) is my best friend :)


On 6/8/06, Phil Glatz [EMAIL PROTECTED] wrote:


At 04:14 AM 6/8/2006, João wrote:
I think is something related to the name of your
textField, if it was created in the designing or programming mode
I got this sample from the ActionScript manual, tested it and it works
fine
   this.createTextField (my_txt,
 this.getNextHighestDepth (), 10, 40, 160, 120);
   ...

Yes; I created it in design mode, rather than
from actionscript.  Your suggestion works
perfectly, so I will use actionscript to create the field.

Why wouldn't it work either way?  I have a
feeling these is something I must do in actionscript before changing the
width.

thanks for your suggetsion, Phil


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
-
Lanny McNie
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] changing the width of a dynamic text field

2006-06-08 Thread Lanny McNie

Additionally, you can replicate this by setting the _xscale in
Actionscript.  So setting to 100% before applying the _width would resolve
it as well.

On 6/8/06, Lanny McNie [EMAIL PROTECTED] wrote:


You don't necessarily need to create it with Actionscript, just remove the
transform on it in the IDE.  Text fields that are scaled in the IDE
(stretched) will measure their width adjusted with their scale.

So if you have a 100px wide text field (not stretched), and stretch it to
200px in the IDE (with the transform tool or numerically), the _width of the
field is 100px*2.  If you then set the _width with AS to 200px, the result
will be 400px (200px*2).

It seems to me that this is an odd way for flash to handle text field
scaling, but if you understand whats happening, its easy to circumvent.  As
a developer who frequently receives scaled assets from designers,
CTRL-SHIFT-Z (remove transform) is my best friend :)



On 6/8/06, Phil Glatz [EMAIL PROTECTED] wrote:

 At 04:14 AM 6/8/2006, João wrote:
 I think is something related to the name of your
 textField, if it was created in the designing or programming mode
 I got this sample from the ActionScript manual, tested it and it works
 fine
this.createTextField (my_txt,
  this.getNextHighestDepth (), 10, 40, 160, 120);
...

 Yes; I created it in design mode, rather than
 from actionscript.  Your suggestion works
 perfectly, so I will use actionscript to create the field.

 Why wouldn't it work either way?  I have a
 feeling these is something I must do in actionscript before changing the
 width.

 thanks for your suggetsion, Phil


 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




--
-
Lanny McNie





--
-
Lanny McNie
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] changing the width of a dynamic text field

2006-06-08 Thread janosch

Oh, thanks a log for [strg] + [shift] + [z], this helps a lot!!!

Janosch

Lanny McNie schrieb:

You don't necessarily need to create it with Actionscript, just remove 
the

transform on it in the IDE.  Text fields that are scaled in the IDE
(stretched) will measure their width adjusted with their scale.

So if you have a 100px wide text field (not stretched), and stretch it to
200px in the IDE (with the transform tool or numerically), the _width 
of the
field is 100px*2.  If you then set the _width with AS to 200px, the 
result

will be 400px (200px*2).

It seems to me that this is an odd way for flash to handle text field
scaling, but if you understand whats happening, its easy to 
circumvent.  As

a developer who frequently receives scaled assets from designers,
CTRL-SHIFT-Z (remove transform) is my best friend :)


On 6/8/06, Phil Glatz [EMAIL PROTECTED] wrote:



At 04:14 AM 6/8/2006, João wrote:
I think is something related to the name of your
textField, if it was created in the designing or programming mode
I got this sample from the ActionScript manual, tested it and it works
fine
   this.createTextField (my_txt,
 this.getNextHighestDepth (), 10, 40, 160, 120);
   ...

Yes; I created it in design mode, rather than
from actionscript.  Your suggestion works
perfectly, so I will use actionscript to create the field.

Why wouldn't it work either way?  I have a
feeling these is something I must do in actionscript before changing the
width.

thanks for your suggetsion, Phil


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com







___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] changing the width of a dynamic text field

2006-06-08 Thread Phil Glatz

At 08:38 AM 6/8/2006, Lanny wrote:

You don't necessarily need to create it with Actionscript, just remove the
transform on it in the IDE.  Text fields that are scaled in the IDE
(stretched) will measure their width adjusted with their scale.

It seems to me that this is an odd way for flash to handle text field
scaling, but if you understand whats happening, its easy to circumvent.  As
a developer who frequently receives scaled assets from designers,
CTRL-SHIFT-Z (remove transform) is my best friend :)


Is there a way to set text transform to off as default in the IDE? 


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com