Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / General Flash Topics / July 2008



Tip: Looking for answers? Try searching our database.

The "Loading..." icon

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dpteacher - 30 Jul 2008 17:51 GMT
So, right now I just have a white rectangle while loading. Can you give me some advice on how to avoid that, maybe have a loading icon. The website is http://roanokeartists.com
DMennenoh **AdobeCommunityExpert** - 30 Jul 2008 23:02 GMT
First, you could set your Flash movie's background color to the gray you use
on your page... instead of the default white.

As for a 'loading icon', or probably a preloader - you can google around -
there are _many_ examples. But I'd tell you to read up on the
MovieClipLoader class - check out the onLoadProgress method.

Signature

Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

dpteacher - 30 Jul 2008 23:59 GMT
Thanks. I do have the background the correct color, which is why you don't see
a white stage when the rectangles go from horizontal to vertical. I did find a
decent tutorial on a basic preloader which I will try tonight.
http://www.gotoandlearn.com/player.php?id=18

 I just assumed that it would preload a blank with the correct color, not the
white. Thanks
DMennenoh **AdobeCommunityExpert** - 31 Jul 2008 00:56 GMT
You can use that tutorial, but it's not a very good method. Why not just
learn to do it the right way and be done with it? Use the MovieClipLoader
class.

Here's a much better tutorial:
http://www.kirupa.com/developer/actionscript/moviecliploader.htm

Signature

Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

dpteacher - 31 Jul 2008 01:58 GMT
Ok. Maybe you can help me adapt it to my movieclip. I don't understand a lot of
it.

I don't want the buttons, so obviously I will leave out the buttons and the
action script for the buttons. But, do I need the default image action? If so,
why?

Then, how do I insert it into my already created movie clip? Do I just add it
into the layers and then move my movieclip one keyframe to the right?? How do I
tell it what the targetmc is? or do I have to tell it? Does it somehow already
know once it's inserted?

(The other one I understood, although it doesn't seem to work)

Anne
DMennenoh **AdobeCommunityExpert** - 31 Jul 2008 14:43 GMT
If you just read the Help on the MovieClipLoader class, there are some good
examples. The loadClip method shows you how to specify the url and target
clips.

Essentially what you do is have a single preloader movie that will load your
main content. The preloader needs nothing but a blank clip on stage
(content) and a progress bar clip if you want one.

Then you just add the preloader code on frame 1:

var mcl = new MovieClipLoader();
var lis = new Object();

lis.onLoadProgress = function(target, bl, bt){
   //update progress bar
}

lis.onLoadInit = function(target){
   //target is loaded and ready
}

mcl.addListener(lis);
mcl.loadClip("yourContent.swf", content);

That loads your swf into the empty 'content' clip. When onLoadInit fires,
content is ready to go - hide the progress bar etc, call an activate method
in the loaded movie, etc.

You can make it dynamic using FlashVars or SWFObject, so that your preloader
can load any content you request. This is how many games sites do it, so you
always see the same preloader - and you never need to worry about doing that
goofy frame-based method.

Signature

Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.