Preloader Speed
can i change the download speed of my flash program so i can see if my preloaders are working? because at the moment my computer and CD drive aren't giving them a chance!!
thanks
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 05-01-2006, 05:00 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Preloader And Speed
Hello,
i created a preloader of an external movie and it is working fine:
loadMovieNum("File.swf", 1);
this.onEnterFrame = function() {
_root.loadPercent=Math.floor(_level1.getBytesLoade d()/_level1.getBytesTotal()*100);
_root.loadBytes = Math.round(((_level1.getBytesLoaded()/1024)*1000)/1000)+"Kb";
_root.Bar._xscale = _root.loadPercent;
if (_root.loadPercent == 100) {
delete this.onEnterFrame;
}
};
Now i want to transform this preloader in a 8 type preloader.
So instead of having the line _rootBar._xscale = _root.loadPercent
i would have 8 "IF" conditions. So in each "IF" there will be a command, like changing _xscale of a MC, or fading in or moving it...This way i have a preloader which creates 8 diferent animations for 8 different loading .swf.
So My question is: by putting this "IF" inside my code, and since this code is in one "Enter.Frame" will i have problems with slowing down? I am afraid the time spent on testing which of the 8 actions to make will be enough for bigger parts of the file being loaded...so the loaded part will change.
Do u understand what i mean? So what do u think?
If this is not a good idea, could someone indicate me other options?
Thanks,
Miguel
Preloader With Speed Of Download
i came across this page.
http://www.eagames.com/official/thes...ding/index.jsp
the preloader shows the speed of the download (in kbps)
just curious how it was done.
anyone?
Connection Speed And Time In Preloader ?
how can i add current download speed and time remaining ( and time needed for download ) in my preloader???
I have found something about that on the board when i was looking for something else, and now when i need that i canīt find it.
Anybody knows the script for this??? I just finished my preloder with total and loaded bytes, loader status bar and percent....
but then i saw preloader with time and connectin speed and i want that on my web page
thanks!
[Edited by rimpampa on 08-05-2002 at 08:22 AM]
Detecting Connection Speed For Use In Preloader
I had an "A-Ha!" moment, and I don't think I've ever seen it on this board, so I thought I would share.
It is possible to detect (estimate) connection speeds during the preloader. This would be useful when deciding how much of the movie to load before proceeding. For example, if you know that your user is on a cable modem, you know that the download could keep ahead of the playhead if 50% of the movie is loaded in the preloader. However, a 56k modem might require 80% of the movie to be preloaded.
In your preloader, prior to the loop, initialize a variable, and set it to the number of bytes loaded. Create a constant that stores a sample speed in seconds. Create a new function that reads the current bytesloaded, compares it to the old bytesloaded, and calculates the DL-speed based on the sample rate. Last, create an interval that calls the function every samplerate*1000 (since intervals go off of milliseconds).
Note: This must all be done BEFORE your preloader frame loop, so that multiple intervals aren't being created.
Here is how I coded it:code: var kSampleRate = 0.5; // This is the Sample Rate in Seconds.
var kDownloadSpeed; // This will be where the DL Speed gets stored
var iLastBytesLoaded; // a Public variable to store the initial bytes in
function GetDLSpeed(){
clearInterval(tDownloadSpeed); // Create your interval for sampling
// DL speed = (finalBytes - initialBytes) / time
kDownloadSpeed = (this.getBytesLoaded()-iLastBytesLoaded)/kSampleRate;
}
function SampleDLSpeed(){
iLastBytesLoaded = this.getBytesLoaded(); // Set your initial sample
// Create your interval to check ever specified time (Determined by sample rate)
var tDownloadSpeed = setInterval(GetDLSpeed, kSampleRate*1000);
}
SampleDLSpeed();Keep in mind that this is an estimate. Connection speeds vary, and will be affected by what else the user has downloading, but this is a good thing since we want to know the stream speed that this SWF is getting, not if they have DSL.
Also, this is not exact because intervals are not precise. A 1.0s interval may fire at 1.05s (See Flash's ActionScript Dictionary on setInterval for more info.) Using a larger sample rate will be more precise but take more time to sample.
Preloader That Detects Speed Of Connection
Hi,
I'm no expert in Actionscript so I'm not sure whether this can be done or not but what I'm looking to do is create a preloader that looks at what the users connection speed is (without sending a file to their computer i.e. like speed tests) and the has several outcomes:
Low Speed = image
Medium Speed = low quality video
High Speed = high quality video
Any help would be appreciated.
Speed Variations From 56k To Broadband Even After The Preloader?
Hello all.
I have designed a site whereby the frame rate is 50fps. When viewed on broadband this looks as intended. However I managed to view this on a 56k modem, and the expected result was quite different. Infact the loading side of things was ok, i.e preloader, but the main template loading was much slower even after preload. why?
Secondally the top part shape tweened very slow and the remaining parts were a lot faster, more like the orignal state.
Am I doing something wrong here, I must admit I have jumped in very quickly, but I was with the knowledge that we could avoid little hurdles like this, in terms of different browser types, connection speeds and what not.
I hope someone can provide me with a clear understanding why this is happening, and equally the solution that can prevent this.
There must be a work around. Once something is preloaded it should perform as expected right?
And if you are thinking its the computer, no! the other computer is just as good, however with less RAM.
Please I really would like some understanding in this area.
Testing Preloader On High Speed Connection
What could take 10 seconds to load on a 56K connection loads instantly on my high speed connection. Because it loads so fast, I can't tell if the preloader is working or not.
Is there any way to test it?
Thanks
Preloader Doesn't Work At High Speed Kb/s
I have a very weird problem:
I have created a preloader to load my swf with my soundfiles.
When I test it (double Ctrl-Enter) it works fine when the speed is 56K. But the minute I try something faster, like DSL, the preloader skips to frame 3 while the swf with the soundfiles load in the background.
Any ideas would be highle appreciated!
the script:
code:
onClipEvent (load) {
loadMovie("eksternLyd.swf",_root.lydMC);
//_root.lydMC.loadMovie("eksternLyd.swf");
_root.loadedLyd=1;
}
onClipEvent (enterFrame) {
if (_root.loadedLyd==1) {
total = _root.lydMC.getBytesTotal();
loaded = _root.lydMC.getBytesLoaded();
if (total>999999999 && loaded == total) {
_root.gotoAndPlay(3);
} else {
percent = loaded/total*264;
displayPercent = math.round(percent)+"%";
progressBar1.bar1._width = percent;
}
}
}
(the 999999999 is just to test...)
/Donleavy
Streaming Audio Speed No Good - Depends On Processor Or Internet Connection Speed?
we are launching a narrated, streaming flash 6.0 presentation for a client. frame rate is 20fps. here is the link:
http://www.optionaldesigngroup.com/preston
they sent us this email:
"I do not know who else this may be happening with, but when Marjorie Sanders (OC) opened to take the tour, it loaded the software (not sure why her machine didn't have it), and the video was the size of a postcard, Kathleen sounded like a little child (almost munchkin like) and was going 100 mph (so very, very fast - almost unintelligible). Can we experiment with it. Could it be because of the download - I would hope that people don't receive it that way or they will end up laughing at it (it is almost silly)."
does the streaming sync depend on the internet connection or the processor speed? i am assuming processor, and that on a kick-butt new machine it will stream faster then on a slower one.
i think the only way to counter for this is to go in and add some more frames in the narration between phrases. we don't want to lower the framerate because it will affect the flow of the tweens.
any thoughts on this would be greatly appreciated. thanks.
Problems With Speed: Loading An Animation Dynamically...reduced Speed Why? W/exampl
Im loading an animating logo dynamically into a site. The animation works in normal speed if i access it directly:
http://www.ingerreime.no/David/thegl...ches/home.html
But, when i load it dynamically into the main site, the speed reduces drastically! Click "home":
http://www.ingerreime.no/David/thegl...achesmain.html
Everything is loaded dynamically, except the blue backgrounds.
Any thoughts?
Thanx!
Dave
Light Speed Or Warp Speed Effect.
Can someone tell me if they no how to create or have and .fla file of the stars in the star wars when ships go to warp. They kind of strech. I have been looking for this but the search tool here is not the best.
[MX04] MC Speed Vs. Document Speed
I'm an intermediate to flash, and know limited coding.
But,
I have created a flash slideshow with a preloader. However, the preloader needs to be at 12fps in order to look good, but the slideshow is at 0.4fps to look good. (It basically just flips to each image.) The controller is a sample controller in flash, and I wasn't sure how to activate the delay switch in it, so I just set the fps of the whole scene at 0.4fps.
Anyways, is there a way to have the whole slide show at 0.4fps but the preloader MC at 12fps, or sped up or something. Thanks!
How Do I Change Speed The Speed?
Is there a way to change the speed of an object on Mousemove OUTSIDE the movie.
I have to make a small animation (about 6px x 600 px) in the header of a HTML-document with a flash-animation that changes speed when you scroll the mouse over the body of the html-document.
Is this possible?
Niek
Can I Speed This Up ?
Im loading the variable "desc" from a text file which is about 3 paragraphs long and replacing the characters "$A$", "$P$, $E$ with &,=,+ is there any way to speed this process up? Right now its taking a good 20 seconds to process on a P3 900mhz
I'm aware that I can use special character codes such as %26 for "&" and so on but for what we are trying to do it wont work that way.
//-----------------------------------------------------
loadVariables ("test.txt", "");
test = desc;
do{
value = test.indexOf("$A$");
if (value <> "-1"){
test = test.substring(0, value)+"&"+test.substring(value+3, test.length());
}
value = test.indexOf("$E$");
if (value<>"-1") {
test = test.substring(0, value)+"="+test.substring(value+3, test.length());
}
value = test.indexOf("$P$");
if (value<>"-1") {
test = test.substring(0, value)+"+"+test.substring(value+3, test.length());
}
} while (value <> "-1")
//-----------------------------------------------------
CPU Speed
I am designing a Flash site on a Pentium III 500Mhz and when I tested it on a PIII 1.1Ghz, the sounds lost all synchronization with the animations since the animations are much more faster than the sound. When I lowered the frame rate, everything worked fine.
Is there a way through code on how Flash detects the CPU speed and automatically arranges the Frame Rate? Or is there something else I can do so that when exporting my code to a faster CPU, there is no change to my original site?
Thanks
CPU Speed
I am designing a Flash site on a Pentium III 500Mhz and when I tested it on a PIII 1.1Ghz, the sounds lost all synchronization with the animations since the animations are much more faster than the sound. When I lowered the frame rate, everything worked fine.
Is there a way through code on how Flash detects the CPU speed and automatically arranges the Frame Rate? Or is there something else I can do so that when exporting my code to a faster CPU, there is no change to my original site?
Thanks
Speed
I have a 109k swf file, and I have created a preloader and works great in my computer but whenever I check it in another computer graphics play slower and sound just goes on at its normal rate. I know that depending on the power of the computer is how fast is going to play but I think has to be a script that will read the computer capabilities or system speed and then it will play at an assigned frame rate according to the system capabilities. Is this possible or not? or do I have to create 2 versions where one of the movies frame rate is faster than the other so the user can pick one according to their capabilities. Please help or send me a refference where I can go end check this inconvenient that is making me crazy.
Note: All this is being tested on T3 conection.
Getting Up To Speed
I've been playing with Flash a little, but I want to start making more progress. What is the best way to learn how to make eye grabing sites. Classes, books, tutorials? I know it is going to take a good deal of time, I just want to make sure I am heading in the right direction.
How did some of you start, and how did some of these people get so damn good?
Speed Swf Up
Hi, I was wondering is there such code to speed up the swf animation? Thank you.
MC Speed
I posted a message a while back on controlling a mc speed following the mouse,now I have another
I have a button and a mc1
when I mouse over the button I have the mc1 move from its resting spot over to the button and display text for that button.
I have another button with same effect and this is working fine but I would like to slow the rate of speed the mc1 moves to the button I mouseOver
thanks
SWF Speed Help
hi guys just wanna ask how could i make my movie into 50fps or more have trouble and was thinking if it is better if i could use a script for these cuz tried the fps toolbox/window it not working so help me....i'm new to this so could you recommend a script.....
Speed Help
Okay, I was woundering if anyone can tell me how to make my flash website load faster. Plus, tell me about streaming music and will that make it go faster?
Thank you very much.
Speed
Hi There
What is the best way to make an animation or a big jpg animate smoothly. I have noticed that when you animate an opacity change it slows the rest of the movie down, even if I add a loading script at the beginning
Any ideas?
Danny
Speed It Up
If u check out
cirquelemasque
you will see the way the interface moves left or right. I know if i change the base rate it will make it move faster or slower but what cna i do to make it work faster on slower modems. the overall file wiht intro is 570k. the intro is 200k and 370 for movie. I f i seperate them and make an intro for both, wil lit make the movement faster for slower computers.
Also I will accept comments about the site, Its in its final stages and is live, but I am tweaking it
Speed
I've got a general curiousity question: why exactly does Flash run so damn slow?
I've got all sorts of programs on my computer that do things countless times more complex that what my game does, and yet they run at a much greater framerate. How is it that a 2D program chugs along so slowly? Was it a concious decision by someone to limit the amount of processing power Flash gets, or is it just really inefficient?
Speed?
Look i'M probably becomin a pain but i'm tryin for ur flash speed how do u slow it down mine like goes 30 frames in 5 seconds could someone plz tell me how to slow down the speed????
Speed (fps)
Please tell me that can i control the speed of a swf (fps) dynamicaly if yes then how?
Speed
Can I control the speed of a movie dynamically on click of a external button.swf (button to get speed high & low)
Speed Up?
anybody know owhy my movie sorta doubled in speed at the end of the 5th scene, and sped up the other scenes after it?
Speed, Speed, And More Speed - HELP
Hey guys and gals, this is a weird issue I have, I'll try to explain it the best I know how.
Here we go..., I am creating a CD portfolio in Flash and everything is going great. yeah! But I have come across a problem.
I have a main interface which is a swf published as a html file. The user can click on several buttons, these buttons load pictures, videos, and interactive stuff. These files being loaded, are in a seperate folder. I am usin the getURL to well,...get them.
The problem is...It takes forever to load the videos!! Correct me if I'm wrong, but its on a CD, it shouldn't take 2mins to load a video, it should be instantaneous. Its fast when I test it on my hardrive, but not when I test it on my CD!
I need any expert advice you gals and guys may have. please help.
Speed Changes
hi. i've got a shell movie which loads 5 external movies with five buttons.
the first time i press any of these buttons, the movies load and their speed is fine (they're all set at 40fps).
but the second i click a button a 2nd time the speed increases. i'm pretty sure the frame rate cannot increase but i just don't see what i'm not clearing away when i load another movie into my single placeholder.
i was hoping someone might be able to point me in the right direction. i've attached the files.
thanks in advance. fumeng.
Speed
I am viewing a web page from 2 different computers - both have Flash Player 7 installed in IE. Actually Flash Player seems to work better in Firefox than IE, but then again what doesn't?
When I view this file on the 2000 machine (the other one is xp), it plays much too slow, even after the whole file has been downloaded. Is this processor speed? Doesn't make sense as both processors are fast.
SWF Speed
Hi,
I'm making a movie with 4 pictures in (2 png's en 2 gif's 256 colors). The project is 960 by 610. de pictures are also that big. Now I have a frame rate of 30 fps, and when I make 2 pics appear, it's slowing down.
Can someone give me some help because some site have a lot of pictures, and you cant see a thing.
please help me.
kilikMC
MC Speed
Is there a way where I can either slow down or speed up a movie clip. Also how can I maintain the same fps from a movie that is being loaded into another.
Ex.
Main movie is 21 fps
Movie being loaded is 10 fps
I hope I was clear enough. Thanks
Tom
Help With Speed
hi. im quite new to flash mx and i have just been experimenting wih some code. what i am trying to do is create a shape that will move up when the up arrow is pressed. i have created a square and converted to a movie clip and added this code to it
onClipEvent (enterFrame){
if (Key.isDown(Key.UP)){
speed -=10
}
}
when i run the file it does not come up with any problems but when the up key is pressed nothing happens. how can i fix this?
Sterny
Speed
Is there a way of finding out how long the page I have created in Flash will take to uplaod (i.e. whether I need a long preloader) on a website when it is up and running?
Is the preview option in Flash close to how long it will take in "real life"?
CPU Speed. Need Everyone To Help.
I used to have an AMD 2800+ and now I have a Atholon64 3400. Flash runs at a slower frame rate on my 3400 even though it's a faster processor.
Does anyone know of a good flash benchmark system?
Also, what processors do you all have? What ones help flash run at peak performance?
Need More Speed
Can anyone please show me how to speed up this scrolling mc:
i have a long mc which will be full of thumbnails, and it has left and right scroll buttons which move the whole mc left or right. The movie has a frame rate of 60.
The mc and the buttons are all in an mc with these actions on it:
Code:
onClipEvent (enterFrame) {
if (frameCounter%speedFactor == 0) {
if (sliding == "left" && picBar._x>-588) {
picBar._x--;
} else if (sliding == "right" && picBar._x<-382) {
picBar._x++;
}
frameCounter = 0;
}
frameCounter++;
}
Inside that mc there are these actions on the timeline:
Code:
scrolling = 0;
frameCounter = 1;
speedFactor = 1;
The buttons have this code (this is just the left one which is obviously almost identical to the right):
Code:
on (press) {
sliding = "left";
frameCounter = speedFactor;
}
on (release, releaseOutside) {
sliding = 0;
}
Please tell me how to adjust the speed of the scroller, everything i've tried either makes no difference or slows it down.
Speed Changes In Web
I searched the forums for this question, but didn't find any that helped to answer it.
The scenario:
When I make files, they run perfectly fine in 30 fps, in the preview mode.
They work perfectly fine as a .swf running off my pc.
When I upload it to the web, the frame rate drops considerably.
I have tested it on the Safari browser as well, so I know it isn't just my own PC.
Here are the two files, you can see for yourself:
Web version: http://members.cox.net/projecthappy/BDcard.html
.FLA version: http://members.cox.net/projecthappy/BDcard.fla
The point was for the cake to fall right during the 'woop' sound, but its off-sync in the browser version.
I'm having this same problem with any other file I try to put online. Even very basic and small files.
Your help is greatly appreciated!
Speed - Help
Hi I am a teacher and I want to make an educational animation. in my animation I want to contol my movieclip speed by slider. however I could not find such code could you help me about this issue - I am a designer not coder.
thx everybody.
I Want This To Speed Up
it works fine, i just need it to go faster and i cant seem to do it correctly...
PHP Code:
onClipEvent (load) {
this._x = _root.BossGun._x;
this._y = _root.BossGun._y;
this._rotation = ((Math.atan2((_root.ship._y-this._y), (_root.ship._x-this._x)))*180/Math.PI);
}
onClipEvent (enterFrame) {
this._x = this._x+Math.cos(this._rotation*Math.PI/180);
this._y = this._y+Math.sin(this._rotation*Math.PI/180);
Speed Help
Alright I can't seem to figure out how to add random speed to an object can anyone help me out? I just don't seem to understand speed. Thanks
Var Speed
Hi
I am creating a game and i have a health countdown ( a textbox that counts down) when the enemy is touching you. At the moment it falls very quickly. DOes anyone know how i could make it go at a certain speed like loose 1 health for every 1 seconds it touches or something? It would probs have to be a var code but does anyone know it? Here is the code so far:
onClipEvent(enterFrame){
if (hitTest(_root.enemy)==true){
_root.health.text = Number(_root.health.text) - Number(1)
}
}
How would i slow it down???
Speed In As2 And As3
i wasn't sure where to put this as it concerns AS2 and AS3.
The first language i ever learnt was AS2 and i am very proficient in it now. However, i'm working on a game and speed is very important to me.
Do you think it's worth learning AS3 for the speed difference? how difficult is AS3 to learn? and how much faster is it?
is it sufficient to use AS2 on flash player 9?
awaiting a reply,
mattk210
CPU Speed And Fps
hi all.
i'm developping a 3d engine with primitives, local transformations, global transformations, camera, few lights, diffuse + reflect, hidden faces and Zbuffer. with 100 cubes, near the camera, i'm reaching less than 15 fps (about 13). my PC Cpu is working at 1400Mhz.
i'd like to know on which Cpu Speed average, flash programmers are basing their work ? humm not sure it's clear :
with simple words : what is actually the cpu speed average reference for developpers ?
thank you,
dan
[Q] How Would You Speed This Up?
Howdy...
I was about to sleep for tomorrow and I had some thought... So, I have this one... It looks okay, but I think this one is not 'fast' enough as a transition...
Basically I have one image on the stage and have a mask that is composed of multilpe boxes and I am just removing individual movieClips to do this...
Here is the test result...
Code:
// 1 // 5 // 10
1 Interval : // 5551 // 3753 // 3511
2 Interval : // 4392 // 3484 // 3343
3 Interval : // 4040 // 3395 // 3222
4 Interval : // 3889 // 3327 // 3208
5 Interval : // 3716 // 3286 // 3227
6 Interval : // 3652 // 3197 // 3120
7 Interval : // 3634 // 3181 // 3088
8 Interval : // 3563 // 3172 // 3088
9 Interval : // 3546 // 3692 // 3066
What that table means is that if I run five intervals(row) that removes ten grids each time(column), it takes 3227 ms...
Here is the script...
ActionScript Code:
imageW = 350;
imageH = 250;
mcW = 10;
mcH = 10;
loopW = Math.ceil(imageW / mcW);
loopH = Math.ceil(imageH / mcH);
stX = this.image1_mc._x;
stY = this.image1_mc._y;
depth = 1000;
this.createEmptyMovieClip("mask_mc", depth++);
maskMC_arr = new Array();
for (var i = 0 ; i < loopH ; i++)
{
for (var j = 0 ; j < loopW ; j++)
{
var w = (j < 10) ? "0" + j : j;
var h = (i < 10) ? "0" + i : i;
_m = this.mask_mc.attachMovie("MC_Box", "box" + w + "" + h + "_mc", 1000 + depth++, {_x:stX + mcW * w, _y:stY + mcH * h});
maskMC_arr.push(_m._name);
}
}
this.image1_mc.setMask(mask_mc);
this.action_pb.setClickHandler("dissolve");
function dissolve()
{
this.attachMovie("MC_Image2", "image2_mc", this.image1_mc.getDepth() - 1, {_x:this.image1_mc._x, _y:this.image1_mc._y});
this.action_pb._y = 1000;
maxMC = 5;
st = getTimer();
trace("Start Time : " + st);
// 1 // 5 // 10
_i1_iv = setInterval(removeRandom, 1, this, 1); // 5551 // 3753 // 3511
/*
_i2_iv = setInterval(removeRandom, 1, this, 2); // 4392 // 3484 // 3343
_i3_iv = setInterval(removeRandom, 1, this, 3); // 4040 // 3395 // 3222
_i4_iv = setInterval(removeRandom, 1, this, 4); // 3889 // 3327 // 3208
_i5_iv = setInterval(removeRandom, 1, this, 5); // 3716 // 3286 // 3227
_i6_iv = setInterval(removeRandom, 1, this, 6); // 3652 // 3197 // 3120
_i7_iv = setInterval(removeRandom, 1, this, 7); // 3634 // 3181 // 3088
_i8_iv = setInterval(removeRandom, 1, this, 8); // 3563 // 3172 // 3088
_i9_iv = setInterval(removeRandom, 1, this, 9); // 3546 // 3692 // 3066
*/
}
function removeRandom(loc, num)
{
this = loc;
var l = maskMC_arr.length;
if (l > 0)
{
for (var i = 0 ; i < maxMC ; i++)
{
var rnd = Math.floor(Math.random() * l);
// trace("maxMC = " + maxMC);
// trace(maskMC_arr[rnd] + " : " + l);
this.mask_mc[maskMC_arr[rnd]].removeMovieClip();
maskMC_arr.splice(rnd, 1);
}
}
else
{
clearInterval(eval("_i" + num + "_iv"));
ed = getTimer();
trace("End Time : " + ed);
trace("Total Time : " + (ed - st));
trace("Done removing everything... " + "_i" + num + "_iv" + " " + l);
}
}
So, tell me... What is your trick to speed this process???
|