?
Solved

Is it possible to vertically align text on Flash

Posted on 2008-10-06
4
Medium Priority
?
2,261 Views
Last Modified: 2013-11-12
Assuming I have a HTML enabled dynamic text field can I add text to it and align it central (or middle) vertically?

Thanks,

Mark
0
Comment
Question by:crooksy88
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:cokefour
ID: 22649331
I've had a look and doesn't seem to be a way unles anyone else knows a way round this. Flash is a bit strict with dynamic text boxes.
Have you tried coding it in the html and seeing if you can fool Flash into displaying it as such?
0
 
LVL 18

Accepted Solution

by:
Antonio Estrada earned 2000 total points
ID: 22651853
Not by itself.

I wrote a little function called "verticalAlign". Should work ok.

Check out the <code>.

Or download the *.fla (Flash CS3) from http://vulturous.110mb.com/eefiles/verticalAlign.fla

-V
// --- THIS CODE IS FOR ACTIONSCRIPT 2 --- \\
 
myTextField.text = "This is my text with vertical alignment (sort of anyway).";
myTextField2.text = "This is some other text.";
myTextField3.text = "And this is a very big text!";
 
verticalAlign(myTextField);
verticalAlign(myTextField2);
verticalAlign(myTextField3);
 
function verticalAlign(txtField:TextField):Void {
	if((txtField._height - txtField.textHeight)/2>(txtField._height/4)) {
		txtField.text = newline + txtField.text;
	}
	if((txtField._height - txtField.textHeight)/2>(txtField._height/4)) {
		verticalAlign(txtField);
	}
}

Open in new window

0
 
LVL 13

Author Closing Comment

by:crooksy88
ID: 31503366
That'll do the trick! Thanks
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 22660708
Glad to help!

-V
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question