|
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
Hello there
I was looking for some information. If I could direct you to the following site http://smacie.com/randomizer/simpsons/homer.html?Homer.x=93&Homer.y=217 first, I wanted to know how this site works.
Is it loads of different pages linked together?
Or is it one page with a database behind it?
I'm interested as I have a similar idea for a website I am currently working on. I'm using Dreamweaver MX. If there is anything you can help me with it would be appreciated.
Edited by jonnymac1979 on 19/05/2004 21:16 (server time).
|
|
gollum
regular
Reg'd: Wed
Posts: 278
|
|
http://smacie.com/randomizer/simpsons/homer.html?Homer.x=93&Homer.y=217 I imagine this is done on the serverside somehow. It would be quite easily to achieve. You could also do it in javascript on the client (browser) side. You could store all the quotes in an array and when the image is clicked, you could have the script pick one at random and display it.
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
Cheers for your help mate, I appreciate it but i'm a complete novice to all of this. What you just wrote has flew over my head!!!!
What does that mean to a simpleton like me? I've got Microsoft Access 2002 aswell if thats applicable!!!
Cheers.
|
gollum
regular
Reg'd: Wed
Posts: 278
|
|
I have never used dreamwaever Im afraid, so I cant help on that front. I wouldnt worry about the database right now, that has to run on the server that hosts your website. It would require a Javascript to pick one of however many quoutes that are contained within a variable in the script. Here are some scripts that produce random results that can be put in your code. If you look on google, you will find a lot there. If you have any more queries, pm me.
HTH
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
Hello
I hope nobody minds. I've decided to bump this thread due to the fact that the website I am currently working on involves the exact problem I was listing above.
I have inserted some javascript into my site and it does nothing.
Basically, I am trying to achieve the EXACT same effect as this website.
I am having no luck. Can somebody help me please.
www.liverpoolaremagic.co.uk
|
dungargon
Reg'd: Mon
Posts: 355
Loc: wu towers, london
|
|
Are you trying to do it the Homer way or or gollum's Javascript way?
Looks to me like the homer page uses a java server page (on the server) to pull the quote out of a db, clicking homer just reloads the page.
If you want to do it the Javascript way, perhaps you could post a link or your script...
"The oppressed are allowed once every few years to decide which particular representatives of the oppressing class are to represent and repress them." Karl Marx
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
Thank you very much indeed for getting back to me so soon.
The page isn't up live on the internet yet. If you click the link in my signature you will see the site I am building but it's just a page up to now.
The method I am using is the Homer method.
By that I mean I am clicking on an image (just a button I made) and I want to display a random quote. My site has nothing to do with The Simpsons. I am in work right now but if you like, tonight when I am home I could publish the page on my webspace and PM you the details of it so you could check it out for me.
I have also found this tutorial this morning and I think I will also try this tonight as I have Flash MX 2004 on my PC at home, even though I have NEVER EVER used it. I'm bound to have trouble with that as well.
Database Driven Flash Tutorial
Any suggestions and ideas are welcome thanks.
John
www.liverpoolaremagic.co.uk
|
dungargon
Reg'd: Mon
Posts: 355
Loc: wu towers, london
|
|
If you're using php the hosted web page won't tell me much - i'll only see the output html. it'd be better if you could pm/post your script, so we can see why it's not doing anything...
"The oppressed are allowed once every few years to decide which particular representatives of the oppressing class are to represent and repress them." Karl Marx
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
Thanks a lot, I'll sort it out later when I get home from work.
www.liverpoolaremagic.co.uk
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
I have inserted the following Javascript in my site.
<SCRIPT LANGUAGE="JavaScript"> //store the quotations in arrays quotes = new Array(6); authors = new Array(6); quotes[0] = "a"; authors[0] = "a"; quotes[1] = "b"; authors[1] = "b"; quotes[2] = "c"; authors[2] = "c"; quotes[3] = "d"; authors[3] = "d"; quotes[4] = "e"; authors[4] = "e"; quotes[5] = "f"; authors[5] = "f";
//calculate a random index index = Math.floor(Math.random() * quotes.length);
//display the quotation document.write("<DL>\n"); document.write("<DT>" + "\"" + quotes[index] + "\"\n"); document.write("<DD>" + "-- " + authors[index] + "\n"); document.write("</DL>\n");
//done </SCRIPT>
(I've substituted the quotes for the alphabet)
Now, this works every time the page refreshes as when I hit F5, the quote changes. That is fair enough, but not what I'm looking for exactly. I have included a button on my page (similar to the Homer situation on the above example) and I want the quote to change whenever the user hits the button.
I'm sure it's not that difficult. All help will be appreciated.
Thank you.
www.liverpoolaremagic.co.uk
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
If I'm not mistaken, simply inserting javascript:location.reload() as a hyperlink to the button I'm using will refresh the whole page, but that will mean reloading the images aswell won't it not?
I want it to just change the quote. I'm nearly there, I can smell it, and then I promise to leave you all alone!!!  
www.liverpoolaremagic.co.uk
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
Hello
Just bumping this thread agin.
I am definitely having trouble with this part of my website. I now have it up on the internet and I have to say that I am very far from happy with it. How the person who created the Homer Simpson site (link is above in another post) made it is beyond me. Even when I check the source code out, the random quotes are not listed.
In my website, they are listed in a Javascript array. That's no good to me because I am having to refresh the page to get a different quote. It gives a sort of blinding flash every time I refresh the page and that will drive people away from the site.
I was wondering what people think of this idea.
Why don't I put a database on the server? Surely there is a script out there somewhere that will pick a random quote from a database application. I've been hearing good things about MySQL.
Does anybody suggest that this is the way forward for me?
PS If you want to have a look at my page in question, could you give me a short PM as I don't want to give out the full URL publically yet as it's still a work in progress.
Thanks for your opinion in advance.
|
jonnymac1979
regular
Reg'd: Tue
Posts: 519
Loc: Liverpool
|
|
Can anyone belive I am still encountering problems with this?
I have followed this website down to the last detail and it STILL won't work on my site.
Can anyone give a walkthrough of this to me, as if they were talking to an infant?? I think I need it!!!
|