Solved

Can you control how Flash loads dynamic text?

Posted on 2004-04-11
4
233 Views
Last Modified: 2008-03-06
Hi,

We are loading in dynamic text created in Notepad. We are finding that when Flash loads it into our tutorial, it changes the spacing, somewhat, of the text. For example, the Notepad file will show a sentence with all the proper spacing between words (one space between each word) but when it shows in our Flash piece, Flash will add an extra space before one of the words, thus making it look like we typed an extra space when in fact, we did not. It doesn't happen on every line of text but does on at least one or two. The extra space is noticeable. Yes, we can go in and alter the Notepad file by adding an extra space before a word so that Flash makes it look okay,however, that can present problems for modifying text later. We'd rather not have to do this. Can anyone explain why Flash does this and if there is something we can do about it?

Thanks
0
Comment
Question by:mmichelep
  • 2
4 Comments
 
LVL 23

Assisted Solution

by:Zeffer
Zeffer earned 25 total points
ID: 10803313
using Mime Format is the way to deal with this.. + denotes a space..eg

Here+is+a+sentance+which+will+come+out+exactly+as+I+want+it+to.

for line returns use...  %0D%0A

Z
0
 
LVL 9

Accepted Solution

by:
krishnaprathab earned 200 total points
ID: 10804476
Hi,

I dont know why this is happening , try putting the text inside quotes. If that doesnt work use the below function on you string variable which will trim away extra spaces in the text.

myText="this is a  test text where iam using  this is a  test text where using  ";

String.prototype.trimSpaces = function()
{
      tempStr = new String();
      var i = 0;
      do
      {
            if (this.substr(i,1)==" " && this.substr(i+1, 1)==" ")
            {
                  i++;
            }
            tempStr = tempStr + this.substr(i,1);
            i++;
      } while(i<=this.length);
      return(tempStr);
}

myText = myText.trimSpaces();

Hope this helps !

Thanks,
KP
0
 
LVL 1

Assisted Solution

by:pcazella
pcazella earned 25 total points
ID: 10810009
Try setting the properties of the text field to display it as HTML.  As you know, HTML will only see one space...
0
 
LVL 9

Expert Comment

by:krishnaprathab
ID: 10824861
Hi,

Did my reply answer your question. If so please close this question or if you need some more help on this feel free to ask.

Thanks,
KP
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now