Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Is it possible to vertically align text on Flash

Posted on 2008-10-06
4
Medium Priority
?
2,263 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

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

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

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to Import and export files in WordPress. 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 : Click on Too…

598 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