-
Use the path to a MC as a String?
Was wondering if you could help me here:
I've got the following code on a MC:
code:
trace(this); //outputs "_root.box1.box2.box3" <-- this is what i would like to use
trace(typeof(this)); //outputs "movieclip"
trace(this.toString); //outputs "[object Object]"
How can I use what the trace function outputs ("_root.box1.box2.box3") as a variable. If trace returned what it was outputting, that would be good, but alas. MovieClip.toString() fails too.
Only way i can see of doing this to use the "MovieClip._name" var, then go up to "MovieClip._parent" MC and get its "_name" . And then keep on going up, using _parent, adding the _name.
Help build a Flash Online Multi Player RPG:
trac link
Will be Open Source
BETA should be out end of year (hopefully )
-
dubba you tee eff
Well It's dificult to answer your question because I don't see what you are trying to accomplish, please elaborate?
-
I would like to use the path to the movieclip as a string.
When i trace a movieclip, it outputs the path to the movieclip. I would like to use this path as a variable.
Help build a Flash Online Multi Player RPG:
trac link
Will be Open Source
BETA should be out end of year (hopefully )
-
the correct syntax is .toString()
gparis
-
sorry gparis, that doesnt work, as i said in my original post, lol:
code:
trace(this.toString); //outputs "[object Object]"
all i end up with is a string that contains "[object Object]".
anyone else?
Help build a Flash Online Multi Player RPG:
trac link
Will be Open Source
BETA should be out end of year (hopefully )
-
Help build a Flash Online Multi Player RPG:
trac link
Will be Open Source
BETA should be out end of year (hopefully )
-
Senior Member
Code:
var absLoc = String(this);
trace(absLoc);
-
Help build a Flash Online Multi Player RPG:
trac link
Will be Open Source
BETA should be out end of year (hopefully )
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
|