Solved

Refreshing a movie clip

Posted on 2004-10-05
11
201 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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 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.

867 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

15 Experts available now in Live!

Get 1:1 Help Now