Results 1 to 6 of 6

Thread: Flash Movie Frame

  1. #1
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default Flash Movie Frame

    I have a flash file with an animation going across 89 frames, that animation goes with a movie clip that is on top of it for 30 of those frames. The movie clip has 3 frames but has a stop action on each. I want to the main animation to loop through once on frame 1 then loop through again but have the movie clip on frame 2. I have it coded like this but it isn't working.

    Code:
    Frame 1:
    var count_loop = 2;
    Frame 2:
    trace(count_loop);
    //trace is to verify count_loop is functioning correctly which it is
    _root.sign1.gotoAndStop(count_loop);
    // this doesn't appear to be being called
    Frame 89:
    total_frames = 3;
    if (count_loop>=total_frames) {
    	count_loop = 0;
    }
    count_loop = count_loop+1;
    gotoAndPlay(2);
    This is in CS3, AS2, for Flash Player 8. Thanks for any ideas.
    Corrections to my coding/thoughts welcome.

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Okay, so you have an MC with 3 frames. You have an 89 frame animation. You want the animation to run through all 89 frames while the MC is on frame 1, then start all over and loop through all 89 frames while the MC is on frame 2, then all over again while the MC is on frame 3?

    Is that correct?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Yup, that is correct.
    Corrections to my coding/thoughts welcome.

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Is it possible to put that 89 frame animation in an MC of it's own? It would be a very simple fix if you could do that.

    If you can, let me know and I will spit out the code for you, if not I will have to rethink it.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Yea I could put the animation into a movie clip of its own.
    Corrections to my coding/thoughts welcome.

  6. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Perfect. Do that and then you will want to add this code to accomplish what you want.

    Note, this is off the top of my head, so it may need a tad bit of adjusting...

    Code:
    //Below "MC" refers to the 3 frame MC
    // and "anime" refers to the 89 frame animation...
    stop();
    this._parent.MC.nextFrame();
    if (this._parent.MC._currentframe<=3) {
    	this.gotoAndPlay(1);
    } else {
    	this.stop();
    	this._parent.MC.gotoAndStop(4);
    }
    Okay, all of this code goes on frame 89 of the animation MC. Be sure to give each MC an instance name. That should do it.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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