-
ActionScripting HELP!!
Ok so if I have a MC called guy and a MC called shop, I can use Keyboard to navigate guy and this is what I am trying to do #
If guy is hit-testing shop, I want a dynamic Txtbox to say: - Press Space to Acess Shop - Better get your wallet first! -
And If I press SPACE while guy is hit-testing shop, I want to gotoAndStop to another location.
This is the AS i dreamed up:
Code:
onClipEvent (load) {
if (this.hitTest(_root.guy)) {
description = "Shop Keeper, Its best if you have some money on you though";
if (Key.isDown(Key.SPACE)) {
_parent.gotoAndStop("eleswhere",1);
}
}
}
So could anyone tell me what's wrong and how do i fix it?
-
er.. not meaning to pester..
Er can anyone just reply at least an Idea?
I am really stuck, and I don't get it.
-
Howdy, your pretty close to what you want to get. Instead of using onClipEvent (load) try (enterFrame). Also is description your text box or is that just a variable?
-
its a text to put INTO the the text box.. i think it makes perfect sense.
-
Oh, okay. Where exactly do you have it stated at first? Like is it just used inside shop, like in your code above, or is it on the maintime line?
-
its used on shop movieclip and the AS is FOR the movieclip, so its set on the movieclip, I find it hard to explain but it is under " actions for shop ".
-
I gotcha, when refering to it in a MC use either _root. or _parent for your textbox.