Prev | Current Page 641 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


SlideShow with Flash 9
As in the previous version the enterFrame event is used for the fade - in effect. The SlideShow class also
extends the EventDispatcher to provide its Event.COMPLETE event.
import flash.Lib;
import flash.display.DisplayObjectContainer;
import flash.display.Loader;
(continued)
Chapter 12: Building Interactive Content with Flash
335
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.MouseEvent;
import flash.net.URLRequest;
class Main
{
public static function main()
{
var show = new SlideShow(8);
show.addEventListener(Event.COMPLETE, function(e)
{
show.next();
Lib.current.addEventListener(MouseEvent.MOUSE_DOWN, function(e)
{
show.next();
});
});
}
}
class SlideShow extends EventDispatcher
{
private static var PREFIX = ???images/img???;
private static var EXTENSION = ???.jpg???;
private var total : Int;
private var pictures : Array < DisplayObjectContainer > ;
private var current : Int;
private var container : MovieClip;
private var imagesLoaded : Bool;
public function new(total : Int)
{
super();
this.


Pages:
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653