A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Variable problem

  1. #1

    Variable problem

    I have a button that when is pressed sets a variable that is then used to target a frame label.

    ie varible is "f1" & I want it to change to "f2" on click state.
    Then I want to target another movieclip and go to frame label "f2".

    This way everytime the button is clicked it goes to the next label ie f1, f2, f3, f4 etc.

    I have started the code here.....

    _root.images.gotoAndPlay("oldvariable");
    /:newvariable = f + (Number(/:n_frame)+1);

    I know the last line of code is wrong.. can anyone help me.

    Thanks.

  2. #2
    Lord of the Singhs
    Join Date
    Mar 2002
    Location
    India
    Posts
    342
    first up... why are u usig slash syntax? are u develping in flash 4???

    neways... even though i am no authority on flash 4 action script i think the problem is that f is not in codes.... which is telling flash that it is another variable

    /:newvariable = f + (Number(/:n_frame)+1);

    shud be rewritten as

    /:newvariable = "f" + (Number(/:n_frame)+1);

    i think this shud work!! neways in flash MX i wud've written

    newvariable = "f" + n_frame;

    Regs
    CooL "N" CalM

    my body is sore
    my eyes are red
    i still itch for more
    before i hit the bed

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