Operand Error and tips/ guides for beginner on ASP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siresoth666
    New Member
    • Jun 2007
    • 1

    Operand Error and tips/ guides for beginner on ASP

    Greeting to everyone, I am a rookie at ASP and this may seem like a very simpleton question to most but I am clueless about it.
    I copied a code from a tutorial on to Flash its ASP but it does not work.
    It tells me that I have an operand error.

    The code is for a preloader in which the numbers run from 0% to 100% on a flash animation. Everything works, except the % numbers do not move. It stays stuck at 99% which is the inital text entered onto the animation.

    Here is the original code as I got it:

    onClipEvent (load) {
    total = _root.getBytesT otal();
    }

    onClipEvent (enterFrame) {
    loaded = _root.getBytesL oaded();
    percent = int(loaded/total*100);
    percen1 = “”+percent+”%”;
    gotoAndStop(per cent);
    if (loaded == total) {
    _root.gotoAndPl ay(2);
    }
    }

    The error I get in Flash 8 is the following:

    **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: Operator '%' must be followed by an operand
    percen1 = ('+percent+'%);

    **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 9: ')' expected
    gotoAndStop(per cent);

    Total ActionScript Errors: 2 Reported Errors: 2


    Can someone explain to me what I am doing wrong and also can someone suggest a book or a site for beginners ASP so I can understand why the errors occur?

    you assistance is really appreciated.

    thank you.
  • improvcornartist
    Recognized Expert Contributor
    • May 2007
    • 303

    #2
    Since percent is an integer, you might try using .toString():

    Code:
    percen1 = “” + percent.toString() + ”%”;

    Comment

    Working...