AS help...
- Started
- Last post
- 8 Responses
- skelly
Ok, before I cut off my fingers, maybe one of you can help me.
I've done this before and it worked fine, so I must be missing something stupid.
I want to make a variable that will make a movieclip instance visible:
Like this:
var dir = firstfloor;
walkto(dir);function walkto(pos){
pos._visible = true;
}...except it doesn't work. I also tried defining "dir" like this:
var dir:MovieClip = firstfloor;
...but that was no different
- enjine0
ok, i don't understaned the question, and i have to leave in 5 mins, but if you elaborate, i can help.
why are you passing the position variable if you aren't using it?
- skelly0
the passed variable is the name of the instance i want to be invisible.
pos._visible = false;
where pos is, in my example, the name "firstfloor"
...argh, I had this working perfectly in a test piece (which I didn't save), and now I can't get it to work.
- enjine0
ah ok sorry i read too fast, didn't see the last bit there.
are you attaching the movieclip or creating it at runtime?
show me that line.
- enjine0
shit, gotta jet, sorry dude :(
- skelly0
Ok, I got it. Thanks so much for taking a look.
- root_lock0
try this
var dir = firstfloor;
[dir]_visible = true;
- root_lock0
sorry
var dir = firstfloor;
[dir].visible = true;
- skelly0
I think the problem is I was treating my movieclips like object, but didn't "attach" them or do anything differently (which I assume I should have to do).
So I just made them into buttons and it worked.