Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-03-2009, 10:21 PM   #1
katiekatie
Registered User
 
Join Date: Nov 2009
Posts: 1
Default Telling dynamic text to update

From my main timeline actions, how can I tell a dynamic text box inside a movieclip to update?

I have a movie clip with the dynamic text box called catalog. The instance name for the text box is catalogtext. On the main time line, I am using a loop to repeatedly attach the catalog movie clip. I want the dynamic text to show the value of i, and each time the movie clip is reproduced, increase by 1 each time.

Here is my current attempt:

for (i=1; i<=9; i++) {
container.attachMovie("catalog","catalog"+i+"_mc", i+200);
mycatalog_mc = container["catalog"+i+"_mc"];
mycatalog_mc._x = (i-1)*myThumb_mc._width;
mycatalog._y = (Stage.height-myThumb_mc._height)/2;
this["catalog"+i+"_mc"].catalogtext.text = i;



Everything works fine, but the text box won't show the value of i. I must not be calling it correctly?
katiekatie is offline   Reply With Quote
Old 11-03-2009, 11:47 PM   #2
flyingchalupa
Member
 
Join Date: Nov 2004
Posts: 94
Default

try:

ActionScript Code:
for (i=1; i<=9; i++) {      var mycatalog_mc = container.attachMovie("catalog","catalog"+i+"_mc", i+200);      mycatalog_mc._x = (i-1)*myThumb_mc._width;      mycatalog_mc._y = (Stage.height-myThumb_mc._height)/2;      mycatalog_mc.catalogtext.text = i; }

Might as well keep the same reference to the movieclip throughout, no sense changing it to target the textfield... If you can position the x and y coordinates, you should be able to target the textfield with the same var.


Or just change the *this* to be *container*... As that is where the movieclip is...
flyingchalupa is offline   Reply With Quote
Old 11-03-2009, 11:48 PM   #3
loadlearn
Flash Nerd
 
loadlearn's Avatar
 
Join Date: Apr 2009
Posts: 1,256
Default

Attach your .fla.
__________________
“Nothing that is worth knowing can be taught.” - Oscar Wilde
loadlearn is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:20 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.