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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with dynamic text 1

Status
Not open for further replies.

mike101

Programmer
Jul 20, 2001
169
US
I am trying to display dynamic text. It is loading the variable from the text file and the dynamic text has the same variable. In debug it shows that the text file is being loaded correctly. The problem is for some reason it does not show up.

Also, can I use motion tweens with dynamic text (once I get it working that is)? Thanks.

I e-mailed oldnewbie the files I'm using if you want to look at it. Thanks.
 
Did you embed the font used? Regards,

oldman3.gif
 
I did forget to do that. When I embedded it, it didn't help though.
 
Will look at your file.

Do you have your text file up somewhere?
I only got some 4 lines, is that it? Regards,

oldman3.gif
 
Yep, it's only 4 lines, I don't know how to make it a scrolling text box. If you know how to do that, that would help. I haven't been able to find a good tutorial or anything for scrolling text. Thanks.
 
Ok! Will look into your file...

Are you on 5 or MX? Regards,

oldman3.gif
 
Ok! Unless you decide to use LoadVars() as described in my links (IMHO, much better than loadVariables), here's what you should do.

Give an instance name to your Symbol 1 clip, in the movie clip's properties. I gave it the instance name of "interface" and changed your script to this:

loadVariables("upcomingevents.txt", "_root.interface");

And the text does show up.

Of course, you might need it to scroll. Want me to set it up for you, or do you want to try it yourself for a while, based on thoses links? Regards,

oldman3.gif
 
I tried to do the loadvariables thing like you did but for some reason it didn't work. Can you send me your modifications so I can see what you mean? I think I'm interpreting what your saying wrong. I will try to figure out how to do the scrolling though. Thanks.
 
Thanks. How did you give Symbol 1 an instance name? I know how to convert to symbol. What's different about instance? Cause with convering to symbol I can never modify it. Thanks. Also, is there a way in the text file to make it where you can make certain words bold? Finally, can I make it in the text file with a space between the 2 dates/events in that text file, but not a space that's a full text height? Thanks. I'll try messing with the scrolling part now and see how it goes.
 
When you create a new symbol, you usually give it a name, renaming it from the default Symbol 1, Symbol 2, etc... That's it's Library name. You can drag several instances of this one movie clip on stage, but to control each one of them seperately, you need to give each one of them an unique instance name. You select an instance, and in the properties window, give it a name in the instance name box, just under the Movie Clip box.

You can make words bold when the text is html formated...
Second half of the second link I posted. Although I've never tried it, you could maybe change the space height between 2 lines, by changing the font size, but as I say, I've never tried it.

Please note, that when you add a carriage return in your text file, that will double the empty lines in the display. Usually the text is type in one continuous line. Regards,

oldman3.gif
 
I went to that tutorial and tried to add the scrollbar but it's not working. I e-mailed you the file again. Thanks.
 
loadVarsText = new loadVars();
loadVarsText.load("upcomingevents.txt");
loadVarsText.onLoad = function (success){
if (success){
trace ("done loading");
upcomingevents.html = true;
upcomingevents.htmlText = this.var1;
}else{
trace ("not loaded");
}
};

Notice var1 up there. That's the name of the variable that must start off your upcomingevents text file. You can use something else like "loadText" or whatever... As long as it appears exactly the same up above and in the text file itself.
Suggest you don't use the same name as the textfield's instance name (upcomingevents), or that will get you in further troubles.

For the moment just change the variable in the text file to var1=..., and it will work fine. You might need to add a few carriage returns after Houston Trips in order to see all the text, but that's another question. Regards,

oldman3.gif
 
Thanks again, I got that to work but I'm having a problem with the scroll bar movement. I sent you an e-mail if you get a chance to look at it. Looks like we're nearing the completion of this animation/menu! :)
 
Can't do it that way Mike! You would either have to put all of those elements (textfield, title & scrollbar) in one movie clip, and tween this whole movie clip in place. In that case you'll also have to change the path to your textfield in the LoadVars() object. BTW, you haven't listen to me and have use the same name for the variable and the textfield names, that will get you in trouble. You also have a few missing ";" in there!

Or you could leave the scrollbar at it's ending position, make it invisible to start with, and then when the textfield is in place, make the scrollbar visible. Regards,

oldman3.gif
 
Now I'm really going to bed... Big long day tomorrow and won't be much around here... That'll make Bill happy, I'm sure! [tongue] Regards,

oldman3.gif
 
Ok, I will modify the variable name. Can I modify the movie clip once I make it? I haven't messed with them at all. Thanks. Hope you're having fun working lol.
 
You can edit any movie clip, anytime!

Now I do have to get back to my day job! Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top