dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Preloader confusion!!

  1. #1
    Senior Member
    Join Date
    Jun 2005
    Posts
    143

    Preloader confusion!!

    Hi
    I've been asked to add a preloader to a friends flash site that he has made.
    I used this is mine and it works fine, i just added a frame before my main project and added this:
    Code:
    Stage.align = "TL";
    Stage.scaleMode = "noScale";
    stop();
    
    // create a function called onEnterFrame
    // with this name, it is an event handler
    // and is called automatically by the flash
    // player every frame at intervals specified
    // by the frame rate of the movie
    onEnterFrame = function(){
    	
    	// the movie is completely loaded when 
    	// the _framesloaded property of the main timeline
    	// (_root) equals its total frames. If that happens
    	// if (_root._framesloaded == _root._totalframes){
    
    	// or when getBytesLoaded equals getBytesTotal
    	if (_root.getBytesLoaded() == _root.getBytesTotal()){
    		
    		// delete the onEnterFrame event handler
    		// so that it is no longer being called
    		// every frame
    		delete onEnterFrame;
    		
    		// tell the main timeline to play
    		play();
    	}
    }
    I tried doing the same with his but hes made it in a really strange way and it doesn't work.
    He seems to have made it in a presentation style.
    Where it normally says stage1 it says presentation.
    How can i get this simple preloader to work?

    Many thanks

  2. #2
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Not sure what you mean by "really strange" that's quite vague, or for that matter "presentation style". So what actually happens,... the code supplied doesn't do much of anything except check the difference between the bytes loaded versus the bytes total. Do any error messages show up? Does the main timeline play through? Maybe supply some more details as to what's happening.
    Wile E. Coyote - "Clear as mud?"

  3. #3
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    He's basically made it as a presentation i think.
    When i put in that code it just plays a white screen (the background colour)

  4. #4
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Well, by the looks of things using the presentation format looks very similar to that of a PowerPoint presentation. I'm not familiar with that format at all, in fact this would be the first time I created a document in that format. Anyways,... I'm thinking that the format would be the cause of the non functioning preloader. I tried an identical preloader in both presentation format and AS2 format, and it only worked in the AS2 format. Could be something with the way the document is created.
    Wile E. Coyote - "Clear as mud?"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center