Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Text Centering On Rollover



I'm pretty new to Flash, and just started using MX the other day. I was wondering how I could get text to center itself on rollover. The following website uses this effect in its nav bar.
rollover centering in nav bar

Thanks in advance - Chris



FlashKit > Flash Help > Flash MX
Posted on: 05-20-2004, 05:04 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Centering Text Vertically In A Dynamic Text Box In Flash
Hi guys,

Does anyone know if it is possible to centre text vertically in a dynamic text box in flash?

I've had a look around and can't find any buttons which will do the job for me.

cheers

Centering Dynamic Text
i am trying to centre the dynamic text in my upload file field in actionscript, but i cant seem to figure out how to do it. below is a tidbit of my attempt. any help would be excellent!

list_obj.onSelect = function(){
name_txt.text = file_fr.name;
name_txt.textAlign = "center";

}

Centering Text Vertically
I did a search on this and found a couple of good posts, but I'm just not getting something. Take the following code for instance, it should create a text field and populate it with giberish, which it does;


Code:
this.createTextField("my_textbox", 0, 100, 0, 200, 0);
// numbers = ?,horizontal placement,vert placement, width,?
my_textbox.text = "asdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkssasdksdkss"
my_textbox.autoSize = "center";
my_textbox.multiline = true;
my_textbox.wordWrap = true;
my_textbox.html = true;
my_textbox._y = Stage.height / 2 - (my_textbox.textHeight / 2);
Shouldn't it also place this text field centered on the stage? The my_textbox._y (it's vertical positioning) is set to be equal to one half of the stage height, minus one half of the text box's text height. As near as I can figure this should center the text vertically... but instead it lines it up with the top line in the vertical center of the page. It seems that my my_textbox.textHeight / 2 part isn't doing much.

Any idea what I'm missing here?

datter

Centering Text Vertically
is is possible to vertically center text within a dynamic text box. if so, how on earth do you do it?

thanks in advance

andrew

X/y & Centering Dynamic Text
I have a 125px by 125px box with a label system attached to the movie clip is a class that handles the xml and functionality of the menu. This label has some different text that needs to fit in it each time, easy. The problem is i need to center both x and y inside that text box sort of like a align=center valign= middle in html. Is there a way to acomplish this?

Centering Text On Movieclip
Hi!
I want to make my createTextField centered on my movieclip, does anyone know how this is done? I've tried using the texWidth/_width property but it only makes it to narrow. Or is it possible to size the background fill to the length of the word?


PHP Code:



