PDA

View Full Version : Getting text from an html document


PCoop
08-20-2003, 04:47 PM
Ive just done this tutorial to get a scrollbar in my flash site,

http://www.flashkit.com/tutorials/Interactivity/Useability/Make_you-Vera_Fle-750/index.php

To get text on my site i have to write it in the actions window, i was wondering how i would go about getting the text to come from a html file or txt or something that is quite easy to edit.:D


Any help appreciated.

Billy T
08-20-2003, 05:37 PM
bit old now but anyway...

http://www.tableau.com.au/tutorials/load_text_tute/

(remember to search)

cheers

PCoop
08-21-2003, 05:07 AM
cheers mate,

just had a go and came across a problem, my textfield is in a movieclip although it tells me how to do it if the textfield is in a movie clip, my n00b ass still gets it wrong :D




my_text = "";
showText(my_text);
stop();

button1.onRelease=function(){
loadVariablesNum ("contact.txt", "_root.main");
}


thats the code i have in my actions layer.

any ideas?

Billy T
08-21-2003, 05:09 AM
loadVariablesNum is for loading into a level

use loadVariables

cheers

PCoop
08-21-2003, 05:11 AM
thats the baby :)


nice one

PCoop
08-21-2003, 05:20 AM
uh oh!


Now my Scrollbar isnt working :D


Just cut out my load vars code, added some text in the mytext bit to test to see if the scrollbar was working and it is, so im getting i need to embed the load vars code into the mytext="." somehow.

Billy T
08-21-2003, 05:30 AM
try reseting the scroll target of the scrollbar after the text has been inserted

PCoop
08-21-2003, 05:32 AM
function showText(message) {
main.w_field.text = message;
if (main.w_field.maxscroll > main.w_field.scroll) {
main.gotoAndPlay("scroll_loop");
}
}


you mean this?

Billy T
08-21-2003, 05:39 AM
I dont know what that's doing

are you using the scrollbar component?

cheers

PCoop
08-21-2003, 05:47 AM
I created the whole scrollbar myself, well using the tutorial in the first post :).

To get text into the flash i have to write it in actions here:


my_text = " ";



When theres too much text for the text field the scrollbar will then appear enabling scrolling tracking and usage of the thumb.

Billy T
08-21-2003, 06:11 AM
right ok

well you need to check the maxscroll etc after the text has loaded and been inserted into the text box

cheers

PCoop
08-21-2003, 06:22 AM
I input plenty of text into the txt file to make sure it would be enough to create the scrollbar

If i remove either the scroll bar code or the loadvar code the other will work, they just refuse to work together :D

Billy T
08-21-2003, 06:32 AM
maybe you should up the file

cheers

PCoop
08-21-2003, 06:56 AM
mind if i email it? my host is down and its too big to attack here.

Billy T
08-21-2003, 07:02 AM
sure - billy@__REMOVE_THIS__tableau.com.au

Billy T
08-21-2003, 07:16 AM
are you publishing as flash 5 or 6?

Billy T
08-21-2003, 07:20 AM
forget that last question

try changing the button action to this

button1.onRelease=function(){
myVars=new LoadVars();
myVars.onLoad=function(ok){
if(ok){
showText(this.myText);
}
}
myVars.load("flash.txt");
};

cheers

PCoop
08-21-2003, 08:34 AM
Sorry for the late reply got called away to do something.

Thats done it nice one mate :)



thanks alot for the help

Billy T
08-21-2003, 09:38 AM
no worries

would be worth having a read of the LoadVars tute on this site

cheers