?
Solved

Refreshing a movie clip

Posted on 2004-10-05
11
Medium Priority
?
206 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
[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
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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…
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 how to record live broadcast.
Suggested Courses

764 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