var aPoints:Array = ["one", "two", "three", "four"];function printIt() {    for (var i = 0; i<aPoints.length; i++) {        _root.createEmptyMovieClip("box"+i+"_mc", this.getNextHighestDepth());        var myCurrClip = _root["box"+i+"_mc"];        myCurrClip.createTextField("my_txt", 1, 0, 0, 100, 40);        myCurrClip.my_txt.autoSize = true;        myCurrClip.my_txt.border = false;        var my_fmt:TextFormat = new TextFormat();        my_fmt.color = 0xB80000;        my_fmt.size = 20;        my_fmt.font = "verdana";        my_fmt.align = "center";        myCurrClip.my_txt.text = aPoints[i];        myCurrClip.beginFill(0x224488, 100);        myCurrClip.moveTo(0, 0);//This is no good way of setting the size ...        myCurrClip.lineTo(myCurrClip.my_txt.textWidth*3, 0);        myCurrClip.lineTo(myCurrClip.my_txt.textWidth*3, 30);        myCurrClip.lineTo(0, 30);        myCurrClip.endFill();        myCurrClip._y = 10+50*i;        myCurrClip._x = 10;        myCurrClip.my_txt.setTextFormat(my_fmt);    }}printIt(); 




kind regards, ollu

Verticle Centering - Dynamic Text Box
Ok, is there an easy way to vertically align text with in a text box? It has to be a mathematically calculated process as the font and size of the text will change.

Thanks

btw: i've received some great assistance here! The responses are usually right on or at least point me in the correct direction!

Centering Dynamic Text With Object
Since the text sometimes contains 2 lines of text, how can I setup the mc containing the dynamic text to align to the center of another mc? I tried setting a variable to _y of the 1st clip and then setting _y of the dynamic text clip to equal the variable, but nothing happens.

clip1:

onClipEvent (enterFrame) {
ycenter = _y;
}

dynamic text clip:

onClipEvent (enterFrame) {
setProperty ("", _y, ../:ycenter);
}

Thanks!

Centering Dynamic Text Vertically?
Hello,

I have a dynamic multiligned text box that I need to center vertically in the control. How do I do this?

Thank you

Please Help Centering Dymanic Html Text
I cannot seem to center my html text in my dynamic TextField. I tried using setTextFormat(), using a TextFormat object, but that does not work either. Anyone have a sample?
please help

Dynamic Text Box Centering Vertically
Is there any way, either through ActionScript or not, that I can vertically center text in a Dynamic Text Box? I know I can center horizontally, but what about vertically?

Thanks,
zip

Vertical Centering Of Dynamic Text
Hi,

i have a dynamic text object with some text inside.
how can i center vertically the text ?

i found how to do it horizontally, but nothing is written for vertical positioning.

thx.

Centering Dynamic Multiline Text
Hello flashers,

I'm having a bit of a problem centering text in a dynamically-instantiated textfield. I assume it's something simple, but google continues to give me the cold shoulder with any answers. :-)

I can physically create a textfield on the stage, that centers without a problem. However, when attempting to mimic this behavior with AS3, I can't get the text to center at all in the textfield:

======================================
var msg:TextField = new TextField();
msg.border = true;
msg.selectable = false;
msg.width = 200;
msg.multiline = true;
msg.wordWrap = true;
msg.autoSize = TextFieldAutoSize.CENTER;

var txt:String = "Here is some text to fill this page";
txt += " and it is not so interesting so I apologize";
txt += "for the boredom!";

msg.text = txt;
addChild(msg);
======================================

Any help would be immensely appreciated - cheers!

Vertical Centering Of Dynamic Text
Hi,

i have a dynamic text object with some text inside.
how can i center vertically the text ?

i found how to do it horizontally, but nothing is written for vertical positioning.

thx.

Vertically Centering Dynamic Text
I am trying to get the text I am loading into a dynamic text box vertically aligned. There are from 3 to 8 lines of text that load into the dynamic text box via an array. I haven't found anything to do this. Can I get a coordinate that tells me the height of the loaded in text? Thanks for any help...

Centering The Text On An Accordion Header
By default, the header text on an Accordion component is left justified. I would like to center it. Can anyone please give me some advice?

Thank you.

Dave

Centering Externally Loaded Text
I have a dynamic text box with externally loaded text. I want the text to be centered in the box but i cant seem to figure it out. im pretty new at this so ive been going through loads of tutorials to get this website up.

so is there a code i need to use for the text box or do i need to put a code on my txt document???


im using this code for the text box:

myLoadVar = new LoadVars();
myLoadVar.load("photos.txt");
myLoadVar.onLoad = function(success) {
if (success == true) {
output.variable = "photos";
output.htmlText = myLoadVar.photos;
}
};

and the instance name for the dynamic text box: output



thanks in advance





www.platinumcollisioncenter.net

Vertical Centering Of Dynamic Text
Hi,

i have a dynamic text object with some text inside.
how can i center vertically the text ?

i found how to do it horizontally, but nothing is written for vertical positioning.

thx.

Vertically Centering Dynamic Text
Hey there!

I have a dynamic text field that is pulling random quotes from a text field. They are populating over a graphic of a customized playing card. Everything works fine, and the text horizontally centers fine.... but it vertically centers to the top of the text box I have drawn.

Is there a way to make the textvertically align in the center? I am just learning actionscript... or re-learing it rather.

Here is the code I am using for the random text:


Code:
ranQuote = new LoadVars();
ranQuote.onLoad = function(success) {

if (success) {

RanNum = Math.ceil(Math.random()*24);
ran = this["quote"+RanNum];
quote_txt.text = ran;

}
else {

quote_txt.text = "The text failed to load due to an error";

}

}
ranQuote.load("questions.txt");
What is the code to align the text vertically? Also, would I put the code in the code above or would I put it elsewhere? Where would I put it?

Thanks!

Centering Text In An Html Enabled Textfield
Anyone know how I can do this? As the textfield is html enabled it defaults to left alignment even if I set it to be centered. I've also tried <center>Text</center> with no success.

Thanks

Centering Html Styl Dynamic Text
I load this in my text field and its left justified but if I view it in explorer its centered. Im sure there is some code to center the text that should probably be places in the load text code.

here is my code

loadVarsText = new loadVars();
_root.org.wordWrap = true;
loadVarsText.load("org.txt");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
org.html = true;
org.htmlText = this.var1;
} else {
trace("not loaded");
}
};

