A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: actionscript not working ?

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Posts
    13

    actionscript not working ?

    i have a piece of code which netscape doesnt seem to like can anyone suggest a modification to this or have a solution

    icounter=icounter++;
    myvar = "label"+icounter;
    gotoAndStop (myvar);

    i have three labels on the stage, pressing the button with this code on it just brings you from label one to label 3. it doesnt seem to like "label"+icounter;

    there is more code on the button but it is this piece that isnt working.

    i would like to keep it simple like this so the one button can be used instead of three seperate instances of the button with three seperate pieces of code.

    works in IE fine.

    any ideas

  2. #2
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    I am a IE user, so I can't test it, but the code looks fine. if you are having problems, though...

    try

    myvar=["label" add icounter];

    it should work with a + instead of the add. You could also, if you are still experiencing problems use

    myvar=eval["label" add icounter];
    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

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