Indigo Rose Software
  #1  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Flash MX 2004 related...

I am working on a Web site, which contains some Flash MX 2004 components.

Now, what I am doing is using loadVariablesNum to load in a text (.txt) document.

No problem there. It works like a champ!

The setback is that when the data (from the .txt) file is loaded into my TextField Object... the line spacing is "double-spaced". Now, before you ask (a good question no less) if the data in the text (.txt) file is single-spaced, it is.

But, because this data is dynamically set I have used the property of the TextFormat class below:

myFormat_fmt.leading = n; (where n = (various numbers I have tried).

Now, I know that the Flash MX 2004 (Help) documentation says that .leading has to be a positive number and thus I am seemingly out of luck?

Short of creating several TextField Objects (uhg...), do any of you Flash MX 2004 gurus have a workable solution you care to share?

I would be very appreciative of such!

Thank you in advance,
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #2  
Old 12-19-2004
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
My guess is that you are accidentally using device fonts. Make sure to include your font by unchecking "Use Device Fonts" (in the properties palette with the text object selected) and you should be fine.
Reply With Quote
  #3  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
I was using a device font.

However, here is what I have now (and I know the colors are ugly, this is a test only) and still no go (though I embedded my first font!):

Code:
/*
This is a Flash MX 2004 based code chunk.
The code works for the most part, until
I tried to set the 'leading' to get a
"singled-spaced" looked for the dynamically
loaded text (.txt) file.  So, as of now,
my project is stuck with "double-spaced" text
in the Dynamic TextField Object.
Any ideas?
*/

loadVariablesNum("load_text.txt", "0");
load_btn.onRelease = function(){
	display_txt.text = TXTpage;
};

display_txt.borderColor = 0xff0000;
display_txt.background = true;
display_txt.backgroundColor = 0xffcc00;

myFormat_fmt = new TextFormat();
myFormat_fmt.font = "Font1";
myFormat_fmt = 36;
myFormat_fmt.leading = 5; // not working!  Ack!  Glitch?  What about negative leading?
myFormat_fmt.blockIndent = 10; // Also not working!
display_txt.setTextFormat(myFormat);
It's still not showing singled-spaced though.

__________________
Intrigued
www.amsuser.com
Reply With Quote
  #4  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
(removed) I see you edited too. D'oh!

Corey thanks for helping me by the way. This is driving me to drink bottled water tonight!
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #5  
Old 12-19-2004
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Hi. I made a mistake, device fonts is for static text. Ok make sure you have your text set to "Dynamic Text" ("device fonts" option will disappear) and then click on the "Character" button and embed the outlines for the font characters you need. That should do it. Works fine here. If it doesn't work for you I suggest starting from scratch and eliminating any code you are using to attempt to format the text field...
Reply With Quote
  #6  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Ok, after your first reply, I added in the Font1 (font) and did the Linkage on it. Next Iclicked the Character button in the Properties Inspector and selected the first four (upper, lower, num, punct.) and then OK'ed the dialog.

The font's show up ok... it's just the spacing still.

I will now go and do as you suggested, start from scratch.

Thanks for your help Corey nontheless!



Sincerely,
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #7  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Same situation after a "from scratch" Corey. (just an update).

I'll try Google'in my way to an answer.

Thanks again for taking a moment or two to work with me on this Corey.

__________________
Intrigued
www.amsuser.com
Reply With Quote
  #8  
Old 12-19-2004
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Here's a working example attached, perhaps that'll help...
Attached Files
File Type: zip loadText.zip (12.7 KB, 15 views)
Reply With Quote
  #9  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Thanks Corey!

It's got to be something simple.
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #10  
Old 12-19-2004
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
No problemo muchacho. Try using Flash.SetVariable from AMS too if you ever need to set text in Flash dynamically within an AMS project.
Reply With Quote
  #11  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Cory, thank you!

Your version works for me and I then started to compare.

Two things I found (not sure just yet which was the culprit):

1. I had (from another test) 'Render text as HTML' still clicked in the P.I. (D'oh!)

2. I had this variable being used in the text file, TXTpage. Would the 'TXT' confuse Flash maybe?

Corey, the bottom line is that you helped me to solve this dilemma of sorts!

Thank you very much!


Create and put for sale those Flash Training CDs soon please! I did just buy some off eBay recently but, I would like to see more of your (I like your offerings for various reasons) training with regards Flash MX 2004!

Sincerely,
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #12  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Quote:
Originally Posted by Corey
No problemo muchacho. Try using Flash.SetVariable from AMS too if you ever need to set text in Flash dynamically within an AMS project.
Thanks for that tip!

I am close to putting into action the FSCommand training I reaped from your Speedy Traning CD#3 the Advanced one, very soon on several small Flash files!

Sincerely,
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #13  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
NOW, when it is all said and done I believe I found the culprit.

I noticed just now I had 'Wordwrap' on in my text editor. When I turned that off while viewing your text file I see you chose to put all of the data on one line.

Ah!

I remember reading a few days ago that Flash can have problems reading data in a text file that is on seperate lines! (where variables are concerned anyway)

*So much to remember.

*And time for a ... Whewwww. *Shoulders slumping in a relaxive manner.

__________________
Intrigued
www.amsuser.com
Reply With Quote
  #14  
Old 12-19-2004
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
No problem. Yes I will make some training CDs for Flash. I believe they wil lbe better than the existing stuff because I will approach it from a usability standpoint, not as a purely technical exchange. Anyhow I have to write the certification exam first which means I have to study but it's been way too busy behind the scenes here at IR lately for that. I should have my first "certified" Flash CD out for about spring realistically. The Flash developers study guide is tough stuff, it's not going to be as easy as I'd hoped.

Apaarently the failure rate for the Flash MX2004 developers exam is around 40%...
Reply With Quote
  #15  
Old 12-19-2004
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Well, I wish you the best on the Certs!

And I'll keep my eye pealed for those Flash CBT CDs this spring'ish!

Thanks,
__________________
Intrigued
www.amsuser.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New book - Flash MX 2004 arrived! Intrigued General Chat 1 10-06-2004 05:26 PM
Winners from Flash Forward 2004 NYC Corey General Chat 0 08-17-2004 11:52 PM
Flash MX 2004 Corey General Chat 13 09-16-2003 05:15 AM
lowest flash version LegoGirl AutoPlay Media Studio 4.0 13 07-31-2003 07:04 AM
HOWTO: Install the Flash Player from a CD-ROM Support AutoPlay Media Studio 4.0 Examples 0 10-29-2002 05:05 PM


All times are GMT -6. The time now is 06:19 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software