import flash.MovieClip; class SlideShow { static var mc : MovieClip; static var img : Array; static var current = 0; static var time = 0; static var strPos = 0; static var tekst = "A series of newton fractals. Made by generating random coefficients, and using bairstows method to check wheter they had any complex roots. The code for this flash presentation is made in Haxe using swfmill, the images created using java, basically everything has been made using free software. The music is the \"free software song\" sung by Jono Bacon and written by Richard Stallman, the lyrics are join us now and share the software; You'll be free, hackers, you'll be free. join us now and share the software; You'll be free, hackers, you'll be free. Hoarders can get piles of money, That is true, hackers, that is true. But they cannot help their neighbors; That's not good, hackers, that's not good. When we have enough free software At our call, hackers, at our call, We'll throw out those dirty licenses Ever more, hackers, ever more. Join us now and share the software; You'll be free, hackers, you'll be free. Join us now and share the software; You'll be free, hackers, you'll be free. "; static var tx = 3; static var ty = 2; static var tf : flash.TextField; static var snd : flash.Sound; static inline function sndStart(succes) { if (succes) snd.start(); else trace("sdsd"); } static inline function sndLoop() { snd.start(); } static function main() { mc = flash.Lib.current; mc.onEnterFrame = Loop; snd = new flash.Sound(); snd.onLoad = sndStart; snd.onSoundComplete = sndLoop; //looping snd.loadSound("http://rotand.dk/blog/wp-content/jbfsf.mp3", true); // sndStart(false); img = new Array(); for(i in 1...21) { var tmp = flash.Lib.current.attachMovie("img"+i, "img"+i, -i); img[i-1] = tmp; tmp._alpha = 0.0; } tf = flash.Lib._root.createTextField("tf",1,30,200,80,60); tf.autoSize = true; var tffmt : flash.TextFormat = new flash.TextFormat("vera"); tffmt.color = 0xFF0000; tffmt.font = "vera"; tffmt.size = 25; if (tffmt.font == null) trace("no font today"); tf.setNewTextFormat(tffmt); } static function Loop() { if (time>100) { img[current]._alpha = 0; current = (current+1) %20; time = 0; } if (time%2==0) { strPos++; moveText(); } if (strPos>tekst.length) strPos =0; var string = tekst.substr(strPos, 20); flash.Lib._root.tf.text = string; if (time<25 ) img[current]._alpha = time *4; else if (time >75) img[current]._alpha = (100-time) * 4; else img[current]._alpha = 100; time ++; } static function moveText() { tf._x +=tx ; tf._y +=ty; //clamping tx = (tf._x<20 || tf._x>200) ? -tx : tx; ty = (tf._y<20 || tf._y>400) ? -ty : ty; } }