Actionscript, converting a variable in to a thingy

Soldato
Joined
25 Sep 2003
Posts
3,750
Location
Manchester
I've got a variable that is the name of a movieClip but if I try doing basically the following it doesn't work:


var myVar:String;

myVar= "myMovieClip";

myVar.alpha = .50;


This in my brain is saying, make the "myvar" variable have the value "myMovieClip" and then on the last line it's basically saying, myMovieClip.alpha = .50

So, is it because it's a String variable that's causing the issue or something else?

Cheers for helping me out in advance.
 
Last edited:
Thanks for the replies. I tried defining it as a movie clip but that just brought up a different error. :(

I expect the whole way I'm trying to go about it is wrong really. I'll have to have a look and read up more and attempt it another way.
 
Back
Top Bottom