Here is what I use in a preload.as included in frame 1 and the rest of the animation on frame 2

<http://132.203.112.156/phpmyadmin27/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=b2evolution&table=evo_blogusers&pos=0&session_max_rows=30&disp_direction=horizontal&repeat_cells=100&dontlimitchars=0&sql_query=SELECT+%2AFROM+%60evo_blogusers%60++ORDER+BY+%60bloguser_ismember%60+ASC>/*add this line on frame 1:
#include "preloader.as" */

// --------------------------------------------------------PRELOADER-------------------------------------------------------------------

//arrête la lecture sur l'image 1
stop();

//trace(Stage.width + " : " + Stage.height);

//fait un mc vide qui contiendra le "preloader"
this.createEmptyMovieClip ("preloader_mc",1);
//pour positionner le preloader à l'endroit désirée
preloader_mc._x = Math.floor(Stage.width / 2) - 100;
preloader_mc._y = Math.floor(Stage.height / 2) - 50;
//les variables
preloader_mc.tBytes = this.getBytesTotal ();
preloader_mc.startX = 0;
preloader_mc.startY = 0;
//le champs texte qui affiche l'info
preloader_mc.createTextField("loader_txt",1,0,-25,200,40);
//formatage du texte
var loadFormat:TextFormat = new TextFormat ();
loadFormat.font="_sans";
//loadFormat.bold=true;
loadFormat.align="center";
loadFormat.color=0xafafaf;
loadFormat.size=10;
preloader_mc.loader_txt.setNewTextFormat(loadFormat);
//rectangle
preloader_mc.createEmptyMovieClip ("rectangle_mc",10);
preloader_mc.rectangle_mc.lineStyle(1,0x000000,100);
preloader_mc.rectangle_mc.moveTo(this.startX,this.startY);
preloader_mc.rectangle_mc.lineTo(preloader_mc.startX,preloader_mc.startY+5);
preloader_mc.rectangle_mc.lineTo(preloader_mc.startX+200,preloader_mc.startY+5);
preloader_mc.rectangle_mc.lineTo(preloader_mc.startX+200,preloader_mc.startY);
preloader_mc.rectangle_mc.lineTo(preloader_mc.startX,preloader_mc.startY);

//fonctionnement du preloader
preloader_mc.onEnterFrame= function() {
   this.clear();
   //style pour les lignes
   preloader_mc.lineStyle(1,0x000000,100);
   //nb de bytes chargées
   lBytes=_root.getBytesLoaded();
   //variable du %
   var percentLoaded = Math.floor((lBytes/this.tBytes)*100);
   if (lBytes != this.tBytes){
       //texte du champs texte
//this.loader_txt.text="Chargement "+lBytes+" de "+this.tBytes+"\n "+percentLoaded+"%";
       this.loader_txt.text = percentLoaded+"%";
       //remplissage de la forme
       this.beginFill(0x666666,100);
       //dessiner le loader
       this.moveTo(this.startX,this.startY);
       this.lineTo(this.startX,this.startY+5);
       this.lineTo(this.startX+(percentLoaded*2),this.startY+5);
       this.lineTo(this.startX+(percentLoaded*2),this.startY);
       this.lineTo(this.startX,this.startY);
       this.endFill
   }else{
       //aller à l'image 2
       _root.play();
       //_root.stop();
       //enlever le preloader
       this.removeMovieClip();
   }
}

But verify what eric dolecki said also!

A+
<http://132.203.112.156/phpmyadmin27/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=b2evolution&table=evo_blogusers&pos=0&session_max_rows=30&disp_direction=horizontal&repeat_cells=100&dontlimitchars=0&sql_query=SELECT+%2AFROM+%60evo_blogusers%60++ORDER+BY+%60bloguser_perm_poststatuses%60+ASC>

Edward Hotchkiss wrote:

i guess that my code is being deleted on each enter frame. once it loads completely, the text finally shows up, and then the next frame shows up also. why doesnt this one frame preloader, second frame website preloader work??? this is really bugging me, that i have to put code on a movieclip, and i cant do it 100% AS.

function preloadMe() {
_root.onEnterFrame = function() {
    tBytes = _root.getBytesTotal();
 bLoaded = _root.getBytesLoaded();
 percent = Math.round((bLoaded/tBytes)*100);
 if (bLoaded < tBytes) {
  _root.preloader_mc.preloader_txt.text = "loading site: " + percent;
  gotoAndPlay(1);
 } else {
  _root.preloader_mc.removeMovieClip();
  _root.preloader_mc.preloader_txt.removeTextField();
  gotoAndStop(2)
 };
};
};
// -------------------------
drawPreloader();
preloadMe();
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



--
===============================================================

Éric Thibault
Programmeur analyste
Réseau de valorisation de l'enseignement
Université Laval, pavillon Félix-Antoine Savard
Québec, Canada
Tel.: 656-2131 poste 18015
Courriel : [EMAIL PROTECTED]

===============================================================

Avis relatif à la confidentialité / Notice of Confidentiality / Advertencia de 
confidencialidad <http://www.rec.ulaval.ca/lce/securite/confidentialite.htm>

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to