preloader coding

  • blitzthemaniac
  • Novice
  • Novice
  • User avatar
  • Posts: 18
  • Loc: Uk

Post 3+ Months Ago

Heya all,

i need sum help lol,...

i have a website where when you type in the website URL it comes up with a 'frontpage' which is a flash movie with a title and an image as a button, pretty basic....

that flash movie is on a html page as the index page, from clicking the button in the movie i want my website homepage to load up in a new window 'full screen' and while it loads i want everyone to be distracted by a preloader with something pretty happening too keep people interested....

dose ne1 no how to code/ construct something like this,.....as you can tell im not the most experienced flasher *lola not like that :wink: * but i can do a few things such as build the preloader animation, but when i come to code it to tell it to play while loading the homepage, it dosnt....

any help will be really appreciated....
  • Lord Sivell
  • Novice
  • Novice
  • Lord Sivell
  • Posts: 32
  • Loc: Australia

Post 3+ Months Ago

Hey,

Making a preloader is pretty simple:
On you first frame put a movie clip to use as the pretty animation, make it something simple that will load quickly. Then put this:

Code: [ Select ]
// in the frame first frame
stop();

// in the movie clip
onClipEvent (enterFrame) {
  if (_root.getBytesLoaded()==_root.getBytesTotal()) {
    _root.gotoAndStop(2);
  }
}
  1. // in the frame first frame
  2. stop();
  3. // in the movie clip
  4. onClipEvent (enterFrame) {
  5.   if (_root.getBytesLoaded()==_root.getBytesTotal()) {
  6.     _root.gotoAndStop(2);
  7.   }
  8. }


Hope that helps.

Sivell
  • venatioadmin
  • Novice
  • Novice
  • venatioadmin
  • Posts: 22
  • Loc: Sweden

Post 3+ Months Ago

if you want a loader bar(which makes mouch people stay) and calles it loaderbar do like this:

Code: [ Select ]
onClipEvent(enterFrame){
  loaded = _parent.getBytesLoaded();
  total = _parent.getBytesTotal();
  percent = (loaded/total)*100;
  loaderbar._width = percent;
  if (percent == 100){
   _root.gotoAndPlay(2);
  }
}

PS- Loaderbar width must be 1 or (loaderbar._visable = 0)at the beginning or it will look bad.
  1. onClipEvent(enterFrame){
  2.   loaded = _parent.getBytesLoaded();
  3.   total = _parent.getBytesTotal();
  4.   percent = (loaded/total)*100;
  5.   loaderbar._width = percent;
  6.   if (percent == 100){
  7.    _root.gotoAndPlay(2);
  8.   }
  9. }
  10. PS- Loaderbar width must be 1 or (loaderbar._visable = 0)at the beginning or it will look bad.
  • blitzthemaniac
  • Novice
  • Novice
  • User avatar
  • Posts: 18
  • Loc: Uk

Post 3+ Months Ago

Thanx guys, im gonna go try this stuff our now

cheers again :D

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.