Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Preloader for Dynamic Page Gallery

    Hi All,

    I desperately need help with a preloader for my dynamic image gallery. I've created this with help from tutorials available online. But somehow when I post it online, the gallery takes time to load and hence need a preloader for the user to understand that something is happening. My code's given below:

    Code:
    stop();
    var loader:MovieClipLoader = new MovieClipLoader();
    this.createEmptyMovieClip("container",1);
    var imagesNumber:Number = 11;
    for (i=1; i<=imagesNumber; i++) {
    container.attachMovie("image"+i,"image"+i+"_mc",i);
    myThumb_mc=container["image"+i+"_mc"];
    myThumb_mc._x=(i-1)*myThumb_mc._width;
    myThumb_mc._y=(Stage.height-myThumb_mc._height)/2
    myThumb_mc.onRelease = function(){
    unloadMovie('container');
    }
    }	
    container.onEnterFrame = function (){
    this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*10;
    if (this._x>0) {
    this._x = 0;
    }
    if (-this._x>(this._width-Stage.width)) {
    this._x = -(this._width-Stage.width);
    }
    };
    This is an Actionscript 2.0 code.

    I am very much new to Actionscript and whatever I have learnt (not much) is thanks to forums like these and tutorials that are available online.

    Appreciate all your help. Regards.

  • #2
    New Coder
    Join Date
    Apr 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Create a new scene prior to the scene with the image gallery and load your preloader code into it.


  •  

    Tags for this Thread

    Posting Permissions

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