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.



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

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
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.

  #2 (permalink)  
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...!
  #3 (permalink)  
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?
  #4 (permalink)  
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...
  #5 (permalink)  
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.
  #6 (permalink)  
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.
  #7 (permalink)  
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.
  #8 (permalink)  
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.
  #9 (permalink)  
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....
  #10 (permalink)  
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?
  #11 (permalink)  
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;
}
  #12 (permalink)  
Old Mar 3rd, 2005, 19:57
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
obviously the 'else if' is optional
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #13 (permalink)  
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?
  #14 (permalink)  
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.
  #15 (permalink)  
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!
  #16 (permalink)  
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.
  #17 (permalink)  
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...??
  #18 (permalink)  
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?
  #19 (permalink)  
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
  #20 (permalink)  
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.
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
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Interacting with movies loaded using the loader component (Flash 8) fantombe Flash & Multimedia Forum 2 Jan 22nd, 2008 11:09
Random swf movie loader (continuous) markmod1 Flash & Multimedia Forum 1 Jul 3rd, 2007 14:49
How to unload a movie from the Loader component griffonwing Flash & Multimedia Forum 5 Jun 12th, 2007 04:22
how to create dynamic movie clip capzman Flash & Multimedia Forum 0 Mar 28th, 2007 13:17
my movie loader gets to 100% and then waits for ages before benbacardi Flash & Multimedia Forum 5 May 29th, 2004 09:31


All times are GMT. The time now is 19:48.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43