PDA

View Full Version : Why isn't this working?


robin105
07-31-2008, 01:55 AM
I worked with codes MUCH harder then this but for some reason this simple code isn't working! Why:confused:!

on (keyPress "a") {
_root.inv._visible = true;
}
on (keyPress "i") {
_parent.inv._visible = false;
}


Thanks if anyone can help me ;). Btw I did a lot of google searching but I didn't find anything that works :-( :(.

BTW only the true part isn't working! Making it invisible works... but making it visible doesn't :(.

atomic
07-31-2008, 03:31 AM
If you add a trace, what does it output?

on (keyPress "a") {
trace("a key was pressed!");
_root.inv._visible = true;
}

robin105
07-31-2008, 05:57 AM
OMG! It works! I didn't change anything except use the code you gave me! And It works :eek:! Idk how :eek:!

atomic
07-31-2008, 08:06 AM
Don't know why either! :eek:

george_gaz
08-05-2008, 10:52 AM
Hello,

I was going to say that it is possibly to do with using _root for one and _parent for the other. If it is the same clip the location will be the same so only either _root or _parent is needed both times

But if it is working with the same code anyway then that is always good :)