Groups | Blog | Home
all groups > flash actionscript > august 2004 >

flash actionscript : variable = Dynamic movieclip script


IAMPsycho
8/8/2004 7:37:22 PM
Okay going to keep it short, the less I type the more sense it will make. I'm
making an xml-scroll and I'm using this tutorial:
http://www.purephotoshop.com/article/112

I got my xml working just fine and I understand all the code using the for
loop and the incrementing of the newname field for the attachmovie in
correspondance with the counter for the loop. My only problem is I don't
understand the variables being created and set to the createmovieclip such as:

function makeNews(xmlFile, x)
{
var container=_root.createEmptyMovieClip("cont", 10);
var container2 = container.createEmptyMovieClip("newsMC", 11);
var clip2 = container2.duplicateMovieClip("newsMC2", 12);
... some more code

I'm confused on what data type container, container2, and clip2 are....
Is container to basically a variable of data movieclip that contains a
movieclip named cont?
Container2 is a movieclip that assumes the value of container, but also has
the movie clip newsMC?
Clip2 is pretty basic, its just an exact copy of Container2 only the entire
movieclip is called newsMC2?
So I guess my main concern is understanding what the data representation of
Container2 is....

If someone could explain this for me that would be GREAT!!!! :)
Thanks!


kglad
8/8/2004 8:15:52 PM
container, container2 and clip2 are all references to movieclips. if your
_root is _level0 then container store a reference to _level0.cont, container2
stores a reference to _level0.cont.newsMC and clip2 contains a reference to
_level0.cont.newsMC.newsMC2.
IAMPsycho
8/8/2004 8:42:56 PM
kglad
8/9/2004 2:49:54 PM
IAMPsycho
8/9/2004 3:12:49 PM
I got totally confused because I was trying to set text within the text field
of an attached movie clip and it was not working, kept returning an undefined
value when I traced it. Turns out that I was trying to set text in the var
field of the text object instead of refering to the instance. So it was a
syntax error on my behalf that made me think I wasn't grasping the logic end of
movie-clips. all is well now :)

Thanks Kglad
kglad
8/10/2004 2:26:16 AM
AddThis Social Bookmark Button