Prev | Current Page 637 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


Part II: Server Side, JavaScript, and Flash: Oh My!
332
SlideShow with Flash 6 to 8
The onEnterFrame has been used two times in the example. The first is to monitor the load of
each image. In the loop, it checks the byte size of the image; when all the bytes have been loaded the
image is ready to be displayed and the loop is concluded. The same check could be done with the
MovieClipLoader class, but this class is not available in Flash 6. The second time the onEnterFrame
event has been used is inside the easeOut function that progressively changes the alpha value and the
size of the fading - in image. The movement duration is expressed in seconds; to obtain a smoother effect,
be sure to set a high frame rate for the movie.
import flash.Lib;
import flash.MovieClip;
import flash.Stage;
class Main {
public static function main()
{
var show = new SlideShow(8);
show.onLoad = function()
{
show.next();
Lib.current.onMouseDown = show.next;
}
}
}
class SlideShow
{
private static var PREFIX = ???images/img???;
private static var EXTENSION = ???.


Pages:
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649