A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Preloader script works fine in flash8 but not in koolmoves?

  1. #1
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357

    Preloader script works fine in flash8 but not in koolmoves?

    Hi guys Thanks for all the help

    When i use this preloader script to make a movieclip called loader to scale from 0 to 100% it does not work in koolmoves.

    Try it yourself:

    put on first frame
    Code:
    stop();
    
    this.onEnterFrame = function() {
    	var amount:Number = this.getBytesLoaded() / this.getBytesTotal() *100;
    	loader._xscale = amount;
    	if(amount == 100) {
    		this.gotoAndPlay(3);
    		delete this.onEnterFrame;
    	}
    }
    What is wrong?
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    This is AS3. KoolMoves only supports AS1.

  3. #3
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Did you try this.
    Code:
    stop();
    
    this.onEnterFrame = function() {
    	var amount = this.getBytesLoaded() / this.getBytesTotal() *100;
    	loader._xscale = amount;
    	if(amount == 100) {
    		this.gotoAndPlay(3);
    		delete this.onEnterFrame;
    	}
    }
    Looked like AS2 with the typed variable.

  4. #4
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    thanks for the replys but it still does not work
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  5. #5
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    The original script was AS2.
    Bret did a good job translating it.

    Did you put a stop action in the second frame ?
    Stop actions in the first frame can cause a lot of problems.

  6. #6
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    i think i know whats wrong... i forgot to mark "Put image and sound data just before they are needed"

    It may work now
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  7. #7
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    still nothing maybe you guys could take a look at the .fun file.

    See attachments
    Attached Files Attached Files
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  8. #8
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Why re-invent the wheel and waste time on the other 99% of the movie? The built-in preloaders not only work, they allow a rather decent set of options (including a progress bar which looking at yours is all you expect). Even a day wasted on a hand coded one seems a wasted day to me (but your time is yours to waste so you should do as you please)

    I say...drag and drop this to the trash bin.....click that little checky thing to enable a KM preloader (use your graphics if you want...it lets ya)...and drive on brother

    I own Flash 8 and do my share of coding yet always prefer to drag and drop a preloader component onstage as opposed to hand coding. Same in KM. Flex automatically does it. It's also worth mentioning of the three types I just mentioned, the Koolmoves one gives me the most options as far as visual control. I'm not offended by the ability, I embrace it as a time saver

  9. #9
    That web bloke Stoke Laurie's Avatar
    Join Date
    Jan 2006
    Location
    England
    Posts
    869
    I agree, there seems little point when all you need is ready built.
    If you want make changes, try making a fun file with just one frame, onto which you create a movie clip. In the movie clip put a few frames and insert a simple animation or a motion script, try spin or rotate, then save the fun file. When you import it into your main movie as the preloader, take the option to include a progress bar, you can move it into the correct position relative to your animation by configuring the x and y settings, and away you go, a pre-loader that looks unique, but actually uses pre-configured code that works every time.

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