A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: ActionScripting HELP!!

  1. #1
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870

    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?
    When you actually know what "OMG I have so much homework!" means, you won't want to be me.
    Xrave

  2. #2
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870
    er.. not meaning to pester..
    Er can anyone just reply at least an Idea?

    I am really stuck, and I don't get it.
    When you actually know what "OMG I have so much homework!" means, you won't want to be me.
    Xrave

  3. #3
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    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?

  4. #4
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870
    its a text to put INTO the the text box.. i think it makes perfect sense.
    When you actually know what "OMG I have so much homework!" means, you won't want to be me.
    Xrave

  5. #5
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    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?

  6. #6
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870
    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 ".
    When you actually know what "OMG I have so much homework!" means, you won't want to be me.
    Xrave

  7. #7
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    I gotcha, when refering to it in a MC use either _root. or _parent for your textbox.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center