A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: -= Number Jump =-

  1. #1

    resolved

    Hi all,

    I need a little help from the experts around here.

    I have two MC's. The first MC contains two arrow (back & forth) buttons that has actions to jump between frame labels with in the second MC (named: clients_text) that's nested in the first MC. The frame labels are labeled, 1 - 2 - 3 - 4 - etc.

    The arrow button ( >> ) that tells the nested movie to go forward to the next frame label has the following actionscript:

    Code:
    on (press) {
    	this.clients_text.gotoAndStop (this.clients_text.n+1)
    }
    The arrow button ( << ) that tells the nested movie to go back has the following script:

    Code:
    on (press) {
    	this.clients_text.gotoAndStop (this.clients_text.n-1)
    }
    Each frame label within the nested MC has a variable n = "1" or n = "2", depending on the frame label.

    Here's the problem: The forward button works, but the button that goes back jumps to the first frame of the nested MC. Why does it do that? I want it to go to the frame label n-1! grrrr

  2. #2
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    i could probably determine your problem better if i saw the .fla, but try doing this:

    on (press) {
    this.clients_text.gotoAndStop (this.clients_text.n+1)
    n++
    }

    and

    on (press) {
    this.clients_text.gotoAndStop (this.clients_text.n-1)
    n--
    }


    instead of labeling n on each frame..

    hope that helps!

    ~MOose

  3. #3
    Poop, that doesn't work. What's the n++, and n-- suppose to do?

  4. #4
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    n++ means add 1 to n
    its equivelant to saying:
    n += 1

    and n-- is the same as saying:
    n -= 1
    which is the same as:
    n = n - 1

    etc...

    im just saying do this rather then having frame actions, it does the same thing except your code is now less spread out and you use less of it.

    as for your problem im not sure exactly what all is going on, sometimes you think its something that its not.. id need to see everything =\

    gl

    ~MOose

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