Solved

Is it possible to vertically align text on Flash

Posted on 2008-10-06
4
2,259 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 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

730 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