Author Topic: BID REQUEST :) 'autoload' URL after xx seconds on page with no click  (Read 2419 times)

john.senna

  • Newbie
  • *
  • Posts: 7
LOVE this script - KEEP UP THE GREAT WORK ;D

Say I have a 4 page flipbook with say COLORS.  And I go to www.demo.com/blue.php where I find the BLUE page with a flipbook open to the blue page.  

Then I start to flip around and find the RED fb page.  Right now I have a link that I can click and get to www.demo.com/red.php and works great..

BUT anyway for that to happen without a click??  Meaning.. say if I keep looking at that same red flipbook page, and the URL would load on its own and take me to red.php *witout* any click?
« Last Edit: August 31, 2009, 06:32:19 pm by john.senna »

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: 'autoload' URL after xx seconds on page? no click?
« Reply #1 on: August 17, 2009, 04:54:21 pm »
You could do that using JavaScript.
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

john.senna

  • Newbie
  • *
  • Posts: 7
Re: 'autoload' URL after xx seconds on page? no click?
« Reply #2 on: August 17, 2009, 04:59:18 pm »
thanks for the note.  So we can include a jScript within the XML?  I'm a bit lost anywhere you could point me in terms of an example?

p.s. like the youtube vids  :)

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: 'autoload' URL after xx seconds on page? no click?
« Reply #3 on: August 17, 2009, 05:10:12 pm »
There's a file called megazine.js, which offers quite some access to the engine.

You can write your own little JS which listens to page changes and starts a timer.
When the timer fires and the page was not changed in the meantime, you could
trigger the page load via JS.

Code: (javascript)
  1. MegaZine.onPageChange = function(page) {
  2.    // start timer
  3. }
  4. function timerhandler() {
  5.    // check if page was changed (or kill the timer on page changes, haven't been playing with
  6.    // JS for a time now) and if not trigger the page load
  7. }
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

john.senna

  • Newbie
  • *
  • Posts: 7
Re: 'autoload' URL after xx seconds on page? no click?
« Reply #4 on: August 17, 2009, 07:31:59 pm »
THANK YOU!  I know you are busy with the new release but would be happy to pay you or anyone here on the forum to help me.  I have a test php site with the flip-book and trying to figure out how when someone turns the page, after, say a few seconds, the new php page loads. 

Is there a 'paid work' category here?

Hans Nücke

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 787
  • MegaZine3 Sales Manager
Re: 'autoload' URL after xx seconds on page? no click?
« Reply #5 on: August 17, 2009, 10:47:30 pm »
Interesting idea...
There are others (I know of at least two) looking for resources capable to give support; and willing to pay for it.
Since we have no free capacity, this could/should come from the community.

Let's see, if at least 1...2 suport this idea we might open such category (search and find)

john.senna

  • Newbie
  • *
  • Posts: 7
BID REQUEST = 'autoload' URL after xx seconds on page w/ click
« Reply #6 on: August 31, 2009, 06:31:46 pm »
Hey All.  Wanted to see if anyone could help us with this. 

Here is the demo site --> http://205.234.107.35/27/index.php

basically, if you go to above URL, you can see, when you flip the page from red to say blue, if you then CLICK on the Blue1 or Blue2, if calls the page /blue.php.

What we need:
What I want is for when you flip the page, after a slight delay, it calls /blue.php, WITHOUT any CLICK.

karl

  • Newbie
  • *
  • Posts: 12
Re: BID REQUEST :) 'autoload' URL after xx seconds on page with no click
« Reply #7 on: September 01, 2009, 04:42:30 pm »
Hi,
Maybe this is what you are looking for ...
Make sure megazine.js is included
something like this ...
<script type="text/javascript" src="megazine.js"></script>
Put the following code after swfobject in the <head> tag of your page.

// Basic example using JS
// ----------------------
var tID;       // timer id
var tRes=1000; // timer resulution in ms
var tMax=10;   // Seconds before timer expires
var tP=0;

setTIMER(tMax, tRes); // start the timer

