A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Button help

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    2

    Button help

    I want to do something like “gotoAndPlay(“frame label”) for a movie clip with the instance name content.

    I am using an array for my buttons placing multiple instances of the button mc on the stage.

    When I add content.gotoAndPlay I get an access of undefined property error. If I add it inside the parenthesis I get an expecting identifier before my frame label name error.

    function butnClick(event:MouseEvent):void { if (event.target.num 0) { content.gotoAndPlay("home"); }

    Yields access of undefined property error

    function butnClick(event:MouseEvent):void { if (event.target.num 0) { gotoAndPlay(content.”home”); }

    Yields expecting identifier before home error.

    Leaving out the content movieclip name gives no errors but of course does not work.

    Any help would be appreciated.

  2. #2
    AS2 intolerant person
    Join Date
    Jan 2009
    Location
    Swansea
    Posts
    352
    event.target.num == 0

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    2
    Sorry about that. The code is written that way with the ==
    Forgot to type them when I was making the first post.
    if (event.target.num == 0) {
    gotoAndPlay("home");
    }
    Gives the errors mentioned above when the other movieclip's name is added.

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