How can I create a Flash Movie Loader

This is a discussion on "How can I create a Flash Movie Loader" within the Flash & Multimedia Forum section. This forum, and the thread "How can I create a Flash Movie Loader are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Mar 1st, 2005, 03:17
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
How can I create a Flash Movie Loader

Hello there. I am wondering how to create a Flash movie loader where the Bar loads. I want the bar to do two things, one I want it to go in a circle for one loader, the other I want it to display an image as it loads it displays more of the image. I don't know where to begin or anything, so all tips/suggestions or weblinks is MUCH appreciated. Thanks Again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Mar 1st, 2005, 09:40
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
You want this really old thread!
http://www.webforumz.com/viewtopic.php?t=2918
One of our first...!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Mar 1st, 2005, 14:10
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Wow, nice thread. So all I have to do is play an animation in my existing pre-loader and that should work? How do I go about doing this? Checking my percentage loaged with the frame number in my animation?

Basically If I have an image like this:

111111
222222
333333
444444 I want it to load like this:

111111
222222 222222
333333 333333 333333
444444 444444 444444 444444

Any Idea on how to check the percentages?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Mar 1st, 2005, 15:44
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Code: Select all
bytesloaded = Number(getBytesLoaded());
bytestotal = Number(getBytesTotal());
per = bytesloaded/bytestotal*100;
is what you want...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Mar 2nd, 2005, 04:43
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, I got that now, and I thank you for that. But here's my next problem, when I use the code I made for the image pieces it doesn't work. Grrr. I can't figure out why. Can you please show me the error in my code? (according to Flash's help files this code is right).

Code: Select all
set (per,0);
p1._alpha= 0;

if (per >= 9); { 
	p1._alpha = 100;
}
For some reason when I use this code it leaves the alpha set at 100% . Can't figure out why the if statement isn't working.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Mar 2nd, 2005, 10:03
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
You have a semicolon after if (per >= 9).

That should not be there! Effectively it is ending your if statement and p1._alpha = 100 is being interpreted as an entirely serperate statement outside of your if.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Mar 2nd, 2005, 22:38
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Wow.... Such a simple thing as a misplaced semicolon. lol, thanks a lot Sirkent.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old Mar 3rd, 2005, 00:26
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, I have been playing around with this coding all day and still can't figure this thing out.

1) how do I make per = getbytesloaded()/getbytestotal() * 100

2) how do I check per every 10 percentages and make the alpha change on these?

FE- I have 10 pics, p1 - p10. and every 10 percent I want another image to show up, so I turn the alpha to 100.

Thanks again Sirkent.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old Mar 3rd, 2005, 08:33
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
You may need to use: Number(getBytesTotal()

As for making 10 movieclips visible, I can't think of a nice way to do that in coding other than a load of if statements....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old Mar 3rd, 2005, 18:46
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
I was doing if statements but for some reason it isn't working. Do I need to put End If after every statement?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old Mar 3rd, 2005, 19:53
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
No, you need:
Code: Select all
if (condition) {
  do this;
}
else if (condition) }
  do this;
}
else {
  do something else;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Mar 3rd, 2005, 19:57
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,192
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
obviously the 'else if' is optional
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #13  
Old Mar 4th, 2005, 03:49
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
hrmm.. all I am getting is a blank screen.

Quote:
set (per,20);

if (per < 11) {
p1._alpha = 0;
p2._alpha = 0;
p3._alpha = 0;
p4._alpha = 0;
p5._alpha = 0;
p6._alpha = 0;
p7._alpha = 0;
p8._alpha = 0;
p9._alpha = 0;
p10._alpha = 0;
}
else if (per < 21){
p1._alpha = 100;
p2._alpha = 0;
p3._alpha = 0;
p4._alpha = 0;
p5._alpha = 0;
p6._alpha = 0;
p7._alpha = 0;
p8._alpha = 0;
p9._alpha = 0;
p10._alpha = 0;
}
This leaves me with nothing visible on my screen. Is it REALLY this hard?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #14  
Old Mar 4th, 2005, 10:18
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, I don't see immediately why that shouldn't work, but there's no need to set the alphas for all the movieclips at every step.

Code: Select all
set(per, 20);

for (i=1; i < 11; i++) {
	_root["p"+i]._alpha = 0;	
}

if (per<21) {
	p1._alpha = 100;
}
This uses a for loop to set all of the movieclips to alpha 0 to begin with.

Next, you only need to ensure ensure that you make the alpha of each new movieclip (i.e. one you haven't changed yet) 100.

The above code works for me in Flash MX.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #15  
Old Mar 4th, 2005, 10:19
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Rob
obviously the 'else if' is optional
Technically, so is the else!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #16  
Old Mar 5th, 2005, 03:33
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
This isn't working... I am just going to give up on this... The code will work fine, but It needs to check Less than Blah, and Greater than Blah, so as not to just accept all answers...

Anyhow, How do I set p1._alpha = per ? I keep trying to do this but not luck so far.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #17  
Old Mar 5th, 2005, 17:41
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
p1._alpha = per;
should work...??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #18  
Old Mar 6th, 2005, 04:41
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Sirkent, your funny man... p1._alpha = per; doesn't work. It makes it show at 100% the entire time. Any way you could build a sample of one of the two for me so that we can figure this out?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #19  
Old Mar 7th, 2005, 08:40
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, I've tested this out.

Make sure that what you're loading is AFTER this code, otherwise it simply won't work!

You should always ensure your loader is before what you're loading anyway. This is because Flash will load an entire frame, often top down or bottom up. Until that frame is loaded, Flash won't move on. So if you put a 50k image and your code in the first frame, Flash won't run that code until it's loaded the image (or it'll run before when nothing has loaded).

When Flash jumps onto Frame 2, let's assume that there's nothing else in your movie. You then send it to run the code again but now it's 100% so the movieclip is 100% visible - There was no inbetween.

Have a look here for a working example
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #20  
Old Mar 12th, 2005, 04:01
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
wow. thanks a lot Sirkent. I really appreciate this. This is going to look great and people won't even realize they are Loading something. I see where I was going wrong, I was setting the p1._1alpha = per in the same layer as the movie clip itself and not with the getbytes code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
create, flash, movie, loader

Thread Tools

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