 Sample image
The task is to demonstrate the creation of a series of vertical pinstripes across the entire width of the display.

 in the first quarter the pinstripes should alternate one pixel white, one pixel black = 1 pixel wide vertical pinestripes
 Quarter of the way down the display, we can switch to a wider 2 pixel wide vertical pinstripe pattern, alternating two pixels white, two pixels black. 
 Half way down the display, we switch to 3 pixels wide, 
 for the lower quarter of the display we use 4 pixels.


c.f. Colour_pinstripe/Display

 
package  {
 
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.events.Event;
 
    public class Pinstripe extends Sprite {
 
        public function Pinstripe():void {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }
 
        private function init(e:Event = null):void {
 
            var data:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0xFFFFFFFF);
            data.lock();
 
            var w:uint = data.width, h:uint = data.height / 4;
            var x:uint, y:uint = 0, i:uint, px:uint, colour:uint, maxy:uint = h;
 
            for ( i = 1; i <= 4; i++ ) {
 
                for ( ; y < maxy; y++ ) {
                    colour = 0xFF000000;
                    px = 1;
 
                    for ( x = 0; x < w; x++ ) {
 
                        if ( px == i ) {
                            colour = (colour == 0xFF000000) ? 0xFFFFFFFF : 0xFF000000;
                            px = 1;
                        }
                        else px++;
 
                        data.setPixel32(x, y, colour);
 
                    }
                }
 
                maxy += h;
 
            }
 
            data.unlock();
            addChild(new Bitmap(data));
        }
 
    }
 
}
 