Unicode For Dynamic Text And Centering Tags
I have some pieces of dynamic text brought in from a text file.

I have been using the limited amount of TAGS available but wanted to know if there is a tag that can Center the text. I know i can align the text center from within the .fla but I wanted to break from the left align within my text file to put a few lines center.

Any Ideas?
Mikey

Vertical Centering Text In Multiline TextField
Does the TextField class support automatic vertical centering of multiline text? Any way to control vertical alignment other than "flush top"?

It seems like it ought to, but if there is a method or property in the class that turns it on, I can't find it. (Maybe a case of not being able to see the trees for the forest, there's so much junk in there, plus the TextFormat...)

URGENT: Centering Text On Custom RIght Click Menu
I have this code:

my_cm = new ContextMenu(menuHandler);
my_cm.customItems.push(new ContextMenuItem("The Broken Online Offical Website", itemHandler));
my_cm.customItems.push(new ContextMenuItem("(C) Sebhughes 2005", itemHandler));
my_cm.hideBuiltInItems();

function itemHandler(obj, item)
{

}
_root.menu = my_cm;



And i weant my right to be centered on the Right click on menu, currently it is aligned to the left

URGENT: Centering Text On Custom RIght Click Menu
I have this code:

my_cm = new ContextMenu(menuHandler);
my_cm.customItems.push(new ContextMenuItem("The Broken Online Offical Website", itemHandler));
my_cm.customItems.push(new ContextMenuItem("(C) Sebhughes 2005", itemHandler));
my_cm.hideBuiltInItems();

function itemHandler(obj, item)
{

}
_root.menu = my_cm;



And i weant my right to be centered on the Right click on menu, currently it is aligned to the left

Browser Not Showin All Dynamic Text/Centering Flash Movie
Hi! I got two questions and would be thankful for any help!

1 I've made a piece of dynamic text which looks great on the stage. However, when I preview it only the left side of the box is visible on the screen. If I change the text to static, the whole text is visible, but then again that's not what I want because the text looks blurry and can't be highlighted.

2. How do I assure that the Flash movie is centered in the middle of a web-page? In chose 'center' in the 'flash adjustment' box in publising setting but that didn't do anything as far as I can see...

Thanks beforehand!


Gus

Browser Not Showin All Dynamic Text/Centering Flash Movie
Hi! I got two questions and would be thankful for any help!

1 I've made a piece of dynamic text which looks great on the stage. However, when I preview it only the left side of the box is visible on the screen. If I change the text to static, the whole text is visible, but then again that's not what I want because the text looks blurry and can't be highlighted.

2. How do I assure that the Flash movie is centered in the middle of a web-page? In chose 'center' in the 'flash adjustment' box in publising setting but that didn't do anything as far as I can see...

Thanks beforehand!


Gus

Get RollOver Event On Pure Text Without Having To Convert Text Into Mc Or Bt?
Is there a way of acheiving mouse over (pure) text triggering action?
(Reason: externally loaded text can be made as links and trigger effects on the fly)

I've been through the macromedia actionscript dictionary, the addeventlistener function does not work for me (or maybe i'm just too stupid).

Please DO NOT suggest converting text to movie clip or button if you can't solve my problem. But if you do have an answer, many many thanks in advance.

Rollover Text Change On Engraved Text
hi

im kinda new, i just launched my first site. its a temp site that im working on improving one small thing. please look at my site and tell me how i can make the text change color on the menu bar, but still retain that ingraved look
thanx

Detect Rollover Of Certain Text In Text Field?
Is it possible to detect a rollover of a hyperlink in an html-enabled text field? I'm familiar with the link event of the TextField class to program clicks of hyperlinks, but can anything be done with a rollover?

My intention is to show hint text (glossary term definition) of a term when the user rolls over that particular word (which would be underlined) in a paragraph.

Any ideas, or alternatives?

If I can determine the location of the text (such as a box that defines the regiong on the word), I could maybe add a button over the text... I'm not sure.





























Edited: 02/21/2008 at 02:16:06 PM by srlindberg

Text Rollover In Dynamic Text Field
I've used asfunction in an <a href> link in a text field, but I'm looking for a way to call a function on rollover of certain words in the text.

Is this possible inside Flash without the use of any outside scripts (e.g.: Javascript)?

Thanks!

