Random swf on intro page ..help appreciated

OK boyz and girlz, I’m no techy, as I browse around this forum I realize I don’t belong here. Seems like fun and nice folks though so me thinks I’ll be bold and selfishly as for some help:

Short story:
In way over my head and need help loading random swf files into the ‘intro’ page to my home page

Long story:
after struggling went here: http://www.kirupa.com/developer/actionscript/loading_random_movie.htm
and while it seems easy enough, i’ve struggled for way too long and am in way over my head.

I’m attempting to load one of 10 random movies into this page:
http://www.goraiders.org/bike/

i’ve set up a test directory with the 10 swf files and done nothing but frustrate myself.

If anyone wants to help me out for the purpose of good karma …i’d be much appreciated and certainly will throw my access to good karma your way :slight_smile:

If anyone on here wants to take this as a project to earn a dollar or two i’d certainly be open to paying for a soltion and/or the mentoring to get where it needs to be.

No, I’ll never be a contributor to this forum in technical savy, not my cup of tea, but I appreciate any help here and fortunately for me, i ride moto-bikes much better than I fumble around on the computer. :slight_smile:

chees from reno …John

oh, test directory here:
http://www.goraiders.org/bike/testSWF_random/

There’s no reason why it won’t work (although you won’t be able to test it locally without getting a security violation).

You did include a dummy movieclip called movieTarget on your stage to hold the random movies when they’re loaded? And I presume you also edited the filename array to include the names of your random clips and also the path variable?

Either way, it does work and a sample is attached with the following amendments:

filename = ["1.swf", "2.swf", "3.swf","4.swf", "5.swf", "6.swf","7.swf", "8.swf", "9.swf", "10.swf"]; 
path = "http://www.goraiders.org/bike/testSWF_random/"; 
i = filename.length; 
k = Math.floor(Math.random()*i);
trace (path+filename[k]);
loadMovie(path+filename[k], movieTarget); 

You’ll need to alter the stage dimensions of the attachment to match those of your random movies, but that’s about it. You might also want to consider some further improvements:

  1. Your target SWFs are quite large. I suspect that this is because they contain large images that haven’t been optimised. Doing this would reduce the filesize (and the delay waiting for them to download) substantially.
  2. If they still take a while to download, you might want to include a message to indicate that a file is being loaded.
  3. I see from your test directory that you’re using SWFObject. If so, this is the code to embed the SWF in your page:
<HTML>
<HEAD>
<TITLE>Random Movie</TITLE>
</HEAD>
<BODY bgcolor="#000000">
<center>
<h1>
<font color="#FFFFFF">test page to random load SWF files</font></h1>
<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
   var fo = new SWFObject("randommovie.swf", "random", "550", "400", "8,0,0,0", "#000000");
   so.addParam("quality", "best");
   so.addParam("loop", "true");
   so.addParam("menu", "false");
   so.addParam("bgcolor", "#000000");
   so.addParam("allowscriptaccess", "always");
   so.write("flashcontent");
</script>
</center>
</BODY>
</HTML>

First, thank you very much for taking the time to help, and I realize I’m D.U.M. (dumb) when it comes to this stuff.

I’ve attempted to make the changes you’ve outlined, also let me reply to your comments:
~*

You did include a dummy movieclip called movieTarget on your stage to hold the random movies when they’re loaded?
I have no idea what that means or what I did or didn’t do :frowning: sorry
~

You’ll need to alter the stage dimensions of the attachment to match those of your random movies
I think I’ve done that (640x505)
~

  1. Your target SWFs are quite large. I suspect that this is because they contain large images that haven’t been optimised. Doing this would reduce the filesize (and the delay waiting for them to download) substantially.
  1. If they still take a while to download, you might want to include a message to indicate that a file is being loaded.
  2. I see from your test directory that you’re using SWFObject. If so, this is the code to embed the SWF in your page:
    *-Yes, want to show about 400images (and growing) my though at this time is to make 10slideshows and have them randomly load.

On my original page, that was created by a tool, the download is done in the background while the slideshow plays and this download happens faster than the slideshow goes. I felt not a problem? but open to better ideas.
-I have SWF object in there as one of my desperate attempts to make things work, I don’t even know what it does or is supposed to do. I just threw that file in the directory like a blind monkey at a keyboard typing Shakespeare.

Some of my problem is that I attempted to lean how to do this random thing …while attempting to copy the source of this page that was (for the most part) created within an automated tool. (BTW this swf file is about 50meg)

Again appreciate your help, sorry I’m way out of my expertise and skillset on this. Computer stuff is not my gig.

If you want to continue to help, I’ll be appreciative and will do whatever to help facilitate you not wasting more time than necessary (phone call?, direct email? …whatever is easy for you.)

thanks from Reno …John

[quote=renojohn;2355844]First, thank you very much for taking the time to help, and I realize I’m D.U.M. (dumb) when it comes to this stuff.

[COLOR=navy]No problem.[/COLOR]

