Solved

Refreshing a movie clip

Posted on 2004-10-05
11
202 Views
Last Modified: 2010-04-03
Hi,

I've got a movie clip with several embeded movie clips.  In the top level clip, i want to reference one of these embeded clips(possibly 2 levels down), edit a textinput component's text property, and change the frame being shown.  This is all happening properly except the page isn't being refreshed to show the text in the input box.  I know it's being set correctly through tracing out the text property of it - it's just not refreshing the display.

Any help is greatly appreciated.
0
Comment
Question by:b4tch
11 Comments
 
LVL 10

Expert Comment

by:muso120999
ID: 12229937
Can you show an example of what you mean?  Ideally an FLA if possible.
0
 

Author Comment

by:b4tch
ID: 12230396
I've uploaded an example at http://www.boredatuni.com/refresh.html
from which you can also download the fla.  I *think* i may be referencing the text box incorrectly, although I don't know how.

Thanks for your time
0
 
LVL 10

Expert Comment

by:muso120999
ID: 12230462
I'm afraid it's because you dont have the text component:

mc1.mc2.tb_txt

on frame 1 of your movieclip.  You can't reference it otherwise.

The best you can do is to hide it (or the mc it's in) until it's in the state that you want it to show.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 4

Expert Comment

by:Drakkon
ID: 12230560
The reason the fla you posted isn't working is because your setting the value BEFORE the movive clip has been loaded. For example put a trace("1"); in your mc2 on frame 2 and a trace("2"); on the first frame of the root movie after the gotoAndPlay(2); . In your output you'll notice that it puts a 2 before it puts a 1.

To fix theres a wide range of solutions. Possibly on mc2 when it reaches frame2 call a function that places the word "test" in the box, or on load the text gets loaded in. The input box isn't instantiated until the movie gets to that frame and thus since it goes to the next command before even getting to frame 2 it can set an object with that variable but it can't exactly process that data into the textinput because it doesn't exactly "exist" yet.
0
 
LVL 10

Expert Comment

by:muso120999
ID: 12230585
I forgot, I also changed the code to:

myStyle = new TextArea.StyleSheet();
myStyle.load("styles.css");
myStyle.onLoad = function(success) {
      if (success) {
            trace("loaded");
            TextHolder.styleSheet = myStyle;
      }
};
thisText = new LoadVars();
thisText.load("example.txt");
thisText.onLoad = function(success) {
      if (success) {
            TextHolder.text = thisText.myText;
      }
};


but my statement above still stands
0
 
LVL 10

Expert Comment

by:muso120999
ID: 12230617
D'oh - ignore my last post, as it's strangely irrelevent.  Brain isn't working
0
 

Author Comment

by:b4tch
ID: 12230816
thank you both for your input.  Now i've learnt that it's not working because the text box doesn't actually "exist" when i'm trying to populate it, i think i will use the setInterval method to put the text in the box (just a first attempt, i may decide on another way later)...

mc1.mc2.gotoAndStop(2);
a = setInterval(addText,200);
function addText() {
      mc1.mc2.tb_txt.text = "TEST";
      clearInterval(a);
}
0
 
LVL 10

Expert Comment

by:muso120999
ID: 12231014
Looks like a decent solution to me - I hadn't noticed your gotoAndStop, so I didn't get to the crux of your problem
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 13264378
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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 found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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 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.

831 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