A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Action Script Question: gotoAndPlay

  1. #1
    Senior Member maksum's Avatar
    Join Date
    Oct 2002
    Location
    Portland, OR
    Posts
    118

    Action Script Question: gotoAndPlay

    Ok, I took about a year off of flash and actionscript to get my business going, and now I am ready to delve into it again. However, already I'm getting stuck on things that should be easy and straight-forward.

    All I want to do is tell a movie clip to play from a certain frame. It's going to that frame, but not playing... just stopping. Here is the code I'm using:

    _root.ball_animation.gotoAndPlay(2);
    I've attached the little test .fla I'm working with.

    Any help would be greatly appreciated. I'm sure it's a simple thing.

    Mike
    Attached Files Attached Files

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    the movieclip has not had time to fully instanciate
    when your frame#1 code is called, so nothing happens
    try this code on frame#1
    Code:
    this.onEnterFrame = function(){ // loop at FPS
    if(_root.ball_animation._width > 0){ // >0 = instanciated
    _root.ball_animation.gotoAndPlay(2);
    this.onEnterFrame = null; // end loop
    }
    }

  3. #3
    Senior Member maksum's Avatar
    Join Date
    Oct 2002
    Location
    Portland, OR
    Posts
    118
    Perfecto. Thanks much.

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