Solved

Text Loading & Movie

Posted on 2004-03-22
5
165 Views
Last Modified: 2010-04-03
I know this one has been asked a buzillion times but all the post and references are confusing me.  I'm using MX 2004.

What I want to do is have a movie that contains a combo box (instance = pick_student).  Once an item is selected on the combo box, another movie (some swf) pops up in a container(initial_movie). I also want a selected text file (some text file) to load into a dynamic text container (instance = in_poem_text).

I'm not having any problems on the video but the text is driving me nuts.  Here's what I have on the combo box and I get no change in the in_poem_text instance but it throws no error and any traces don't produce the new text.  The in_poem_text instance is set to "dynamic text" with no variable name.  The txt file is formatted without any declarations or delimiters.

on (change) {
      hit_value = _root.pick_student.getValue();
      if (hit_value == "student1"){
            loadMovie("poem_student1.swf", _root.initial_movie)
            get_external_text = new LoadVars();
            get_external_text.load("student1.txt");
            get_external_text.onLoad = function(success) {
            in_poem_text.text = get_external_text
            }
            }
      else if (hit_value == "student2"){
            loadMovie("poem_student2.swf", _root.initial_movie)
      }
      else {
      }

}
0
Comment
Question by:skibama1
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:RedLava
ID: 10654860
Hi hating_it,

Have you set the textfield to use embedded fonts?

RedLava
0
 
LVL 1

Author Comment

by:skibama1
ID: 10656418
How is that going to help?
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 10658001
maybe you are having problems with your LoadVars()

try this:

get_external_text = new LoadVars();
get_external_text.onLoad = function(success) {
    in_poem_text.text = get_external_text
};

get_external_text.load("student1.txt");


you need to always have your onLoad function before your load  code...  

this might not be the problem, but it is worth trying...

rp
0
 
LVL 1

Author Comment

by:skibama1
ID: 10664386
That didn't work, but I keep seeing some references about the txt file being in a certain format.  I guess what is confusing me is that it seems like you would call the txt file into a variable and then set the instance (if text) to equal that variable but using LoadVars as an object is throwing me.
0
 
LVL 22

Accepted Solution

by:
rascalpants earned 125 total points
ID: 10672592
I am not really understanding you...  but try this code instead of what you have:

get_external_text = new LoadVars();
get_external_text.onLoad = function(success) {
    in_poem_text.text = get_external_text.in_poem_text;
};

get_external_text.sendAndLoad("student1.txt", get_external_text, "POST");


I don't even fool around with "load" anymore, because I typically end up changing my code later anyway...

the above code will pull the variable "in_poem_text" from the  student1.txt  file...   this is how that text file should be set up...

in_poem_text=This is the text that is in the Poem.  I like cheese.&


If you are loading in more than one variable, then just set those up in your onLoad area just like I have for the single variable...

if you have a lot, then you should use sequential variables along with a for()  loop...


let me know if you need more help...

rp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Flash media server 1 326
How do I change text in a Flash (FLA, SWF) file? 3 977
How to convert pdf file to html file 8 388
Adobe Flash player - Microsoft Edge 9 157
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now