A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: if (Number(_root._currentframe)=1 )

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277

    Arrow

    I am trying to desing an on off button that can be carried through multiple frames but each frame has a different loop. My root scene has about 7 frames, each with a different loop. I allow the client to go forwards and backwards in the frames. I have most of my interface operational except the music.

    I was thinking if the music symbol could sense what the root level frame was, I could I could say something like

    if (Number(_root._currentframe)=1 ) {
    gotoAndPlay(3); - the beginning of the first loop
    }
    else if(Number(_root._currentframe)=2 {
    gotoAndPlay(200); - the beginning of the second loop
    }

    The problem is (as you can see)I don't know how to code actionscript and I don't know the terminology for half the stuff in flash yet.

    I'm trying to reduce the file size so I don't want a duplicate symbol with a different name and different subcomponents. The equalizer takes up about 50K.

    If you could help I would greatly appreciate it.

    P.S. I have posed a number of questions on this board and I would not have even begun my first web page if it weren't for the help of so many people - YOU ARE GREAT!

  2. #2
    Junior Member
    Join Date
    Jun 2001
    Posts
    24
    If i'm understanding what your saying, you have a movie clip with the music loops in them, and depending on which frame the user is on in the root timeline. Here is my solution, if that is what you want.

    (Put this in the MAIN TIMELINE)

    if (_currentframe==1) {
    _root.MovieClipName.gotoAndPlay(1);
    }
    if (_currentframe==2) {
    _root.MovieClipName.gotoAndPlay(120);
    }

    Hope this will work for you, please post back if for some reason it does not do what you want.

    Good Luck,
    Jeff

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277

    THANKS

    Thank YOU!!!!!!!

  4. #4
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277

    Missed one thing

    Because of the duel nature of a button, I still need to know how to detect when something on the main time line is in frame 1, 2, etc.

    on (release) {
    if (_currentframe==2) {
    _root.synth.gotoAndPlay(2) +_root.music.gotoAndPlay(2) + _root.sound.gotoAndStop(1);
    }
    if (_currentframe==3) {
    _root.synth.gotoAndPlay(2) +_root.music.gotoAndPlay(600) + _root.sound.gotoAndStop(1);
    }
    if (_currentframe==3) {
    _root.synth.gotoAndPlay(2) +_root.music.gotoAndPlay(600) + _root.sound.gotoAndStop(1);
    }

    this seems to never hit the second if statement or it always believes the first statement is true.

  5. #5
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277

    Solution if anyone wants to know

    if (_root._currentFrame == 2) {
    gotoAndPlay(2);
    } else if (_root._currentFrame == 2) {
    gotoAndPlay(600);
    }else if (_root._currentFrame == 3) {
    gotoAndPlay(600);
    }


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