/** * 25-Line ActionScript Contest Entry * * Project: meta.noise * Author: frank reitberger, frank@prinzipiell.com * Date: 20.11.2008 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // 3 free lines! Alter the parameters of the following lines or remove them. // Do not substitute other code for the three lines in this section [SWF(width=350, height=350, backgroundColor=0x0B025B, frameRate=40)] stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; // 25 lines begins here! var metaMap:BitmapData = new BitmapData( 350, 350, true, 0x000B025B ); addChild( new Bitmap( metaMap ) ); var metaPool :Vector. = new Vector.() metaPool.push( 60, 90, 100, 100, 250, 250, 2, 1, 4, 6, 5, -3 ); function onUpdateFrame( event:Event ):void { metaMap.fillRect( metaMap.rect, 0xFFFFFF00 ); for ( var i:int = 0; i <= 5; i++ ) { metaPool[i] += metaPool[ i + 6 ]; if ( metaPool[i] > 350 || metaPool[i] < 0 ) metaPool[ i + 6 ] *= -1; } metaMap.lock(); for ( i = 350; i >= -1; i-- ) { for ( var j:int = 350; j >= -1; j-- ) { if ( Number( Number ( 1 / Math.sqrt( ((i - metaPool[0]) * (i - metaPool[0])) + ((j - metaPool[1]) * (j - metaPool[1])) )) + Number( 1 / Math.sqrt( ((i - metaPool[2]) * (i - metaPool[2])) + ((j - metaPool[3]) * (j - metaPool[3])) ) ) + Number( 1 / Math.sqrt( ((i - metaPool[4]) * (i - metaPool[4])) + ((j - metaPool[5]) * (j - metaPool[5])) ) ) ) > Number ( 1 / 35) ) { metaMap.setPixel( i, j, 0x001003 * Math.random() * 100 ); } else { metaMap.setPixel32( i, j, 0x00FFFFFF); } } } metaMap.applyFilter( metaMap, metaMap.rect, new Point, new BevelFilter( 18, 45, 0x9090FF, 0.3, 0x2030, 0.4, 1.0, 1.0, 0.5, 2, "inner", false ) ); metaMap.applyFilter( metaMap, metaMap.rect, new Point, new GlowFilter( 0x000000, .9, 10.0, 10.0, 2, 2, false, false ) ); metaMap.unlock(); } addEventListener(Event.ENTER_FRAME, onUpdateFrame ); // 25 lines ends here!