Results 1 to 2 of 2

Thread: the % used as an opperator

  1. #1
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default the % used as an opperator

    A tutorial from flashandmath.com that demonstrates how to load swfs into another swf.

    line by line I understand how it works but the one intresting part is the "%" used as an opperator.

    Here is part of that code:
    function runOnce(e:Event):void {
    if (thisMC.currentFrame == thisMC.totalFrames) {
    thisMC.removeEventListener(Event.ENTER_FRAME, runOnce);
    index = (index + 1)%(clips.length);
    nextClip();
    }
    }
    can anyone explain that?
    Last edited by evan; 12-16-2008 at 09:08 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    "%" (modulo) represents the remainder of the two expressions when divided.

    The livedocs offer a better explanation.

  3. The Following User Says Thank You to Medyman For This Useful Post:

    evan (12-11-2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •