Solved

Text Loading & Movie

Posted on 2004-03-22
5
164 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

747 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

11 Experts available now in Live!

Get 1:1 Help Now