Search tutorials
For Flash MX 2004. (I think it works in MX too.)
- Add a new scene before your first one (the new scene will have only one keyframe).
- In the 1st keyframe (and the only one) of the 1st scene (the one you just added), insert this script:
// do not alterate this script // This script was build by Cosmin Varlan (vcosmin@uaic.ro) lungime_preloader = 510; inaltime_preloader = 40; preloader_x = 20; preloader_y = 120; var text_format = new TextFormat(); text_format.font = "Tahoma"; text_format.size = 11; text_format.color = 0x444444; text_format.bold = true; text_format.align = "center"; _root.createEmptyMovieClip("bg", 1); with (_root.bg) { _x = preloader_x; _y = preloader_y; lineStyle(0.1, 0xff0000, 60); beginFill(0xffff00, 40); moveTo(5, 0); lineTo(lungime_preloader-5, 0); lineTo(lungime_preloader-5, 40); lineTo(5, 40); lineTo(5, 0); endFill(); } _root.createEmptyMovieClip("loader", 2); with (_root.loader) { _x = Math.ceil(_root.bg._width/2)-46+_root.bg._x; _y = _root.bg._y+10; lineStyle(0.1, 0x333333, 100); moveTo(0, 0); lineTo(102, 0); lineTo(102, 10); lineTo(0, 10); lineTo(0, 0); } _root.createEmptyMovieClip("bar", 3); with (_root.bar) { _x = _root.loader._x+1.5; _y = _root.loader._y+1.5; lineStyle(0.1, 0x00ffff, 60); } _root.createTextField("proc", 4, _root.loader._x, _root.loader._y+10, 102, 20); _root.createEmptyMovieClip("motor", -1); _root.motor.onEnterFrame = function() { _root.total = _root.getBytesTotal(); _root.incarcat = _root.getBytesLoaded(); _root.procent = Math.floor(_root.incarcat*100/_root.total); if (procent<100) { with (_root.bar) { clear(); beginFill(0xff0000, 40); moveTo(0, 0); lineTo(_root.procent, 0); lineTo(_root.procent, 8); lineTo(0, 8); lineTo(0, 0); endFill(); _root.proc.text = _root.procent; _root.proc.setTextFormat(text_format); } } else { _root.bg.removeMovieClip(); _root.loader.removeMovieClip(); _root.bar.removeMovieClip(); _root.proc.removeTextField(); nextScene(); play(); } }; stop();
That's all folks :D
| » Level Basic |
|
Added: 2004-08-23 Rating: 4 Votes: 37 |
| » Author |
| Teacher at Al.I.Cuza University, Iasi |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!