Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: abstract movie clip name refs
From: s u z e r a i n
Date: Mon, 26 Mar 2001 08:54:35 -0000

Hi there.

I'm a JavaScript/PHP guy who's pretty new to ActionScript, and I'm
struggling with abstract object referencing.

If I know the name of a movie clip instance (say, by passing
_parent._name to a function), is there any way to reference the movie
clip by name abstractly? In JavaScript, you'd have a couple of
choices, for example:

if:

var imgname = "image1";

then the following all do the same thing:

document.image1.src = "blah.gif";
document.images["image1"].src = "blah.gif";
document.images[imgname].src = "blah.gif";
eval('document.images["' + imgname + '"].src = "blah.gif"');


So, if the name is passed in ActionScript, is there any way I can
work with the properties of that name? It seems that the only syntax
provided by AS is...

instanceName._x

...and that is entirely unhelpful if you have the instance name
stored in a variable.

Am I missing something or is something similar to the JavaScript
construct just not supported?

Cheers,

--
Marc Antony Vose
http://www.suzerain.com/

The surest way to corrupt a youth is to instruct him to hold in
higher esteem those who think alike than those who think differently.
-- Nietzsche



[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]