Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Text Loading & Movie

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IE 11 Flash Player issue 7 242
Updating Flash Player with GPO 3 355
EMET 5.2 / Adobe Flash 2 242
Im getting a black border top and bottom of any you tube videoes I look at. 3 62
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 last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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 what frame rate is, how to control it and what effect it has on the video.

789 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