Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-23-2012, 07:53 AM   PM User | #1
Jonivestal
New to the CF scene

 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Jonivestal is an unknown quantity at this point
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.
Jonivestal is offline   Reply With Quote
Old 04-25-2012, 04:18 AM   PM User | #2
RADRaze2KX
New Coder

 
Join Date: Apr 2012
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
RADRaze2KX is an unknown quantity at this point
Create a new scene prior to the scene with the image gallery and load your preloader code into it.
RADRaze2KX is offline   Reply With Quote
Reply

Bookmarks

Tags
actionscript, flash, image gallery, preloader

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:15 PM.


Advertisement
Log in to turn off these ads.