This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > June 2005 > Delay In Loading a Flash animation





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Delay In Loading a Flash animation
Da [ { ? ??

2005-06-14, 7:28 am

Can anybody tell me what are some of the possible reasons as to why a flash animation can take a long time to load on a webpage? And maybe some suggestions on how I can fix that problem?
jrouat

2005-06-14, 7:28 am

Hi,

The main reason is the size of the file,
If you have an file 3 Mb size it will take some time to load.
You should design some kind of preloader (a little trick that displays some
anim till the file is loaded)
but the best is to care about the size of your files ...

Da [ { ? ??

2005-06-16, 7:26 pm

Like, I have went to Flashkit for free scripts and I liked the one that shakes
the browser.. It happens when I view the html through Dreamweaver, but when I
access the page on I.E. or Firefox, the browser will not shae... Any ideas?
Here's the code if you would like to see it....

<SCRIPT LANGUAGE="JavaScript1.2">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Modified by Flash kit http://www.flashkit.com -->
function shake_xy(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
}
}
}
}
function shake_x(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(i,0);
self.moveBy(-i,0);
}
}
}
}
function shake_y(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(0,-i);
}
}
}
}
//-->
</SCRIPT>


Anil Natha

2005-06-16, 7:26 pm

You need to add one of the following to the body tag to make it work
when the page is loaded in the browser.

onLoad="shake_xy(SOME_NUMBER);"
onLoad="shake_x(SOME_NUMBER);"
onLoad="shake_y(SOME_NUMBER);"

~Anil


Da [ { ? ?? wrote:
> Like, I have went to Flashkit for free scripts and I liked the one that shakes
> the browser.. It happens when I view the html through Dreamweaver, but when I
> access the page on I.E. or Firefox, the browser will not shae... Any ideas?
> Here's the code if you would like to see it....
>
> <SCRIPT LANGUAGE="JavaScript1.2">
> <!-- This script and many more are available free online at -->
> <!-- The JavaScript Source!! http://javascript.internet.com -->
> <!-- Modified by Flash kit http://www.flashkit.com -->
> function shake_xy(n) {
> if (self.moveBy) {
> for (i = 10; i > 0; i--) {
> for (j = n; j > 0; j--) {
> self.moveBy(0,i);
> self.moveBy(i,0);
> self.moveBy(0,-i);
> self.moveBy(-i,0);
> }
> }
> }
> }
> function shake_x(n) {
> if (self.moveBy) {
> for (i = 10; i > 0; i--) {
> for (j = n; j > 0; j--) {
> self.moveBy(i,0);
> self.moveBy(-i,0);
> }
> }
> }
> }
> function shake_y(n) {
> if (self.moveBy) {
> for (i = 10; i > 0; i--) {
> for (j = n; j > 0; j--) {
> self.moveBy(0,i);
> self.moveBy(0,-i);
> }
> }
> }
> }
> //-->
> </SCRIPT>
>
>

David Stiller

2005-06-16, 7:26 pm

> You need to add one of the following to the body tag to make
> it work when the page is loaded in the browser.
>
> onLoad="shake_xy(SOME_NUMBER);"


Or invoke the JavaScript from getURL() to make it shake whenever you
like.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."


Da [ { ? ??

2005-06-16, 7:26 pm

I like that idea to invoke it when I like, but how do i implement the url()? In flash or i can do it in dreamweaver? Excuse me for my lack of knowledge in this situation, but I'm trying to learn..
David Stiller

2005-06-16, 7:26 pm

> I like that idea to invoke it when I like, but how do i implement the
> url()? In flash or i can do it in dreamweaver? Excuse me for my lack
> of knowledge in this situation, but I'm trying to learn..


One of the best places to start learning is in the ActionScript Language
Reference. Start by looking up the getURL() function, which contains sample
code on how to invoke JavaScript functions.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."


Da [ { ? ??

2005-06-16, 7:26 pm

Ok.. I did something wrong.. I have too much code and don't know which one
operates the progrss bar because it's not functioning... Can you help me
simplify this code.. I have a progress bar and a loader that I want to function
while my animation downloads on the main page.. I noticed that it also prompts
some computers that doesn't have flash or shockwave on thier pc.. Does that
influence the animation of the progress bar and loader in any way? Will it
still be able to function?

Anil Natha

2005-06-16, 7:26 pm

Da [ { ? ?? wrote:
> Ok.. I did something wrong.. I have too much code and don't know which one
> operates the progrss bar because it's not functioning... Can you help me
> simplify this code.. I have a progress bar and a loader that I want to function
> while my animation downloads on the main page.. I noticed that it also prompts
> some computers that doesn't have flash or shockwave on thier pc.. Does that
> influence the animation of the progress bar and loader in any way? Will it
> still be able to function?
>


If the user's machine does not have the proper flash player to
successfully run everything within your movie, it does effect the
playing of the swf.

Let's say you have a componenet that was developed for F7 (Flash 7);
however, you have other items that will work fine in F6 or older. Now
let's say a user that has FP6 (Flash Player 6) or older tries to view
this movie, they may experience problems with it because your componenet
may use code or properties that are only available in FP7.

You should always do a Flash Version check before loading the base flash
movie. And then if they have flash, continue playing the movie, if they
don't, redirect them to an alternate page.
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews