Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 1st, 2003, 05:47 PM
mknight mknight is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Nottingham UK
Posts: 8 mknight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
preloading a mc

How do you do it?

I have been trying to use similiar to the following as

}totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = Math.round((loadedBytes / totalBytes) * 100);
if (_root._framesloaded >= _root._totalframes) {
gotoAndPlay("start");
}


onClipEvent (enterFrame) {
_xscale = _root.percentDone;
onClipEvent (enterFrame) {


I have been changing the }_root{ to }this.container.{ etc...

Where am I going wrong?

Thanks

Reply With Quote
  #2  
Old December 1st, 2003, 07:28 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 42 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, its a little hard to tell what you mean exactly. I'm going to guess your tying to preload your main movie. Last time I made a preloader I used two scenes. Looks like your doing it off a movie clip that may be in the root of the main scene. Thats a nice idea.

onClipEvent(enterFrame)
{
totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = Math.round((loadedBytes / totalBytes) * 100);
if (percentDone >= 95)
{
gotoAndPlay("start");
}
}

That should work depending on your implementation.
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old December 2nd, 2003, 02:33 AM
mknight mknight is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Nottingham UK
Posts: 8 mknight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Tann
Sorry for not explaining properly so what i'm doing is loading my main scene and I want to load each individual mc seperately.

So instead of waiting for a whole 200kb flash movie to load you only have to wait for each 10-20kb Movieclip. But I want those small clips to preload with some kind of counter.

Its not so much which maths I use wether it be time, loaded bytes etc, none of them work becuase when I use the AS above it gotoPlays frame 1 from my Main movie line and not from the movieclip.

Please Help,

Thanks Ian

Reply With Quote
  #4  
Old December 2nd, 2003, 04:43 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 42 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi,

onClipEvent(enterFrame)
{
totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = Math.round((loadedBytes / totalBytes) * 100);
if (percentDone >= 95)
{
this.gotoAndPlay("start");
}
}

I think that should do it now.

Reply With Quote
  #5  
Old December 2nd, 2003, 01:40 PM
mknight mknight is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Nottingham UK
Posts: 8 mknight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Preloading mc's??? arrgg PLEASE HELP!!!!

Here is the exact AS that i am using!

I have tried with the all the instances of .this changed to .this.container. which were originally _root

I have tried it with no .this exept on the gotoAndPlay

I had the same preloader on my main movie, so I changed the instance name of the preloader bar and that did not work so I removed the preloader from my main movie altogether. Still no joy.

I supected it has something to do with onClipEvent (enterFrame) Maybe its particular to the main movie.

What the result is my main movie loads and plays to the point where I want it Stop and the mc stops on frame 1.

Whats displaying on frame 1 on the mc is
Frames loaded 1
Frames Total 1
Bytes loaded 293 (20kb on disk sized file)
Bytes Total 293

all the rest are o

with 100% load

I will have dozens of mc to load throughout the site and would lrealy like this to work, though the end result of the preloader will be a slimmed version.


onClipEvent (enterFrame) {
this.hcpreloader.bar._xscale = siteLoaded;
siteLoaded = int((loaded_bytes/total_bytes)*100);
// bytes
total_bytes = this.getBytesTotal();
loaded_bytes = this.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
// frames
frame_loaded = this._framesloaded;
frame_total = this._totalframes;
// kilo bytes
totalkb = int(total_bytes/1024) add "KB";
loadedkb = int(loaded_bytes/1024) add "KB";
remaining_kb = int(remaining_bytes/1024);
remainingkb = int(remaining_kb) add "KB";
percent_done = int((loaded_bytes/total_bytes)*100) add "%";
// time
time = getTimer()/1000;
// speed
speed = loaded_bytes/time;
bits = speed/1024;
Kbps = Math.round(bits*10)/10 add "KB/S";
// time remaining
kbyteCounter = (total_bytes-loaded_bytes)/1024;
loadRate = (loaded_bytes/1024)/time;
timeCounter = kbyteCounter/loadRate;
minutes = Math.floor(timeCounter/60);
seconds = Math.round((timeCounter/60-minutes)*60);
time_remaining = minutes+" min "+seconds+" sec";
// timeelapsed
minute = Math.floor(time/60);
second = Math.round((time/60-minute)*60);
time_elapsed = minute+" min "+second+" sec";
if (total_bytes == loaded_bytes) {
this.gotoAndPlay(2);
}


this is on the bar

onClipEvent (load) {
this._xscale = "0";
}

Last edited by mknight : December 2nd, 2003 at 01:46 PM.

Reply With Quote
  #6  
Old December 2nd, 2003, 06:37 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 42 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, that all seems ok to me. Can you make a snippet of your site. Say make a copy of the flash file and then remove everything except one clip etc...you know so that in the end there is just the preloader and a clip you want it to work with.

Basically can you post something here or send it to me. I'll take a look and get back to you tommorow.

Reply With Quote
  #7  
Old December 3rd, 2003, 02:21 AM
mknight mknight is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Nottingham UK
Posts: 8 mknight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thankyou Tann

Here is the main (home nag..fla)scene and the its home content.fla

Thankyou veru much Ian
Attached Files
File Type: zip preloader.zip (68.5 KB, 147 views)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > preloading a mc


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway