Solved

Text Loading & Movie

Posted on 2004-03-22
5
169 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
[X]
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
  • 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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
Need real time currency converter sample code from other currency to USD in flex. 1 456
Failed download 57 593
Removing Flash from Website 6 78
Running Mp4 or Flash Video 1 148
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.
Suggested Courses

734 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