Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scroller woes 1

Status
Not open for further replies.

Wulfgen

Technical User
Dec 31, 2004
283
US
Hello All,

I have a static text field with a variable name of "news" in the center of my document window, this has two scroll buttons attached and they scroll the text up/down quite nicely - however the only way I can get the external file called text.txt to load is to attach this code to a button


Code:
on (release) {
	loadVariablesNum("text.txt", 0);
	_root.news = "One moment - I'm loading ...";
}

Is there a way to have the text.txt automatically load to the text field (var "news") other than by the button method I'm currently using - I tried to get it with enterframe - onload - setvars - onClipEvent (enterFrame) - what am I doing wrong here. This seems pretty straight-forward, but I'm not doing something right.
 
I guess you meant a dynamic textfield rather than a static one... Or how did you manage to load a text file in a static textfield?

BTW, text is a reserved word in Flash, you'd be better off using text1 or myText as your text file's name and yet something different for your textfield's instance name, if using one.

Sure it's possible to directly load a text file in a textfield, and the easiest is to use the LoadVars() object, rather than loadVariables.

What version of Flash are you running?

Can you possibly post a link to your .fla and text file, zipped up?

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Yes.. how're are ya do'in. tried to contact you awhile ago, but.... nayway here is the text file contents -
+++++++++++++
Code:
news=Latest News from the Lab.....
--------------------------------------------
Link placement: <a href="[URL unfurl="true"]http://www.asite.com"[/URL] target="_blank">
DiTeam</a>
--------------------------------------------
Email placement: <a href="mailto:info@asite.com">
my info</a>
-------------------------------------------- <b>
bold italics</b> <i>
Italics</i> <u>
underline</u>
-------------------------------------------- <font color="#FF0000">
blue</font> <font color="#0000FF">
green</font> <font color="#008000">
yellow</font> <font color="#FFFF00">
maroon</font> <font color="#660000">
------------
These rows of text can be written directly with notepad, therefore a minimum of acquaintance of the HTML is presumed, otherwise, open the rows with a HTML editor, modifying the extension momentarily they even give.txt to.htm and to insert the intentional parameters. Always remember that to the beginning of the text it must be inserted variable "news =" otherwise the news var? will not load.
+++++++
 
Nope, I've got this working from MX to ...? Is there some form of "this wont work in newer versions that I'm not aware of?
 
No, if you use loadVariables and publish for the Flash 5 player, it would still work even with Flash 8...

But I was going to suggest using the LoadVars() object rather than loadVariables and that won't work if you have to publish for the Flash player 5.

It will only work with the Flash player 6, 'cause it uses the textfield's instance name to display the text (rather than a variable in the Var box...), and that feature is not available in the Flash 5 player.

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
So is there a way then..., that the buttons behaviour be triggered with the onload? _ this is a neat scroller as it supports links, text sizes, colors etc, etc. I hate to let it go by the wayside.
 
No my question really is... Do you have to publish for the Flash PLAYER 5, or can it be published for the Flash PLAYER 6 & up.

In other words, if you have to publish this movie so that users that only have the Flash player 5 browser plug-ins can see it, then you cannot use the LoadVars() object, which I'm suggesting you use rather than the loadVariables action...

This has nothing really to do with the scroller itself, it only concerns the actual loading of the text file, and the LoadVars() object does it better!

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
I would like it to be useable not matter what version of the player someone has - btw... why would someone have a older version of the player when the ability to upgrade is so easy...oh well. Preferably 6 and up
 
Varscroll (LoadVars) will work fine four player 6 and up...

Varscroll (loadVariables) works fine from player 5 and up, locally at least. Online, you may have lag time, and the text won't appear, if you don't insert the loadVariables in a loop, checking for a last added extra variable.


Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
You saved my bacon again, my man! - Gave you a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top