I’ve attempted to make the changes you’ve outlined, also let me reply to your comments:
~I have no idea what that means or what I did or didn’t do :frowning: sorry

[COLOR=navy]I’m guessing that would mean no. The movieclip (targetMovie) acts as a placeholder into which your random movies are loaded. Without it, the script would fail.[/COLOR]

~I think I’ve done that (640x505)

[COLOR=navy]Good. If not, you change them in the FLA by clicking on Modify, Document and altering the width/height. Remember that you also need to change the dimensions in the SWFObject embed text:[/COLOR]
var fo = new SWFObject(“randommovie.swf”, “random”, “[COLOR=red]550[/COLOR]”, “[COLOR=red]400[/COLOR]”, “8,0,0,0”, “#000000”);

~-Yes, want to show about 400images (and growing) my though at this time is to make 10slideshows and have them randomly load.

On my original page, that was created by a tool, the download is done in the background while the slideshow plays and this download happens faster than the slideshow goes. I felt not a problem? but open to better ideas.

[COLOR=navy]It’s not a problem although there are probably better ways to do this, for example changing the slideshows so that they display random images. The point I was making is that it always helps to optimise any images that you want to include in an SWF because this can reduce the filesize by 90% in some cases…with a consequent reduction in the time it takes for the user to download it. Do a Google search on graphic optimisation and you’ll find lots of useful information including online optimisers that you can use. Not doing this is probably the reason why that one SWF is 50Mbs in size![/COLOR]

-I have SWF object in there as one of my desperate attempts to make things work, I don’t even know what it does or is supposed to do. I just threw that file in the directory like a blind monkey at a keyboard typing Shakespeare.

[COLOR=navy]SWFObject won’t help your actionscript to work (yes, I did see that you’d included the AS code in the HTML file) rather it’s there to embed an SWF into a HTML page using javascript instead of the traditional OBJECT and EMBED tags.[/COLOR]

Some of my problem is that I attempted to lean how to do this random thing …while attempting to copy the source of this page that was (for the most part) created within an automated tool. (BTW this swf file is about 50meg)

[COLOR=navy]Automated tools can be useful but, to be honest, in most instances they can be incredibly bloated and also difficult for a novice to alter. It’s usually far better to design the Flash file yourself.[/COLOR]

Again appreciate your help, sorry I’m way out of my expertise and skillset on this. Computer stuff is not my gig.

Which probably discounts my previous thoughts about design?

If you want to continue to help, I’ll be appreciative and will do whatever to help facilitate you not wasting more time than necessary (phone call?, direct email? …whatever is easy for you.)

thanks from Reno …John[/quote]

It would definitely help to be a little more specific about your requirements. For example, do you actually want to load random SWF’s onto your intro page, or just random images? I’m still a tad confused about that as you mention loading 400+ images. Will there be other content on the intro page?

Give it some thought and, if you think you need someone to devote some time to solving this for you, you could place a request in the job offers part of the forum. I can provide assistance here, subject to my own time constraints, and I’m sure there are plenty of other people that can assist further.

It would definitely help to be a little more specific about your requirements. For example, do you actually want to load random SWF’s onto your intro page, or just random images? I’m still a tad confused about that as you mention loading 400+ images. Will there be other content on the intro page?

Give it some thought and, if you think you need someone to devote some time to solving this for you, you could place a request in the job offers part of the forum. I can provide assistance here, subject to my own time constraints, and I’m sure there are plenty of other people that can assist further.
OK on all of your help and I’ll use you thoughts and continue to play and attempt to learn. I VERY MUCH APPRECIATE IT

Your quote above brings up the wider goal and me thinks with my very limited knowledge of what is possible I really should take a step back and throw out my goals and get help from people in the “know”. I think it best to post what I hope to do (I was not familiar with the job area and will post there). I’m a rookie with very limited skillsets and I’m getting in over my head :slight_smile:

My post in the job area, will be as follows:

Short Story:
I’m looking for an ‘intro’ page for my amateur/hobby website. I have aprox 400images (and growing) that I’d like to load on a random basis for as long as the viewer wants to sit there and view them before going to the 'home page"
current page is here: http://www.goraiders.org/bike/

Long Story:
I’ve meddled a bit but I am in over my head with what I’d like to to and am soliciting help.
I did dabble with php random image and for whatever reason (me?), when the next image attempted to load i got all kinds of weird issues.
I then (current status of intro page) did swf movie as a slide show. I must admit the clean nature of swf movies/slideshow seemed to this rookie to be a cleaner look. However, not random though, -so the movie always starts out the same -boring for viewers. I then thought perhaps a half-butt solution would be to break up the many images into many swf slide shows and have those swf files randomly load.

not being very creative myself :slight_smile: , the intro page idea came from the cool intro page on this(clicky) professional site. I’d like to do similar but need not be as fancy.

Not rich and famous but would gladly pay for someone’s expertise to create or help with a solution. Thanks much!
John A
renojohn2007 @ goraiders.org

( job post here-clicky )