Textfield Question
Is there a way to set the distance between 2 lines:
Make it appear like this closer from one another.
Rather than like this
really reall far!
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 08-24-2006, 07:08 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading Text & JPG Nito TextField Makes Textfield White
Hi guys !
Does anyone know, why a textfield may become white when loading text + JPGs into it? Sometimes it happens to me, sometimes not. I haven't figured out why.
If you have any clues... I'd be really thankful
The AS I'm using:
_target.container.t.html = true
_target.container.t.condenseWhite = true
_target.container.t.autoSize = "left";
_target.container.t.htmlText = _data.texto
The String ( &HTML ):
"Text lorem ipsum bla bla ..... <img style='WIDTH: 154px; HEIGHT: 59px' height='298' width='856' alt='' src='http://www.spacilong.com/arq/img/AlcatelLucent_Hor_2col_sm.jpg' />
Textfield Woes, How To Anti-Alias A Dynamic Textfield?
this is driving me nuts, even if i have it marked so that my dynamic textfield is anti aliased, it still looks as if its text is aliased. And if i simply make that textfield Static, the text all of a sudden looks amazingly crisp and anti aliased.
How can i fix this?! I am attempting to load xml data into my text fields but its wasted if the text looks like crap..
So can anyone enlighten me on how to do this? i tried searching Flashs help, all i came out with was "Textfield._quality" but i do not understand what the description means exactly.. And i tried coding my textfield to _quality = "BEST";, with no avail.
Please help, i'v seen other websites with what i am sure is dynamically loaded fields, and smooth looking text... so what gives?
Thanks!
[textfield] How To Check If Input Text Is More Than Textfield Height?
Hi guys, Is there a way to check if the text that has been input into the textfield is more than the height of the textfield.
I have set the scrollbar hidden and it will become unhidden once the text is greater the the textfield height.
I did try to count the input text and set the visiblity of the scrollbar against that count. Unfortunatly this is unreliable.
Anyone got a better idea?
Cheers
Paul
[textfield] How To Check If Input Text Is More Than Textfield Height?
Hi guys, Is there a way to check if the text that has been input into the textfield is more than the height of the textfield.
I have set the scrollbar hidden and it will become unhidden once the text is greater the the textfield height.
I did try to count the input text and set the visiblity of the scrollbar against that count. Unfortunatly this is unreliable.
Anyone got a better idea?
Cheers
Paul
Link In Dynamic Textfield To Jump To Section Of Same Textfield
Howdy all,
I know you've all seen this before - you are on a website and you click a link and you stay on the same page but jump down to a different section of the page. Like an FAQ page or something where all the questions are listed above but you click on one and jumps down to the answer below.
Is it possible to do this in a dynamic (scrollable) textfield with externally loaded text files in Flash? I don't have DW and I know that there are limited html tags available but if anyone knows an easy way to do this please let me know!
thanks!
Link In Dynamic Textfield To Jump To Section Of Same Textfield
Howdy all,
I know you've all seen this before - you are on a website and you click a link and you stay on the same page but jump down to a different section of the page. Like an FAQ page or something where all the questions are listed above but you click on one and jumps down to the answer below.
Is it possible to do this in a dynamic (scrollable) textfield with externally loaded text files in Flash? I don't have DW and I know that there are limited html tags available but if anyone knows an easy way to do this please let me know!
thanks!
Masking Dynamic Textfield When The Textfield Has A Stylesheet
ok... i have a movieClip containing dynamic textfields, which i'm trying to mask. the textfields are linked to a stylesheet. i understand that, for the masking to work, i have to embed the font. so i've placed the font in the library, given it a linkage name and set embedFonts = true for the dynamic textfields.
what do i do next? and does the fact that i'm embeding the font override the effect of the stylesheet?
(sorry if i sound confused over this. that's because i am.)
thanks in advance for any help
[F8] Input Textfield Inside A Dynamic Textfield?
Hi,
Is it possible to place an input textfield inside a dynamic textfield?
I'd like to replace the variable, this.nTotal, below with an input textfield.
Is there some way to do this?
this.txtComplete.text = "There are " + this.nTotal + " pages in " + this.sGirlName + "'s book.";
Thanks!
Textfield In ScrollPane > Textfield Only Accessible With Clicking Twice
hi!
i have a scrollPane on the stage which contains an editable textfield.
unfortunately i can only access the textfield in the pane when i click on it twice. it seems that the first click goes for the activation of the pane and then comes the textfield.
does anybody have an idea how to solve that problem?
// Text Field
var myTextField:TextField = new TextField();
myTextField.text = "Please insert text";
myTextField.selectable = true;
myTextField.type = TextFieldType.INPUT ;
// ScrollPane
var myScrollPane:ScrollPane = new ScrollPane();
myScrollPane.source = myTextField;
addChild(myScrollPane);
Masking Dynamic Textfield When The Textfield Has A Stylesheet
ok... i have a movieClip containing dynamic textfields, which i'm trying to mask. the textfields are linked to a stylesheet. i understand that, for the masking to work, i have to embed the font. so i've placed the font in the library, given it a linkage name and set embedFonts = true for the dynamic textfields.
what do i do next? and does the fact that i'm embeding the font override the effect of the stylesheet?
(sorry if i sound confused over this. that's because i am.)
thanks in advance for any help
||| O ^ | + O ¬
Masking Dynamic Textfield When The Textfield Has A Stylesheet
ok... i have a movieClip containing dynamic textfields, which i'm trying to mask. the textfields are linked to a stylesheet. i understand that, for the masking to work, i have to embed the font. so i've placed the font in the library, given it a linkage name and set embedFonts = true for the dynamic textfields.
what do i do next? and does the fact that i'm embeding the font override the effect of the stylesheet?
(sorry if i sound confused over this. that's because i am.)
thanks in advance for any help
||| O ^ | + O ¬
Return TextField From Extended TextField Class
Hi
I'm trying to return a TextField from a class and then display it on stage... but I'm having problem to get it to show up on stage?
Help appreciated!
TFCreator.as:
Code:
import flash.display.*;
import flash.text.*;
public class TFCreator extends TextField
{
// TextField
private var tf:TextField;
// Properties
private var txt:String;
private var instancename:String;
private var color:Number;
private var autosize:String;
private var multilinee:Boolean;
private var wordwrap:Boolean;
// Default TextFormat
private var dfrmt:TextFormat;
private var dfrmt_font:String;
private var dfrmt_color:Number;
private var dfrmt_size:Number;
// External TextFormat
private var efrmt:TextFormat;
public function TFCreator(txt:String = "Text", instancename:String = "Instance", color:Number = 0x333333, autosize:String = "LEFT", multilinee:Boolean = false, wordwrap:Boolean = false, dfrmt_font:String = "Arial", dfrmt_size:Number = 11, dfrmt_color:Number = 0x333333):void
{
// Init Properties
this.txt = txt;
this.instancename = instancename;
this.color = color;
this.autosize = autosize;
this.multilinee = multilinee;
this.wordwrap = wordwrap;
// Init Default Textformat
this.dfrmt_font = dfrmt_font;
this.dfrmt_size = dfrmt_size;
this.dfrmt_color = dfrmt_color;
// Create TextField
createTextfield();
}
private function createTextfield():TextField
{
// New TextField
this.tf = new TextField();
// Set Default TextFormat
setDefaultTextformat();
// Set Properties
this.tf.text = this.txt;
this.tf.name = this.instancename;
this.tf.textColor = this.color;
setAutosize(this.autosize);
setMultiline(this.multilinee);
setWordwrap(this.wordwrap);
trace("Textfield created");
// Add TextField to Displaylist
//addChild(this.tf);
return this.tf;
}
// Getters & Setters......
}
}
and test on timeline:
Code:
import TFCreator;
var ttxt:String = "Halloooo?";
var t1:TFCreator = new TFCreator(ttxt,"inst1",0x666666,"LEFT",false,false,"Arial",13,0x333333);
addChild(t1);
t1.x = 200;
t1.y = 300;
//t1.selectable = false;
t1.setText("Baaaaa");
trace(t1.getText());
//t1.setAutosize("CENTER");
trace(t1.getAutosize());
trace(t1);
getChildByName("inst1");
It seems to work ok it just wont show up on stage.
Masking Dynamic Textfield When The Textfield Has A Stylesheet
ok... i have a movieClip containing dynamic textfields, which i'm trying to mask. the textfields are linked to a stylesheet. i understand that, for the masking to work, i have to embed the font. so i've placed the font in the library, given it a linkage name and set embedFonts = true for the dynamic textfields.
what do i do next? and does the fact that i'm embeding the font override the effect of the stylesheet?
(sorry if i sound confused over this. that's because i am.)
thanks in advance for any help
||| O ^ | + O ¬
TextField: Can We Embed HTML In Textfield?
Hello all,
I know that textfield can embed HTML like:
Code:
createTextField("noteText", 1, 100, 100, 300, 30);
noteText.type = "dynamic";
noteText.wordWrap = true;
noteText.border = true;
noteText.html = true;
noteText.htmlText = '<font color="#FF0000">This is HTML</font>';
I wonder if we embed button, HTML input field int Flash textfield?
Code:
noteText.htmlText = '<input name="txtTest" type="text">';
Thanks,
Create Textfield With New Textfield Variable?
flash MX 2004 professional
--------------------------
anyone know if it's possible to create a dynamic textfield AND specify not only an instance name but also a textfield variable?
thx
eve
Cant Get Textfield Height From AutoSized Textfield
Afternoon guys.
I am creating a new nwe3s blogger. Instead of relying on a scrollbar to scroll the news story i thought i would use
code: textField.autosize="left"
This works fine...
At present i am loading x amount of news into flash at any one time. I am placing the news story underneath each other using
code:
holder.attachMovie ("newsMc", "news" + i, i);
holder['news' + i]._y = nextY;
nextY += Math.ceil (holder['news' + i]._height) + 2;
this is fine...
But when i use
code: textField.autosize="left"
nextY retains it's orginal height even though some of the news stories have made for higher textfields.
I thought i could pull the height from the previuosly created news holder
code:
if (i > 0) {
j = i - 1;
trace (j + " text height=" + holder['news' + j].newsStory._height);
if (holder['news' + j].newsStory._height > 184) {
nextY += Math.ceil (holder['news' + j]._height) + 2;
} else {
nextY += Math.ceil (holder['news' + j]._height) + 2;
trace ("nextY=" + nextY);
}
But this still returns the intial height
Here is the complete code
code:
for (i = 0; i < this.newsCount; i++) {
holder.attachMovie ("newsMc", "news" + i, i);
holder['news' + i]._y = nextY;
holder['news' + i].newsTitle.text = this['news' + i + 'newsTitle'];
holder['news' + i].newsDate.text = "Submitted: " + this['news' + i + 'newsDate'];
holder['news' + i].newsStory.htmlText = this['news' + i + 'newsStory'];
nextY += Math.ceil (holder['news' + i]._height) + 2;
if (i > 0) {
j = i - 1;
trace (j + " text height=" + holder['news' + j].newsStory._height);
if (holder['news' + j].newsStory._height > 184) {
nextY += Math.ceil (holder['news' + j]._height) + 2;
} else {
nextY += Math.ceil (holder['news' + j]._height) + 2;
trace ("nextY=" + nextY);
}
}
unloadMovie (dtLoader);
viser._visible = 0;
}
Cant Get Textfield Height From AutoSized Textfield
Afternoon guys.
I am creating a new nwe3s blogger. Instead of relying on a scrollbar to scroll the news story i thought i would use
ActionScript Code:
textField.autosize="left"
This works fine...
At present i am loading x amount of news into flash at any one time. I am placing the news story underneath each other using
ActionScript Code:
holder.attachMovie ("newsMc", "news" + i, i);
holder['news' + i]._y = nextY;
nextY += Math.ceil (holder['news' + i]._height) + 2;
this is fine...
But when i use
ActionScript Code:
textField.autosize="left"
nextY retains it's orginal height even though some of the news stories have made for higher textfields.
I thought i could pull the height from the previuosly created news holder
ActionScript Code:
if (i > 0) {
j = i - 1;
trace (j + " text height=" + holder['news' + j].newsStory._height);
if (holder['news' + j].newsStory._height > 184) {
nextY += Math.ceil (holder['news' + j]._height) + 2;
} else {
nextY += Math.ceil (holder['news' + j]._height) + 2;
trace ("nextY=" + nextY);
}
But this still returns the intial height
Here is the complete code
ActionScript Code:
for (i = 0; i < this.newsCount; i++) {
holder.attachMovie ("newsMc", "news" + i, i);
holder['news' + i]._y = nextY;
holder['news' + i].newsTitle.text = this['news' + i + 'newsTitle'];
holder['news' + i].newsDate.text = "Submitted: " + this['news' + i + 'newsDate'];
holder['news' + i].newsStory.htmlText = this['news' + i + 'newsStory'];
nextY += Math.ceil (holder['news' + i]._height) + 2;
if (i > 0) {
j = i - 1;
trace (j + " text height=" + holder['news' + j].newsStory._height);
if (holder['news' + j].newsStory._height > 184) {
nextY += Math.ceil (holder['news' + j]._height) + 2;
} else {
nextY += Math.ceil (holder['news' + j]._height) + 2;
trace ("nextY=" + nextY);
}
}
unloadMovie (dtLoader);
viser._visible = 0;
}
INPUT TextField Within An HTML TextField Via <img>
I'm trying to extend an HTML TextField to include an INPUT TextField control as an <img> tag. This I can do. The problem is that mouse and keyboard events are not being seen by the inner TextField. I created a test case to demonstrate the situation. My guess is that <img> tags are treated like AS2 events and because the outer TextField is trapping text events, they are not propagated to the inner TextField. Is there anyway around this problem? Mouse events to other DisplayObjects work fine. I'm using Flash CS3.
The test case contains two classes. TextImgTest is the document class for TextImgTest.fla. TestImg implements the <img> loaded by TestImgTest. To run this. Just create an empty TextImgTest.fla and set the document class to TextImgTest. Then publish and run.
Attach Code
package
{
import flash.display.MovieClip;
import flash.events.TimerEvent;
import flash.text.TextFieldAutoSize;
import flash.text.TextField;
import flash.text.StyleSheet;
import flash.utils.Timer;
import TestImg;
public class TextImgTest extends MovieClip
{
public var textField: TextField;
public var styleSheet: StyleSheet;
public var img: TestImg;
public var timer: Timer;
public function TextImgTest(): void
{
// render directly
img = new TestImg();
addChild(img);
// render within a TextField as an <img> tag.
styleSheet = new StyleSheet();
styleSheet.setStyle("p", {fontFamily:"sans-serif", fontSize:"10"});
textField = new TextField();
textField.styleSheet = styleSheet;
textField.multiline = true;
textField.autoSize = TextFieldAutoSize.LEFT;
textField.wordWrap = true;
textField.border = true;
textField.borderColor = 0x0000FF;
textField.background = true;
textField.backgroundColor = 0xFFCCFF;
textField.width = 190;
textField.x = 5;
textField.y = 120;
textField.htmlText = "<p>TextField with an <img src='TestMsg' id='rmk'> tag:<br><img src='TestImg' id='rmk'></p>"
addChild(textField);
textField.selectable = true;
textField.mouseEnabled = true;
// Give it a little time to render then get a reference to it.
timer = new Timer(3000, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimeout);
timer.start();
}
public function onTimeout(evt: TimerEvent): void
{
var freeText: TestImg = textField.getImageReference("rmk") as TestImg;
freeText.tField.mouseEnabled = true;
freeText.tField.selectable = true;
freeText.tField.appendText(" Got ImageReference for 'rmk'.");
}
}
}
===================================================
package
{
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
import flash.text.TextField;
import flash.text.TextFieldType;
public class TestImg extends MovieClip
{
static public const MSG_WIDTH: int = 170;
static public const MSG_HEIGHT: int = 100;
static public const MSG_MARGIN: int = 8;
public var tFmt: TextFormat;
public var tField: TextField;
public var sBut: SimpleButton;
public function TestImg(): void
{
super();
this.tabEnabled = false;
this.mouseEnabled = false;
// Show this MovieClip
with (this.graphics)
{
clear();
beginFill(0x9999FF);
drawRect(0, 0, MSG_WIDTH, MSG_HEIGHT);
endFill();
}
// Show the INPUT TextField within it.
tFmt = new TextFormat("_sans", 10, 0x000000, true, false,
false, null, null,
TextFormatAlign.LEFT);
tField = new TextField();
tField.type = TextFieldType.INPUT;
tField.height = MSG_HEIGHT - 2*MSG_MARGIN - 16;
tField.defaultTextFormat = tFmt;
tField.multiline = true;
tField.wordWrap = true;
tField.width = MSG_WIDTH - 2*MSG_MARGIN;
tField.border = true;
tField.borderColor = 0xFF0000;
tField.background = true;
tField.backgroundColor = 0xFFEECC;
tField.x = MSG_MARGIN;
tField.y = MSG_MARGIN;
tField.text = "TestImg MovieClip containing an INPUT TextField.";
this.addChild(tField);
tField.selectable = true;
tField.mouseEnabled = true;
// Show the button within this MovieClip
var butGraphics1: Sprite = new Sprite();
with (butGraphics1.graphics)
{
lineStyle(1, 0x000000);
beginFill(0xFF0000);
drawRect(0, 0, 32, 16);
endFill();
}
var butGraphics2: Sprite = new Sprite();
with (butGraphics2.graphics)
{
lineStyle(1, 0x000000);
beginFill(0x00FF00);
drawRect(0, 0, 32, 16);
endFill();
}
sBut = new SimpleButton();
sBut.upState = butGraphics1;
sBut.overState = butGraphics2;
sBut.downState = butGraphics1;
sBut.hitTestState = butGraphics2;
sBut.x = MSG_MARGIN;
sBut.y = MSG_HEIGHT - MSG_MARGIN - 16;
this.addChild(sBut);
}
}
}
[ac-mx-04]duplicate A Textfield OR Doing A Textfield With Outlines.
Either I want code to duplicate a textfiled OR...
To do a textfield that that font outlines on "§!"#¤%&/()=?`@£${[]}¨^~'*-_.:,;<>|qwertyuiopåasdfg hjklöäzxcvbnmQWERTYUIOPÅASDFGHJKLÖÄZXCVBNM01234567 89"
And some others settings:
font: fixed_v01
color: white
align: left
size: 8
selectable: NO
render as html: yes
Can someone help me with this?
Cant Get Textfield Height From AutoSized Textfield
Afternoon guys.
I am creating a new nwe3s blogger. Instead of relying on a scrollbar to scroll the news story i thought i would use
ActionScript Code:
textField.autosize="left"
This works fine...
At present i am loading x amount of news into flash at any one time. I am placing the news story underneath each other using
ActionScript Code:
</p>
<p>holder.attachMovie ("newsMc", "news" + i, i);</p>
<p>holder['news' + i]._y = nextY;</p>
<p>nextY += Math.ceil (holder['news' + i]._height) + 2;</p>
<p>
this is fine...
But when i use
ActionScript Code:
textField.autosize="left"
nextY retains it's orginal height even though some of the news stories have made for higher textfields.
I thought i could pull the height from the previuosly created news holder
ActionScript Code:
</p>
<p>if (i > 0) {</p>
<p>j = i - 1;</p>
<p>trace (j + " text height=" + holder['news' + j].newsStory._height);</p>
<p>if (holder['news' + j].newsStory._height > 184) {</p>
<p>nextY += Math.ceil (holder['news' + j]._height) + 2;</p>
<p>} else {</p>
<p>nextY += Math.ceil (holder['news' + j]._height) + 2;</p>
<p>trace ("nextY=" + nextY);</p>
<p>}</p>
<p>
But this still returns the intial height
Here is the complete code
ActionScript Code:
</p>
<p>for (i = 0; i < this.newsCount; i++) {</p>
<p> holder.attachMovie ("newsMc", "news" + i, i);</p>
<p> holder['news' + i]._y = nextY;</p>
<p> holder['news' + i].newsTitle.text = this['news' + i + 'newsTitle'];</p>
<p> holder['news' + i].newsDate.text = "Submitted: " + this['news' + i + 'newsDate'];</p>
<p> holder['news' + i].newsStory.htmlText = this['news' + i + 'newsStory'];</p>
<p> nextY += Math.ceil (holder['news' + i]._height) + 2;</p>
<p> if (i > 0) {</p>
<p> j = i - 1;</p>
<p> trace (j + " text height=" + holder['news' + j].newsStory._height);</p>
<p> if (holder['news' + j].newsStory._height > 184) {</p>
<p> nextY += Math.ceil (holder['news' + j]._height) + 2;</p>
<p> } else {</p>
<p> nextY += Math.ceil (holder['news' + j]._height) + 2;</p>
<p> trace ("nextY=" + nextY);</p>
<p> }</p>
<p> }</p>
<p> unloadMovie (dtLoader);</p>
<p> viser._visible = 0;</p>
<p>}</p>
<p>
[ac-mx-04]duplicate A Textfield OR Doing A Textfield With Outlines.
Either I want code to duplicate a textfiled OR...
To do a textfield that that font outlines on "§!"#¤%&/()=?`@£${[]}¨^~'*-_.:,;<>|qwertyuiopåasdfg hjklöäzxcvbnmQWERTYUIOPÅASDFGHJKLÖÄZXCVBNM01234567 89"
And some others settings:
font: fixed_v01
color: white
align: left
size: 8
selectable: NO
render as html: yes
Can someone help me with this?
Cant Get Textfield Height From AutoSized Textfield
Afternoon guys.
I am creating a new nwe3s blogger. Instead of relying on a scrollbar to scroll the news story i thought i would use
ActionScript Code:
textField.autosize="left"
This works fine...
At present i am loading x amount of news into flash at any one time. I am placing the news story underneath each other using
ActionScript Code:
holder.attachMovie ("newsMc", "news" + i, i);
holder['news' + i]._y = nextY;
nextY += Math.ceil (holder['news' + i]._height) + 2;
this is fine...
But when i use
ActionScript Code:
textField.autosize="left"
nextY retains it's orginal height even though some of the news stories have made for higher textfields.
I thought i could pull the height from the previuosly created news holder
ActionScript Code:
if (i > 0) {
j = i - 1;
trace (j + " text height=" + holder['news' + j].newsStory._height);
if (holder['news' + j].newsStory._height > 184) {
nextY += Math.ceil (holder['news' + j]._height) + 2;
} else {
nextY += Math.ceil (holder['news' + j]._height) + 2;
trace ("nextY=" + nextY);
}
But this still returns the intial height
Here is the complete code
ActionScript Code:
for (i = 0; i < this.newsCount; i++) {
holder.attachMovie ("newsMc", "news" + i, i);
holder['news' + i]._y = nextY;
holder['news' + i].newsTitle.text = this['news' + i + 'newsTitle'];
holder['news' + i].newsDate.text = "Submitted: " + this['news' + i + 'newsDate'];
holder['news' + i].newsStory.htmlText = this['news' + i + 'newsStory'];
nextY += Math.ceil (holder['news' + i]._height) + 2;
if (i > 0) {
j = i - 1;
trace (j + " text height=" + holder['news' + j].newsStory._height);
if (holder['news' + j].newsStory._height > 184) {
nextY += Math.ceil (holder['news' + j]._height) + 2;
} else {
nextY += Math.ceil (holder['news' + j]._height) + 2;
trace ("nextY=" + nextY);
}
}
unloadMovie (dtLoader);
viser._visible = 0;
}
Vector Printing Of TextField. Part Of TextField Not Printing.
Hi, I hope somebody here can help me.
I have a movieclip with a dynamic textField in it.
I set autoSize = "center" and fill it with text.
Then, if i then use PrintJob.addPage("myPage", {printAsBitmap:false}); , the bottom few lines of the textfield don't print. (The textField shows up fine on the screen.)
The textField shows up fine if I use {printAsBitmap:false}, allbeit in lower quality.
If anyone can make a dynamic textField print properly as vector, please lemme know.
thx,
miguel3d
Textfield
who can me explain:
I want to get a textfield (user entry) with a defined number of rows.
Textfield?
Hello,
Hope this is easy,...
Can you size a dynamic textfield depending on the amount of text entered at runtime? Or how can you format a text string to be visible in a textfield no matter how long the string is?
Well, maybe I should explain a little better. How can you have a user input text and have it diplay in a textfield that sizes itself to the text entered?
Regards
~GD~
Help On Textfield
Hi all
I recently downloaded a smart clip and having problem.
-----------------------------------------------------------
How do I make it animate the every tenth letter and not one by one...it takes forever to complete the text?
---------------------------------------------------------
Here is the code.
Instance name of textfield = "box"
on frame 1
Length = length(textwanted);
on frame 2
if (i<=length) {
box = substring(textwanted, 0, i);
gotoAndPlay (2);
i = i+1;
if (i>length) {
stop ();
}
}
----------------------------------------------------
text is feeded from clip parameters.
textwanted= hello world and welcome to .....!
thanks alot
Reverse
[Edited by PilotX on 02-15-2002 at 06:25 AM]
HELP ON TEXTFIELD
Hello,
I've got a movie where people can type in a text.
After that, I want to animate the text so it's rotated and scaled to fake a 3D-effect.
So I have:
Input text
Button to start
Text field to be animated.
With the button I send the input to the animated textfield.
This is going fine, but when I animate the textfield and test the movie nothing happens.
As soon as I rotate the textfield, nothing happens.
Please Help!!!
Textfield
how do i change the BACKGROUND color of a dynamic textfield? i'm not a newby, hello there, but i'm helpless, what's the trick. i tried the FLASH helpsite to no help. or has it to do that it might be a component? thanx
About AS TextField
Hi everyone...
I have a question about TextField(Object) in Flash MX.
I use the
this.createTextField("myText",1,50,50,200,200);
myText.text="Hello everyone...!!";
and some other TextField methods and/or properties to create text fields dynamically.
They all work correctly until I use a Mask layer! Whenever I put my dynamic text field in a masked layer, I won't get the result!! I used the TextField.embedFonts and nothing happened except that I could see only my text BORDER (without any text in it!!).
As I understood, the problem relates somehow to the mask layers. Can anybody help me????
Any suggestion will be appreciated.
Thanks a lot...
Top Quark
TextField Help
I have buttons that resemble a keyboard with the action:
----------------------------------------
//this is an example of "A" button
on (release){
AddDigit("a");
}
----------------------------------------
the actions frame has this:
--------------------------
function AddDigit (digit) {
// Add a digit to display
if (clear) {
clear = false;
decimal = false;
display = ".";
}
if (dispno=true) {
if (display == "." and digit != ".") {
display = digit;
} else {
display = display+digit;
}
} else {
}
}
//remove digits - backspace button
function RemoveDigit() {
display = display.slice(-0,-1);
}
-----------------------------------------------
My goal is to figure out how can I write a function
for a new textfield called "warning" that will say "Limit is 15 characters"
my Pseudo code :
If their are more than 15 digits in the display
make a warning in another textfield saying the "Limit is 15 characters"
I've been working on this for some time but writing functions is not my strong point . Thanks for the help.
Help With A Textfield
Hi
I am making a body mass index converter. The user inpute their weight and height and their BMI is displayed, i know the coversion equation etc. Just need to know how i get the result to show up in a text field. Am i right in thinking this textfield should be dynamic?
Any help much appreciated
Textfield
i'm just starting textfieild work but i can't understand most of it. mostly with the numbers after the name of the text field. ex...
this.createTextField("ben",1,10,10,200,30);
can someone send me some info or give me a link to a good site to learn from. it would be greatly appreciated. thnx
Textfield
hi
My doubt is "Can dynamically created textfield work as buttons."
This is similar to search engine.I,m able to write a code for search for a particular word in list of strings & display those strings dynamically, but unable to give actions for that strings(which is textfield).
Regards
Jyothi
How Do I Put Any Value I Want In Any Textfield?
Hi!
I know I'm thinking about this wrong, but I can't seem to get unstuck.
I have two input text fields on the stage with variables respectively called inputField1, and inputField 2. I would like to put any value I want in either one of these.
I tried to write a function:
function showValue(value,field){
numValue = Number(value); //value is coming from an external variable
trace(numValue + 20); //traces back a sum
field = numValue + 36;
}
showValue(dadAge,inputField1); //dadAge=18 is on the external .txt file
So I want the number 54 showing up in inputField1. And of course it's not happening.
Any help would be great!
Thanks!
Help With A Textfield
I'm working on this learning activity. I have been able to get everything to work, however, I would like to move the textfield down to the center of the stage and center.
I would like to also move the text to be dragged down.
Since I don't know much about ActionScript I can't find where I can control this.
I would appreciate you helping me.
Thanks for your help
Ecinele
[F8] Textfield Tip
Is it possible to have say have some light grey text inside a textfield to indicate what information should be entered and when the user clicks inside the textfield that text will disappear and allow the user to type in text? If so, could someone help with script?
Thanks,
~SC
Help With Using <img> Tag In A Textfield
Im trying to include some photos in a textfield with a scrollbar using the <img> html tag at the following url http://www.cloud9mission.com/swf/photo.swf
When I roll over the two text links (October 2006 and Old Photos) they move to the center of the text field. By the looks of things, its aligning them to the edge of the images further down the scrollbar. This is most annoying as its working exactly how I want it to otherwise.
This is the first time Ive tried the <img> tag and Ive already figured out I need to use the <br> tag rather a lot to get the images in the right place but this error is a little wierd.
Heres a copy of the actionscript Im using for the textfield:
Code:
var format = new TextField.StyleSheet();
var path = "flash.css"; //the name of the css file that formats this loaded text !!
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
gallery.styleSheet = format; //'output' is the Instance Name of the Dynamic Text Box !!
myLoadVar = new LoadVars ();
myLoadVar.load("gallery.php") //the name of the text file you're loading !!
myLoadVar.onLoad = function (success){
if (success == true) {
gallery.variable = "gallery" //variable name of the text1= line in your external loaded text file !!
gallery.htmlText=myLoadVar.gallery; //text1 should use the same name as the above line !!
}
}
} else {
gallery.text = "Error loading CSS file!";
}
};
Heres a copy of the code used in the external file:
Code:
gallery=<b>The latest albums and photos are listed below. Please visit The Cloud9 Mission Photo Gallery to view the photo collection.<br>
<br>
<p><u><font size="14">Latest Photo Albums:</font></u><br>
<br>
<br>
<a href="../gallery/thumbnails.php?album=1" target="_blank">October 2006</a><br>
<a href="../gallery/thumbnails.php?album=2" target="_blank">Old Photos</a><br>
</p>
<u><font size="14">Latest Photos:</font></u><br>
<br>
<br>
<p><a href="../gallery/displayimage.php?pos=-15" target="_blank"><img src="../gallery/albums/userpics/10001/thumb_714056702_l.jpg" border="0" width="100"></a><br>
<br>
<br>
<br>
<br>
</p>
<p><a href="../gallery/displayimage.php?pos=-14" target="_blank"><img src="../gallery/albums/userpics/10001/thumb_1071756236_l.jpg" border="0" width="100"></a><br>
<br>
<br>
<br>
<br>
</p>
<p><a href="../gallery/displayimage.php?pos=-12" target="_blank"><img src="../gallery/albums/userpics/10001/thumb_271248203_l.jpg" border="0" width="100"></a><br>
<br>
<br>
<br>
<br>
</p>
<p><a href="../gallery/displayimage.php?pos=-10" target="_blank"><img src="../gallery/albums/userpics/10001/thumb_423980762_l.jpg" border="0" width="100"></a><br>
<br>
<br>
<br>
<br>
</p>
<p><a href="../gallery/displayimage.php?pos=-9" target="_blank"><img src="../gallery/albums/userpics/10001/thumb_426937651_l.jpg" border="0" width="100"></a><br>
<br>
<br>
<br>
<br>
</p>
</b>
Hope you can help folks
Lewis
Textfield, Xml And Css
Hi,
I'm laoding an xml file into a text field - that works fine. But I want to use a css style too. The only thing i need the css for is to use an image instead of a standard bullet point. so I have a css file with just one line in it....
li { list-style-position: outside; list-style-image: url("goldbullet.png"); }
But that's not working. The css is loading but no images in the textfield.
Ultimately, I'd prefer to use an image within the .fla as a bullet but can't find much info on this. Any help would be very much appreciated.
Code:
var myStyle = new TextField.StyleSheet();
var cssLocation = "../xml/mystyle.css";
myStyle.load(cssLocation);
myStyle.onLoad = function (success)
{
if (success)
newstext.styleSheet = myStyle;
}
var my_xml = new XML ();
my_xml.ignoreWhite = true;
my_xml.load ("../xml/news.xml");
my_xml.onLoad = function (success)
{
if (success)
newstext.htmlText = this;
}
Using CSS In Textfield
Hi. I have a textfield that I drew on the stage, with name "hebrew_box". I want to load a style sheet to control the display of text in that box. I looked at all the docs, and it seems to me that the code below should work. It does in fact load the style sheet, but the styles are not applied to the text (i.e., I don't see any bold text.) I'm exasperated, and I don't know what I'm doing wrong. I would appreciate any help! Thanks so much. -- Dave
ActionScript Code:
var hebrewString:String = "<p>Is this <span class='bold'>bold</span> then? </p>";
hebrew_box.html = true;
hebrew_box.selectable = false;
var styleObj:TextField.StyleSheet = new TextField.StyleSheet();
styleObj.onLoad = function(success:Boolean) {
if (success) {
hebrew_box.StyleSheet = styleObj;
hebrew_box.htmlText = hebrewString;
trace(this.getStyleNames());
}
else {
trace("Error loading CSS file.");
};
};
styleObj.load("styles.css");
TextField
Hi
I have 2 questions about htmlText property.
1. Image tag - Id attributes
I wanted my image to be a link. I added id to my image tag but I don't know how to get acces this object from code.
2. Anchor tag
You can also define a:link, a:hover, and a:active styles for anchor tags by using style sheets.
How to define CSS (should it be outside file or can it be created inside flash), how to aplay CSS to TextField?
TextField
I'm having a problem with my textfields. I'm using two textfields "A" and "B" to create an array. The user inputs a number into "A" and another number into "B" and then hits a button which then generates an array between the two numbers entered. It works fine in most cases. BUT, if the number in "A" is for example "2" and the number in "B" is "10" then there is no results. It seems that the number "10" is being interpreted as a "1" and so on.... Any suggestions?? Thanks.
TextField Over Mc.
Hi, I'm transfering from AS1 to AS3 and have few problems like this one.
I've got mc1 which has mc (with mouse_over action) and dynamic textfield inside. And another mc2 with the sam mc and tf inside.
Problem is that when mc1's textfield is over mc2's mc - the mc2.mc over action don't work... How to fix it?
In attachment you can see the example:
f.ex. zoom in to Silesia (at the middle bottom, where is lots of dots) then mouse over Goczałkowice Zdrój and then Pszczyna which is not working any more...
PS in AS1 (probably in AS2 too) that was working...
'for' And TextField
hi all... I've got this problem when I try to dynamically create TextField Objects on a 'for' cycle loop...
here's my code and the error that outputs:
ActionScript Code:
var i:int;
for (i=1; i<5; i++) {
var this["text"+i]:TextField = new TextField();
addChild(this["text"+i]);
this["text"+i].text = "hi. I'm text field #"+i;
}
the whole thing works well when I previously create all 4 textfields separately but outputs syntax error #1084: expecting identifier before this, on the var this["text"+i]:TextField = new TextField(); line
how can I manage to create thos TextField dynamically??
thanks
<td> And TR> Within A Textfield
Can Flash read <td> and <tr> within a text field? Or can I use a stylesheet for this (i.e. CSS)
Can someone give me a link to the HTML Flash can handle?
thanks
-
As2 Xml Textfield Help
Hi guys so I'm having a problem getting flash to display my text field. If anyone has any ideas I'ld love to hear em!
ActionScript Code:
function buildImageBox() {
imageText = _root.Images[_root.p].attributes.title;
imageURL = _root.Images[_root.p].firstChild.nodeValue;
imageURL = "images/"+imageURL;
trace(imageURL);
thisClip = createEmptyMovieClip("image"+_root.p, this.getNextHighestDepth());
thisClip._y = (_root.p*150+40);
thisClip._x = 20;
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadInit = function(target:MovieClip):Void {
trace(target+".onLoadInit");
var thisTextClip:MovieClip = target;
target.oWidth = target._width;
target.oHeight = target._height;
trace("Width: "+target._width);
trace("Height: "+target._height);
if (target._width>target._height) {
intScale = 100/target._height;
intDupScale = 212/target._height;
target._yscale = intScale*100;
target._xscale = intScale*100;
trace(target._xscale);
} else {
intScale = 100/target._width;
intDupScale = 212/target._width;
target._yscale = intScale*100;
target._xscale = intScale*100;
trace(target._xscale);
}
// textY._y = (target._y + target._height + 15);
// textX._x = target._x;
thisTextClip.createTextField("test_txt"+_root.p, _root.scrollHolder.box1.getNextHighestDepth(), 0, 0, 100, 100);
thisTextClip["test_txt"+_root.p]._y = target._y + target._height + 10;
thisTextClip["test_txt"+_root.p]._x = target._x;
thisTextClip["test_txt"+_root.p].text = imageText;
thisTextClip["test_txt"+_root.p].wordWrap = true;
thisTextClip["test_txt"+_root.p].size = 12;
thisTextClip["test_txt"+_root.p].textColor = 0x00cc00;
thisTextClip["test_txt"+_root.p].bold = false;
thisTextClip["test_txt"+_root.p].embedFonts = true;
thisTextClip["test_txt"+_root.p].autoSize = true;
var emphatic:TextFormat = new TextFormat();
emphatic.bold = true;
emphatic.size = 16;
emphatic.font = "Georgia";
thisTextClip["test_txt"+_root.p].setTextFormat(emphatic);
trace("THIS IS THE TEXT " + thisTextClip["test_txt"+_root.p].text);
trace(thisTextClip["test_txt"+_root.p]._y + " SHOW IT TO US")
target.myName = "image"+_root.p;
target.intScale = intDupScale;
target.onRelease = function() {
duplicateImage(this.myName,this.intScale,this.oHeight,this.oWidth);
};
if (_root.p<_root.Images.length-1) {
_root.p += 1;
buildImageBox();
}
};
mcLoader.addListener(listener);
mcLoader.loadClip(imageURL,thisClip);
}
function duplicateImage(grabThisClip, intScale, thisHeight, thisWidth) {
trace(grabThisClip);
// new Bitmap
// draw.
trace(thisWidth+" | "+thisHeight);
bmap = new flash.display.BitmapData(thisWidth, thisHeight, false, 0);
//var m:Matrix = new Matrix();
//m.scale(1,1);
//bmap.draw(grabThisClip,m);
bmap.draw(grabThisClip);
_root.addPhoto1.holder.attachBitmap(bmap,0);
_root.addPhoto1.holder._xscale = intScale*100;
_root.addPhoto1.holder._yscale = intScale*100;
_root.addPhoto1.holder._x = 0;
_root.addPhoto1.holder._y = 0;
_root.addPhoto1.holder.onPress = function() {
if (thisHeight<thisWidth) {
_root.addPhoto1.holder.startDrag(false,0,0,-_root.addPhoto1.holder._width+212,0);
} else {
_root.addPhoto1.holder.startDrag(false,0,0,0,-_root.addPhoto1.holder._height+212);
}
};
_root.addPhoto1.holder.onRelease = function() {
_root.addPhoto1.holder.stopDrag();
};
}
var myImages:String = "image";
/*clipsUp.onRelease = function() {
for (i=0; i<=_root.p; i++) {
if (eval(myImages+_root.p)._y >= 0) {
eval(myImages+i)._y -= 50;
trace("running");
}
}
};
clipsDown.onRelease = function() {
for (i=0; i<=_root.p; i++) {
if (eval(myImages+1)._y <= 40) {
eval(myImages+i)._y += 50;
trace("running");
}
}
};*/
Trying To Add CSS To A TextField
I have a CSS file:
Code:
h1 {
color: #800000;
font-family:"sans serif";
}
Then I have a listener for when the CSS is loaded to save the data into a variable:
Code:
/*
* onStyleLoadComplete(e:Event):void
*/
public function onStyleLoadComplete(e:Event):void {
e.target.removeEventListener(Event.COMPLETE, onStyleLoadComplete);
trace("Style sheet loaded.");
debugTxt.appendText("Style sheet loaded.
");
this.journalStyle = new StyleSheet();
this.journalStyle.parseCSS(e.target.data);
}
And then a button that creates a TextField and adds the style to it.
Code:
/*
* onJournalLoadComplete(e:Event):void
*/
public function onJournalLoadComplete(e:Event):void {
e.target.removeEventListener(Event.COMPLETE, onJournalLoadComplete);
e.target.removeEventListener(ProgressEvent.PROGRESS, onJournalLoadProgress);
this.journalLoaded = true;
this.journalText = new TextField();
this.journalText.width = 800;
this.journalText.height = 600;
this.journalText.x = 160;
this.journalText.y = 5;
this.journalText.styleSheet = this.journalStyle;
this.journalText.htmlText = URLLoader(e.target).data;
removeChild(this.loaderBar);
addChild(this.journalText);
}
I get no errors with this, but the text that comes in isn't formatted! The first line of the text is <h1>Some Text</h1>
|