superramesh
12-15-2001, 02:17 AM
ok, this should be really simple. but it's killing me..and i really need your help.
i have an xml file i need to parse, and based on the clip level in this file, create 3 simple objects that have the attributes that i pass into each object.
but 1. i cant get my code to write each all 3 clip sections (only the first as demonstrated) into their respective individual objects, and 2. when i write it into obj.varOne, from the obj level i can't access varOne! _parent.varOne doesn't work.
i have attached the xml file to this and for the nicest people in the world the flash file that you may be able to save me with.
here is the action script code from the flash file
on frame 1:
=============
function extractData(numnodespermovie,clipnumber)
{
trace("number of entries per clip is " +numnodespermovie);
//for(var idx = 0; idx<numberClips; idx++)
//{
trace("clip duplicated");
//duplicateMovieClip("dummymovie", "movie"+idx, idx);
trace("numnodes per movie is " + numnodespermovie);
attachMovie("dummymovie", "movie"+clipnumber, clipnumber);
newName = eval("movie"+clipnumber);
trace("new name is " + newName);
var displacement = clipnumber+1;
//setProperty(newName,_x,getProperty("dummymovie",_x) + (displacement*100));
setProperty(newName,_x,100);
//setProperty(newName,_y,getProperty("dummymovie",_y) + (displacement*100));
setProperty(newName,_y,100);
//level2Child = level2Child.nextSibling;
//trace("test on node name if shifted" + level2Child.firstChild.nodeName);
for(var idx=0; idx<numnodespermovie-1; idx++)
{
trace("level4: name of node is=" +level3Child.nodeName);
var variableName = "var"+idx;
trace("var name in instance is: " +variableName);
//trace(" value=" +level3Child.firstChild.nodeValue);
var variableValue = level3Child.firstChild.nodeValue;
newName.variableName = variableValue;
trace("variable name is " + variableName);
trace("variable value is "+newName.variableName);
level3child = level3child.nextSibling;
trace("");
}
}
==============
and on the symbol on which movie0 is created:
onClipEvent (mouseDown) {
if (_parent.hitTest(_root._xmouse, _root._ymouse, true)) {
trace ("mouse click!");
trace("name of instance is "+_parent._name);
trace("location x is " +_parent._x);
trace("location x is " +_parent._x);
trace("ID is " +_parent._var0);
trace("Movie is " +_parent._var1);
trace("Thumbnail is " +_parent.var2);
trace("Score is " +_parent.var3);
trace("State is " +_parent.var4);
}
PLEASE help me!!
-Ramesh
i have an xml file i need to parse, and based on the clip level in this file, create 3 simple objects that have the attributes that i pass into each object.
but 1. i cant get my code to write each all 3 clip sections (only the first as demonstrated) into their respective individual objects, and 2. when i write it into obj.varOne, from the obj level i can't access varOne! _parent.varOne doesn't work.
i have attached the xml file to this and for the nicest people in the world the flash file that you may be able to save me with.
here is the action script code from the flash file
on frame 1:
=============
function extractData(numnodespermovie,clipnumber)
{
trace("number of entries per clip is " +numnodespermovie);
//for(var idx = 0; idx<numberClips; idx++)
//{
trace("clip duplicated");
//duplicateMovieClip("dummymovie", "movie"+idx, idx);
trace("numnodes per movie is " + numnodespermovie);
attachMovie("dummymovie", "movie"+clipnumber, clipnumber);
newName = eval("movie"+clipnumber);
trace("new name is " + newName);
var displacement = clipnumber+1;
//setProperty(newName,_x,getProperty("dummymovie",_x) + (displacement*100));
setProperty(newName,_x,100);
//setProperty(newName,_y,getProperty("dummymovie",_y) + (displacement*100));
setProperty(newName,_y,100);
//level2Child = level2Child.nextSibling;
//trace("test on node name if shifted" + level2Child.firstChild.nodeName);
for(var idx=0; idx<numnodespermovie-1; idx++)
{
trace("level4: name of node is=" +level3Child.nodeName);
var variableName = "var"+idx;
trace("var name in instance is: " +variableName);
//trace(" value=" +level3Child.firstChild.nodeValue);
var variableValue = level3Child.firstChild.nodeValue;
newName.variableName = variableValue;
trace("variable name is " + variableName);
trace("variable value is "+newName.variableName);
level3child = level3child.nextSibling;
trace("");
}
}
==============
and on the symbol on which movie0 is created:
onClipEvent (mouseDown) {
if (_parent.hitTest(_root._xmouse, _root._ymouse, true)) {
trace ("mouse click!");
trace("name of instance is "+_parent._name);
trace("location x is " +_parent._x);
trace("location x is " +_parent._x);
trace("ID is " +_parent._var0);
trace("Movie is " +_parent._var1);
trace("Thumbnail is " +_parent.var2);
trace("Score is " +_parent.var3);
trace("State is " +_parent.var4);
}
PLEASE help me!!
-Ramesh