function setTIMER(_m, _r) {
  tP=0; tID=setInterval('__chkTm('+_m+')', _r);
}
function resetTIMER(_m, _r) {  tP=0; }
function stopTIMER() { clearInterval(tID); }
function __chkTm(_max) {
 if (tP++>_max)  {
  tP=0;
  // --- jmp to local book page ---
  MegaZine.getMovie().gotoPage(10, 0);
  // --- jmp to remote php book page ---
  // window.location.href=”http://www.domain.com/redbook.php?page=xx";
 }
}
MegaZine.onPageChange = function(page) {
  resetTIMER(tMax, tRes); // if page was turned by user start timer again
}

Kindest regards, Karl

john.senna

  • Newbie
  • *
  • Posts: 7
Re: BID REQUEST :) 'autoload' URL after xx seconds on page with no click
« Reply #8 on: September 04, 2009, 12:28:16 pm »
Karl, THANKS!! so much.  We are closer...

Take a look (new URL):  http://205.234.107.35/karl/index.php

Added below.. BUT it FLIPS to blue.php automatically after timers goes, with no flip-book turn from user.. Any ideas?  I know it something we did..  below is inserted code and here is entire index.php  http://yourpaste.net/2926/karlindex


Code: [Select]

//new stuff from karl
// Basic example using JS
// ----------------------
var tID;       // timer id
var tRes=500; // timer resulution in ms
var tMax=10;   // Seconds before timer expires
var tP=0;

setTIMER(tMax, tRes); // start the timer

function setTIMER(_m, _r) {
  tP=0; tID=setInterval('__chkTm('+_m+')', _r);
}
function resetTIMER(_m, _r) {  tP=0; }
function stopTIMER() { clearInterval(tID); }
function __chkTm(_max) {
 if (tP++>_max)  {
  tP=0;
  // --- jmp to local book page ---
  MegaZine.getMovie().gotoPage(4, 0);
  // --- jmp to remote php book page ---
  window.location.href="http://205.234.107.35/karl/blue.php#/4";
 }
}
MegaZine.onPageChange = function(page) {
  resetTIMER(tMax, tRes); // if page was turned by user start timer again
}
</script>

karl

  • Newbie
  • *
  • Posts: 12
Re: BID REQUEST :) 'autoload' URL after xx seconds on page with no click
« Reply #9 on: September 04, 2009, 01:33:23 pm »
Hi John,
User flips a page and you want to auto-flip to another one after a delay ? Right ?
Here's a very basic  example for one page,
Notice that you can auto-flip in the same book or auto-flip to a page in another book.
You have to comment out the one you dont't use.
This is set as;
 // --- jmp to local book page ---
   MegaZine.getMovie().gotoPage(20, 0);
or
 // --- jmp to remote book page ---
   window.location.href=URL;

copy the following code in you page after swfobject

var tID;              // timer id
var tRes=1000; // timer resulution in ms
var tMax=10;   //  timer expires after in seconds
var tP=0;
var FlipThisPage=10;  // make this Page auto flipable to another one


function setTIMER(_m, _r) {  tP=0; tID=setInterval('__chkTm('+_m+')', _r); }
function resetTIMER() {  tP=0; }
function stopTIMER() {  clearInterval(tID); }
function __chkTm(_max) {
 if (tP++>_max)  {
  tP=0;
  // --- jmp to local book page ---
  MegaZine.getMovie().gotoPage(20, 0);
  // --- jmp to remote php book page ---
   window.location.href='http://205.234.107.35/27/index.php#/8';
}
}
MegaZine.onPageChange = function(page) {
  if (page==FlipThisPage)
    setTIMER(tMax, tRes);
  else
    stopTIMER();
}


Best regards, Karl

john.senna

  • Newbie
  • *
  • Posts: 7
Re: BID REQUEST :) 'autoload' URL after xx seconds on page with no click
« Reply #10 on: September 04, 2009, 01:39:54 pm »
Karl, nahh, I have you confused, just like I am  ;D

1. User goes to index.php, see's red, stays red. 
2. then user flips to blue in flipbook
3. after a second URL automatically goes to blue.php

so basically when the user flips the flip-book page, after a slight delay, the URL page changes...    does that make sense?

THANK YOU SO MUCH ON THIS!!!


karl

  • Newbie
  • *
  • Posts: 12
Re: BID REQUEST :) 'autoload' URL after xx seconds on page with no click
« Reply #11 on: September 04, 2009, 01:51:07 pm »
Well, the example above should do that just give FlipThisPage variable the page number you wanna auto-flip to, try it out.
Regards Karl