|
-
beginner's question:
I want to use the duplicateMovieClip command to help populate a simple menu list of dynamic text fields.
1. Will I need to create a movie to contain the dyn text fields? (I assume I cannot call duplicateMovieClip on text fields. Can you in Flash MX?)
2. How do I pass the vars i need into this movie clip? Such as the dyn text varname? I know I can name the new movie clip, but it doesn't seem obvious to me how to name the dyn text field. they need to have the name ["faqa" + variablename]
thanks!
-
Hype over content...
Firstly create your dynamic text field, name it (I dunno, "Colin") and then convert it to a movie clip, and then name that instance.
Do your duplicateMovie thing. Normally you'd do that within a loop so your menu will be made up of movie clips named clip1, clip2 etc. yeah ?
Then to reference the dynamic text field you would use
clip1.Colin="Wow, it works";
i.e. you reference it the same as you would a var within a movieclip, or even a mc's property ( ie. _x, _y, _alpha etc. )
Hope that helps...
Squize.
PS Download http://www.shoah.co.uk/calendar.zip where I've done that. It's beta code but the bit you want works !
-
well...
but is there a way that i can change the name of the dyn text field within my duplicate movie clips? the reason i need this, is because i have all of my menu items stored in a txt file that i want to call in. The txt file looks like this:
filename: faq.txt
&faq1=This will be on line 1
&faq2=This will be on line 2
&faq3=This will be the third line
and so on...
I want to be able to do a
loadVariable ("faq.txt", "mc_name")
for each movie, and then the corresponding line of text will be read into each movie.
I could do it without naming the dyn text fields, but then I would have to have separate txt files for each movie, which seems too messy.
thanks.
-
Hype over content...
I kinda see what your getting at but can't you just load in the txt file and then make the dynamic text fields equal to the different strings ?
So you would
loadVariablesNum ("faq.txt",0);
Then once that is loaded your swf will be aware of the vars
faq1=This will be on line 1
faq2=This will be on line 2
faq3=This will be the third line
and from there use my earlier example to stuff those values into the textfields, eg
clip1.Colin=faq1;
This could be done in the duplicateMovie loop.
Check out the fla, it loads an xml file and from there decides which clip to duplicate, shoves values into textfields etc. ( If you want the current build then email me ).
Hope that's some help,
Squize.
-
ah..
ok i think i see where you're going with that. i'll give that a shot. thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|