Preloading SWF files

  • FIGIDIGI
  • Newbie
  • Newbie
  • FIGIDIGI
  • Posts: 7

Post 3+ Months Ago

:D

Looking for a solution to a problem that will probably be a no-brainer for u guys. It's about preloading:

HISTORY
trying to find preloading for
pictures
sounds
swf flash files
1. and 2. I found out myself using css. works perfectly.
with swf i've trying my socks off... i don't succeed, unfortunately.

JAVASCRIPT
I tried javascript. I have a feeling I can do it with that one, but it seems to have a bug/error. Maybe it is just altering 1 line and i'm off...
Can you help me out?
I don't care HOW i preload, as long as the client finds the swf on their drive instead of the net.

EXAMPLE OF THE BUG-SCRIPT
--------------------------------------------------------------------------------

Code: [ Select ]
<!-- PRELOADING flash FILES JAVASCRIPT -->

<script type="text/javascript">

// <![CDATA[

// this function should go in the head of your document.

function onloadHandler(){

loadImages(""flash/gedicht1.swf",

"flash/gedicht2.swf",

"flash/gedicht3.swf", ");


// other code called onload goes here.

}

// ]]<

</script>


<!-- PRELOADING flash FILES JAVASCRIPT -->

</head>

<body onload="onloadHandler()">
  1. <!-- PRELOADING flash FILES JAVASCRIPT -->
  2. <script type="text/javascript">
  3. // <![CDATA[
  4. // this function should go in the head of your document.
  5. function onloadHandler(){
  6. loadImages(""flash/gedicht1.swf",
  7. "flash/gedicht2.swf",
  8. "flash/gedicht3.swf", ");
  9. // other code called onload goes here.
  10. }
  11. // ]]<
  12. </script>
  13. <!-- PRELOADING flash FILES JAVASCRIPT -->
  14. </head>
  15. <body onload="onloadHandler()">


--------------------------------------------------------------------------------


As you can see I treat them as images,.. ?? not good huh?

I hope you can help me out.

Thanx.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Jerome
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

preloaders for flash are actually part of the file/movie. and it's actually
a lot easier than you think, and very similar to the javascript you posted
above. Check out this tutorial, it's the best one out there IMO -

http://www.kirupa.com/developer/mx/perc ... loader.htm
  • FIGIDIGI
  • Newbie
  • Newbie
  • FIGIDIGI
  • Posts: 7

Post 3+ Months Ago

Okay, thanx for the tip!!
:) This site was exactly what u said it was. Perfect and understandable. So not difficult to make the preloader, actually quite fun to do that yourself. but sorry ... in my case it is useless...
:shock: (oh goody...lol)

My site, well actually the clients site, is in html. so every page is html and read into a frame.
now I wanna preload 3 small flashfiles 'underneath - as a matter of speach' the actual frame, so that when u open the actual pages, (4, 5 and 6 to b exact) the files are already loaded and in your temp folder.
So there is no OTHER flash to preload them with... That's my fault, cos I wasn't clear about it in the first place... sorry :cry:

That's why my request was so unusual, I want to preload "objects " and html knows objects, so html or javascript 4 that matter, must have a capacity to download bytes without actually looking at the extension 'swf'. That was my aim, but I need to have the frases right otherwise my script isn't executed.

Hope there still is some kind of 'download objects without displaying' frase / script.

Bye 4 now.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Figidigi
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

you could still do it. You can load the external swf's from a "hidden"
flash movie on the main page of the site. Make the "hidden" movie the
same color as your background and blend it in. In the movie, load the
swf's so when they get to the pages they're on they will load right up.

The visitor wouldn't ever know. ;) :D
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I'm just throwing this out as an idea, because I never thought of trying it with an .swf file, but this script works perfect for any images for rollover pre-loads , so my first guess would be that it would also preload the flash files. *shrug -- I don't know -- worth a shot if you're interested in trying it. In addition to the script below, you need to be sure to add:
Code: [ Select ]
onload="preLoad()"

to your body tag. Just change the image relative links below to your flash files. Elliminate or add what you need, but an important note is to make sure this: if(count == 7){ equals the total number of files you are trying to preload.


Code: [ Select ]
<script language="JavaScript1.2" type="text/javascript">
<!--Hide from older browsers
//begin preload script
   var count = 0;

   function preLoad() {
   one = new Image();
   one.onload = loadCheck;
   one.src = "homee.jpg";


   two = new Image();
   two.onload = loadCheck;
   two.src = "buye.jpg";

   three = new Image();
   three.onload = loadCheck;
   three.src = "selle.jpg";
 
  four = new Image();
   four.onload = loadCheck;
   four.src = "rtoe.jpg";
 
  five = new Image();
   five.onload = loadCheck;
   five.src = "apartmentse.jpg";
 
  six = new Image();
   six.onload = loadCheck;
   six.src = "investe.jpg";
 
  seven = new Image();
   seven.onload = loadCheck;
   seven.src = "linkse.jpg";
 


   }
   function loadCheck() {
   count++;
   if(count == 7){
   preLoad();
   }
   }
//end hiding from older browsers -->
</script>
  1. <script language="JavaScript1.2" type="text/javascript">
  2. <!--Hide from older browsers
  3. //begin preload script
  4.    var count = 0;
  5.    function preLoad() {
  6.    one = new Image();
  7.    one.onload = loadCheck;
  8.    one.src = "homee.jpg";
  9.    two = new Image();
  10.    two.onload = loadCheck;
  11.    two.src = "buye.jpg";
  12.    three = new Image();
  13.    three.onload = loadCheck;
  14.    three.src = "selle.jpg";
  15.  
  16.   four = new Image();
  17.    four.onload = loadCheck;
  18.    four.src = "rtoe.jpg";
  19.  
  20.   five = new Image();
  21.    five.onload = loadCheck;
  22.    five.src = "apartmentse.jpg";
  23.  
  24.   six = new Image();
  25.    six.onload = loadCheck;
  26.    six.src = "investe.jpg";
  27.  
  28.   seven = new Image();
  29.    seven.onload = loadCheck;
  30.    seven.src = "linkse.jpg";
  31.  
  32.    }
  33.    function loadCheck() {
  34.    count++;
  35.    if(count == 7){
  36.    preLoad();
  37.    }
  38.    }
  39. //end hiding from older browsers -->
  40. </script>


Like I said, I don't know if that will work with Flash. I'd be curious if it does.
  • FIGIDIGI
  • Newbie
  • Newbie
  • FIGIDIGI
  • Posts: 7

Post 3+ Months Ago

oKAY, THIS SCRIPT ...
I got a good feeling about it...
I am pretty tired now, as I have been searching all day for a solution to display the content of txt files into html pages, so a client can update her website without having to worry about all the html tags and all...

I am gonna try the script and will definitely let u know about the results. Thank you for posting.

To the other replyer: I have been thinking about that same idea of an empy flash just to preload the otherones.... this is the same way of thinking that I use to solve (and did solve) all my other webproblems with.
If the script will not work- I can try that, If it works and if I get the hang of preloading that way - that works perfectly for me. As long as I know how to do it, i don't care how much time its gonna cost me, the result will be rewarding enough - yep , i am pretty easy to please

Thanx guys!! :D
U make a hardworking guy smile :-)

jerome (figidigi)
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

ATNO/TW - pretty sure that will work too :D

FIGIDIGI - good luck with it. let us know how it turns out and what you
did to get it to work. Looking forward to hearing back from you.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

*lol UNFLUX -- see...just goes to show that if the general public knew what we go through behind the scenes to get things to work so they could view their favorite websites without issues, they'd either be sending us tons of money or bowing before us. Personally, I'll skip the bowing part. However, I'll hold my hat out and let them toss the money in.
  • FIGIDIGI
  • Newbie
  • Newbie
  • FIGIDIGI
  • Posts: 7

Post 3+ Months Ago

ATNO

that is so true what u wrote,... People take lots of thigs for granted without actually realising the work people put in it. I'm a musician for a living. People think that u can record a song in about 2 or 3 hours.
lol;;;; if u r lucky that will be the amount of time u use up for a drumsoundcheck.

But back to the real thing -

I tried the script stated above. Sorry guys it didn't work - then I got thinking,,, it says 'image' but swf isnt an image, so I think I play smartass and change it into object, silly me. cos errors all over the place. I imidiately went to the store and bought a book on javascript -

so I can' t get it to run.... I didn't get any errors with the stated script, but the tmp internetfiles directory didnt show any preloaded flashfiles, so it just didn't load. I still have the idea its possible, maybe with php... gotta study on that one.

So I will try it the other way, preloading invisably so to speak...
I'LL BE BACK ..... 8)

F:I:G:I:D:I:G:I

PS: this is the greatest forum I went to so if u guys have sites please state or send the urls, cos I liked to see them.
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

aww man I was sure it would since it's just asking a file to load...hmm

well, i know for sure the invisible method works, but I'm surprised ATNO/TW's didn't. Disappoining. :(

ATNO/TW - I know exactly what you mean. And for a while there, I was
so fed up with people not appreciating my efforts and work that I stopped posting. Not only here, but other forums I was a part of as well.
But I realize that my skills don't improve if I don't stay on top of them all,
and that includes helping people out. I really do like helping people, it's
just a simple thank you every now and then would be nice.

Holding my hat out isn't a bad idea either ;)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

UNFLUX - Please allow me to be the first to say "thank you". Your help is appreciated by me, and I'm sure, many others here. And actually - I have to say, I probably learn just as much by helping folks as I do by asking questions or researching on my own, since a bulk of the time I do do a little research before answering. Oddly I seem to have this nack for finding solutions relatively easily.

In regards to the little problem...I must have been thinking too fast. When I offered the script, yes -- on the surface it seems simple enough, but then after realizing it didn't work, it's that little "src" thing that's gumming up the works since that's only used for images (my bad). My second thought would have been try object or applet -- but then I doubt that would call the file.

Probably best to work with the original solution and just go with an "invisible" preload file.
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

hehe aww shucks. *kicks a stone* :oops:

just doing my job sir. :D
  • FIGIDIGI
  • Newbie
  • Newbie
  • FIGIDIGI
  • Posts: 7

Post 3+ Months Ago

WOOOOOOOOOWWWWW...

I just saw your site (unflux) - man that is surely some great work.
I also saw the studio cloud 9 site, incredible.

you are really talented, money must be pooring in!

I also like the fact that u work with sounds as well.

From graphic point of view I missed just a tiny bitsy 'something crasy' we in holland say 'eigenwijs' Your site is so professional it might not stand out between the rest? I give it a fat 10 as it is, but would give it a 10 + if there was something extra like small crasy thing... *plum* I don't know how to translate it - like that u can really see its your work in a 'flash' ha ha

But don't read all this *plum* I wrote. I was baffled so great work!

ps: about all the earlier scripting thingies - MY CLIENT AGREED TO THE WORK AND IDEA'S - She'll pay my invoice . sigh - another months rent lol

see ya - figidigi (jerome)
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

thx for the compliments on my work. :D

glad to see that you've gotten the approval from the client. that's always
a big step in the process. good luck with it.
  • HEki
  • Born
  • Born
  • HEki
  • Posts: 1

Post 3+ Months Ago

HI,
i am new here, the topic is old but i have the same question, couse i cant find the answere to it :( sadly!
Image

i know all about preloading swfs file, however my .html page is setup with 3 induvidual .swf files. now useing a preloader on each doesnt do me any good, couse they load induvidualy. one after another :(
i have been looking for a script that would cache those 3 swfs, before the user gets to the actual .html ... and i found a solution and it works great in FireFox, on the other hand, the script doesnt work in IE! It works if i preload images, but it doesnt work for .swf files. In FireFox it works both ways, for images and for .swf files.

http://www.kirupa.com/forum/showpost.ph ... stcount=12

here is the actual code. Any tips, solutions, pointers are welcome, couse i have been traped for a whole week and it seems that when i found a solution i also find a new problem ...

please help me out :)
best regards,
heki

Post Information

  • Total Posts in this topic: 15 posts
  • Users browsing this forum: No registered users and 131 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.