Text Rollover That Stays With Text
How do you create a rollover hot spot that is linked to a specific text character or word? We have word definitions that appear on rollover in a pop up window. However, our programs are translated, and when the text moves, we have to move all of our rollover boxes. Is there anyway to "attach" the box to the text? Can text be made into a rollover?

Thanks.

Text Rollover (Text Not Clickable, Why?)
Hello,

I have a quick flash rollover question. I have a text rollover in flash but the text is not clickable but the hit area I created around it is. I need the text to be clickable too.

I believe it's some sort of onion skin option that needs to be chosen. I've done it before but I forgot. Please give instructions in the email or send a link. Thanks!!!

Rollover Text
I have a question which i can't seem to find an answer...

I'm wondering... is it possible to change the color of the text using actionscript when you rollover the text? (besides going through the button creation).

Thank you in advance.

Text Rollover
Hello...
I was wondering how to go about creating a rollover state with text, say for a grammar exercise, where the user would be instructed to rollover a particular part of a reading and when they do this a window comes up telling them what part of speech it is.
Thanks for the help...
Raspie

Text/rollover
Well, this links to my earlier post, I'm still trying to get the text to change with the rollover.
I'm pretty sure the code is right, but it just won't put the text there, and I have no idea why.

Any suggestions?

Thanks.

Rollover Text
Hi,

I have parts of a text box that are URL links. How do I make the text change colour when you roll over it. Simple I know, but I'm just a beginner.

Many thanks.

[F8] On Rollover Text
Hello there all.

I wanted to make some dynamic text load when you roll over a button. My script looks like this:

on (rollOver) {
dtext.Text = "Option1 - will take you here";
}

on (rollOut) {
dtext.Text = "";
}

"dtext" is the var name of the dynamic text feild.

The problem is when the file plays "_level0.dtext" shows in the dynamic text field.

And it works when I roll over the button, but when I roll out it doesn’t clear.

How can I fix this?

Thanks,

RSB

Text On Rollover
I want some text to appear on rollover a button.
I know it sounds simple but now I am a little dizzy to think about.
Any useful link?
Thank you.

Rollover Text
Hi,

I have an application which has a button that mimicks the magnifying glass.

I wanted the text "magnifying glass" to appear when user rolls over the button.

Any ideas?.

-sharvan

Text Rollover
I have creaded a flash movie with text links within it. i have made the links clickable. what can i do to make the links change colors when i scroll over them? thanks!





























Edited: 10/26/2007 at 12:46:39 PM by amcdowall

Rollover Text
I would be forever in the debt of whoever helps me with this:

An example of this is near the top of the screen on this website. See at the top there are six icons? If you roll over the mouse, some text comes up and follows the mouse. How do I do this? Please help!

Rollover Text
Hey everyone. I need some help. I want to load dynamic text and then make a rollover link on it like on the gif.
So when you put your mouse over it it will be highlighted with a box. Is it possible to make it easy without adjusting everything manually?
If not please explain what would be the easiest way.
Thx

Text Rollover Problem
I put some text on the stage, convert it to a button... then when I test the movie ... I move to cursor over the text and only the actual letters activate the Button but the gaps in between the text dont cause the button effect .. do u know what i mean ?

Rollover With Text Appearring
im want ing make a nav buttons and when you roll your mouse over the text appears, not before the effect but after
btw im using swish 2

plz respond to this post if anyone knows

Dynamic Text Rollover
Hi,

I made a flash file with some dynamic text wich will contain hyperlinks. Now I want these to change color when you hover over them so I made a button out of the textfield.
When I hover over the BORDER of the textfield it works, but when I hover over the actual link it doesn't...
Why is this

Visible Text Rollover
Hey everyone!

Just a quick question for you. I have a button, that when I roll over it, I want some description text to appear and on mouse out have it go invisible again. I am having a problem formatting the script correctly and I was wondering if you could help me out?

Thanks alot!

Text Rollover Expansion
Hi peeps,

need help, i want to create a series of buttons that list numbers only. When you roll over the buttons the numbers expand into the page name, and when expanding push the other buttons away from the the button the mouse is over.

thanx heaps guys.

Rollover Scrolling Text
Hello,

Can someone tell me where I can find codes to do a rollover scrolling text.

I have a text boxes that import text from a .txt file. Currently I am using a scroll bar, but it is getting in the way. So I want to replace it with a 'up and 'down' button. When the user roll thier mouse over the button the text should start scrolling.


Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved