|
-
Hiho,
I'm sitting here, working on my first homepage build
with Flash and I've got a problem that's drivin' me nuts!
I've got an animation, within it theres a dynamic textfield called
"text_box" - with actionscript text is being loaded into the fieldvariables
and with a nice script I can "flip through pages" within the textfield.
Of course, this script is not my invention, I'm not good at scripting,
instead I'm using the free scrollbar from this site:
http://homepage.ntlworld.com/andy_bl...ash/scrollbar/
You can download the fla for the scrollbar from there.
Now here's my prob:
You can "flip thorugh the pages" with a button, the script
used is mainly:
function on_release(){
// Actions to occur when button is released
_parent.text_num = (++_parent.text_num == 5 ? 1 : _parent.text_num);
_parent.text_box.scroll = 1;
_parent.text_box = _parent["text_box"+_parent.text_num];
But now I dont want to define the text within the "pages" through
vars, like it's in the scrollbar script;
text_box1 = "...";
text_box2 = "...";
text_box3 = "...";
text_box4 = "...";
text_box = text_box1;
text_num = 1;
I want to load the text from txt-files, like:
text_box1 = loadVariables("loadtext.txt", newstext);
This is working great for page 1, but I dont get it to load
the txt's to the other pages - the pages remain emty
HTML tags arent supported neither
I hope I discribed the problem properly, forgive me my english,
actually I'm from Germany.
I would be REALLY glad if someone could help me here, I'm really stuck
Faeroon
PS: I'm using Flash MX
-
This is working great for page 1, but I dont get it to load
the txt's to the other pages - the pages remain emty
HTML tags arent supported neither
if page 1 works how are you loading the variables for the other pages, ie what are you doing differently ?
also your text boxes need HTML turned on to display html.
hope that helps.
-
Thx gaz for the html hint, but I got 2 other questions
and maybe I can solve the prob after that.
1.)
How do I call functions inside of vars?
Would it be something like:
text_box1 = "asfunction:load_file,text1";
or
text_box1 = (asfunction:load_file,text1);
or
text_box1 = asfunction:load_file,text1;
etc. etc., I'm really stuck here...
The function should be loaded as soon the var is accessed.
and question nr. 2.)
People talk of things like
_root.newstext.htmltext="load "+file+".txt";;
But what if the "newstext" called textfield lies within
the MC News_test in the szene News_Layout - how should
the script be written?
_News_Layout.News_Test.newstext.htmltext ????
If someone could answer me those two questions I
would be glad.
-
one way to find a path is to use the "insert a target path" button on the actions editor (bottom right corner circle with cross inside).
path example
if you have a movieclip on root with instance name "mc" then to access it you can use:
_root.mc
and if you have a movieclip inside _root.mc with instance name "mc1" then to access it you can use:
_root.mc.mc1
and if you have a textbox inside _root.mc.mc1 with instance name "txt" then to put text into it (in MX) you can use:
_root.mc.mc1.txt.text="my text";
or for HTML you can use:
_root.mc.mc1.txt.htmlText="<B>my text</B>";
you can use asfunction to make hyperlinks inside textboxes that call ActionScript functions when clicked.
example here: http://board.flashkit.com/board/show...hreadid=353487
hope that helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|