Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 2 of 2
  1. #1
    Bad Ass Statham Statham's Avatar

    Join Date
    Apr 2009
    Location
    Bear, DE,USA
    Posts
    5,118

    actionscript problems(AS2)

    so I've been trying to get a preloader working, but for some reason it's not working. I wanted to have it rise vertically so I tried,but when i test it, it doesn't doing anything.

    now i know i'm doing something wrong. I was trying to modify the AS from this tutorial: [youtube:3eg42vc4]http://www.youtube.com/watch?v=o3x4aWkG83c[/youtube:3eg42vc4]

    I modified it to what I believe I had to, but i think the way I modified wasn't right.
    here's the AS:

    Code:
    stop();
    var initX:Number = _root.preloader.mask._y;
    myInterval = setInterval(checkLoading, 50, this);
    function checkLoading(path) {
    	var amount:Number = (path.getBytesLoaded()*100)/path.getBytesTotal();
    	path.preloader.mask._y = initY+(amount*_root.preloader.mask._height)/100;
    	path.percentageLoaded.text = Math.floor(amount);
    	updateAfterEvent();
    	if (amount == 100) {
    		clearInterval(myInterval);
    		path.gotoAndPlay(2);
    	}
    }
    here's the FLA file of my preloader- dd_preloader.fla - 1.2 Mb

    *You must be prepared for harsh critique. What I offer is in sight on what you should of done and you may get a offended, but you must understand if you can't take the heat get out of the kitchen of art.

  2. #2
    Veteran Enthusiast LeadingManNigel's Avatar


    Join Date
    May 2005
    Location
    New York City
    Posts
    6,213

    Re: actionscript problems(AS2)

    I don't remember preloading in AS2 to be that complicated O_o.
    I think :
    Code:
    var amount:Number = (path.getBytesLoaded()*100)/path.getBytesTotal();
    should be:
    Code:
    var amount:Number = (path.getBytesLoaded()/path.getBytesTotal())*100;


 

Posting Permissions

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