Flash Geniuses..unwanted code appears in my text field

I used the Kirupa tutorial on loading text in a flash file dynamically from a txt file and after my txt file displays in flash it is followed by unwanted html code that it displays for some reason. I can’t figure out why it is doing this so if anyone knows how i can fix this please let me know… If you want to see what I am talking about, it is at:
http://snow.prohosting.com/solrise
click on a picture and scroll to bottom of text

THanks,
Ter

let’s see your txt file. and maybe the code that parses the txt file would help too.
:slight_smile:
jeremy

the actionscript I use is the following:

loadText = new loadVars();
loadText.load(“bios/david1.txt”);
//creating the loadVarsText function
loadText.onLoad = function() {
scroller.text = this.davidtext;
};

it’s calling up a .txt file from the server which is on a dreamweaver page which contains the following:

davidtext=texthereandhereandhereandhere

this is your problem:

Flash does not support anything beyond HTML 1.0 which is pretty much just basic font manipulation, links and emails. ie. you can do coding that deals with font size style face etc, but nothing beyond that… your text file should not contain anything beyond things like this:


myText=<FONT SIZE="15"><B>COMPANY PERSONNEL</B></FONT>
<FONT SIZE="14"><B>Corporate Office / Warehouse</B><BR>International Importers, Inc.<BR>5221 S. Millard Avenue<BR>Chicago, IL 60632
General Office: Accounting, Inquirers, etc.<BR><A HREF="MAILTO:iii5221@intl-importers.com"><FONT COLOR="#0000ff"><U>iii5221@intl-importers.com</U></FONT></A>...

Just a little part of a text file loaded into one of the sites I’ve done.

Hope this helps… let me know if you need anything else.

Peace

Hey I appreciate your replys. I still can’t figure out why flash is displaying the extra code because the text file contains only an equals statment and the text which is plain. It appears that flash is reading and displaying the code of the banner which the prohosting site puts on the page. Any ideas on what I can do to have it not read that?

thanks:)

hmmmm… well if there is any way you can get your hosting to remove that code - because as long as it is auto coded into the txt file, flash will put it in as stuff it thinks you want people to see. Paying for your own server would be the easiest and best fix… who is the pre hosting service? Maybe we can find a work around…

we could try this too… post your txt and I’ll post it on my own server then you could update your AS code to load the txt file from this location:

http://www.grafikdesigns.com/tryText.txt

Peace

the last option would at least let you know that the only prob is your hosting service…

Peace

That sounds like a good idea. I appreciate that. I’ll attach the david1.txt file to this post.

Would the updated actionscript I write to call david1, for example, look like the following:

http://www.grafikdesigns.com/tryText.txt/david1.txt
or
http://www.grafikdesigns.com/david1.txt

thanks a ton.
ter

the second one would do it

Peace

ummmm… I dont see the text file attached?

Peace

Hey, I’m not sure why the txt file did not attach. I’ll just give you the david1.txt file here. It is as follows:

davidtext=Two friends influenced my life in music. The first was a longhaired, hippie art student who sat outside on steps and street corners playing the blues from his heart. This was a release that I had wanted and needed for years.
The second friend, who influenced my life in more ways than one, was a mission trip leader, who made his own praise songs. The music he sang poured out of him so naturally and frequently that it was just a part of his personality.

I guess if I could honestly say what I am inspired by, it would be summed up in three words: encompassing, powerful, and sublime.
Everything from art masterpieces, powerful bass notes, break dancing, or just people empowered by God have been an obsession in my life.


I appreciate it
Ter:)

Hey ter…

The problem as I see it is that you are using HTML and Javascript tags ect.

You can HTML enable your textbox to accept html formatted text such as using bold tags, italics tags, font color tags, link tags, etc.

But what you are doing is including your javascript items for a pop up window, which should be included in between the head tags of the html page your movie is in.

So you can’t use Noscript tags, or table tags, or Script tags. Just font formatting tags.

To HTML enable your text box you can do this…

loadText = new loadVars();
loadText.load("bios/david1.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
<B>scroller.html = true;</B>
scroller<B>.htmlText</B>= this.davidtext;
};

Thanks for your help. I HTML enabled the script and it works now. yeah!

:slight_smile: :slight_smile:

No problem :slight_smile: Glad I could help.

whops… I just assumed you HTML enabled it and your server was addding some code flash didnt understand - jeez its always the little things I miss - infact today I found what was wrong with a PHP/Flash issue thats been bugging me for a few weeks… and I found it as I was posting the code for someone to review - there was nothing wrong with the code - EXCEPT that I was neglecting to call an entire function I wrote before submitting the vars!!! grrrrrrr:bad: - but I had to laugh. :stuck_out_tongue: <:}

Peace

hey I appreciate your help bro. I’m still learning the ropes of flash and its cool to get this kind of help.

I know this a dumb question, but what is the command for loading an swf into an swf upon entering a frame?

I use the following code on a button to load a movie but I forget the syntax to load a movie upon entering a frame.

on (release) {
loadMovieNum(“photos.swf”, 1);

thanks
Ter

Right click on the frame and choose “Actions” to open the Actions panel.

Add this…

loadMovieNum(“photos.swf”, 1);

Tah Dah :slight_smile: That is all there is to it.

Ryall: I know what you mean. I spent a week writing a function in Javascript and could not for the life of me figure out why the overall thing wasn’t working. Turns out, I spent all that time writing the function, but I forgot to call the function in the script…LOL! I felt stupid, but I couldn’t help but make fun of myself.

OMG adding the call to the function didnt fix it!!! I am STILL missing something - grrrrrrrrrrrrrrr this is driving me nuts! esp since it is soooooo basic - maybe I’ll post my code again ina new thread :sigh:

Sheesh

Peace

If it is PHP and Flash, h88 should be able to help no problem.

I don’t work serverside Flash so I have no clue.