Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Honorary 'Adroit' Mechanic
Picture of BruceM
Posted
Hi,

Webngine beta. .

Some (many) months ago you indicated an unsupported js function call that would allow me to re-run an animation. That worked just fine.

I'm now interested in adding a pause/unpause button to the animation. Any thoughts on how this might be best approached? The animation is basically a web based presentaion consisting of approximately 40 timed objects - a pause buuton would help the non speed-readers among our users. In an ideal world there'd be an undocumented js function call . . Smile

Thanks

-Bruce
 
Posts: 302 | Location: London - UK | Registered: May 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
VM Staff
Picture of Harpo
Posted Hide Post
Unfortunatley there is no underlying pause/resume function. This might be more than you are up for, but here what the developers said:

You need to modify the frameloop() function on the page in question to make such an effect. Basically you would need a control statement around the doObjectList() function so that it was not called during pause.

Rememeber that any of the underling code could (and problably will) change in future releases.
 
Posts: 3215 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Adroit' Mechanic
Picture of BruceM
Posted Hide Post
Thanks Harpo. That worked just fine. The ammendments have been made. It's been tested and is now in production. Smile

If anyone else is interested in this method the code is below. Note that it must be designated 'BELOWBODY' to ensure it replaces the WebEngine standard function frameloop().

<script>
 //unsupported amendment to webengine core function
var pauseflag=false;
function frameloop()
{
  if(!pauseflag) doObjectList();
  tmID = window.setTimeout("frameloop();", waitTime, "JavaScript");
}
function pauseit()
{
  pauseflag=true;
}
function startit()
{
  pauseflag=false;
}
</script>
  


An action of javascriptRazzauseit() will pause the animation whilst javascript:startit() will continue the animation .

-Bruce
 
Posts: 302 | Location: London - UK | Registered: May 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Adroit' Mechanic
Picture of BruceM
Posted Hide Post
that should read
javascript:pauseit()  
looks like
:p  
produces Razz Cool
 
Posts: 302 | Location: London - UK | Registered: May 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Adroit' Mechanic
Picture of BruceM
Posted Hide Post
I thought that my solution above was what was needed- but seems not.

What I discovered was that although the display paused, when restarted it did a catch up which looked odd and tended to disrupt the flow of images. This was caused by doObjectList() (which is a core webengine function) using the Date() function.

I have a solution though. It involves a bigger hack than before. I'd not normally post something like this - but having started it seems wise to correct the previous post. - it might save someone a few headaches. If you want to see it in action go to

workhaven.com

and select 'how it works' from the menu or alternatively the animated example on the main page. If you find any bugs let me know!

The code below should replace the code outlined in previous posts.

-Bruce

<script>
//unsupported amendment to webengine core function
var pauseflag    = false;
var datevariance = 0;
var pointInTime  = new Date();

function frameloop()
{
  if(!pauseflag) doObjectList(datevariance);
  tmID = window.setTimeout("frameloop();", waitTime, "JavaScript");
}
function pauseit()
{
  if(!pauseflag)
  {
    pauseflag=true;
     //record date point in time for doObjectList()
    pointInTime= (new Date()) - datevariance ;
  }
}
function startit()
{
     if(pauseflag)
     {
        //establish no time variance from current time
       datevariance= (new Date()) - pointInTime;
       pauseflag=false;
     }
}
function restartit()
{
  datevariance=0;
  pauseflag=false;
  Setup();

}
function doObjectList(datevary) {
         //variable datevary added to allow pause/unpause - unsupported amendment
	curDate = (new Date()) - datevary;
	tickTime = (curDate - strDate) * 0.1;
	frmTime++;

	if(newPage != 0) window.location=WALink[newPage];

	newPage = 0;
	if(pageTime >= 0)
	{
		tmCount++;
		if(tmCount > pageTime * tickTime) 
		{
			window.location=pgLink;
			pageTime = -1;
		}
	}
 
	if(lmx == smx) smx = -99999;
	if(lmy == smy) smy = -99999;
	if(lky == sky) sky = " ";
	llt = 0;
	if((llm & 2) == (slm & 2)) slm = (slm  & ~2);
	if((llm & 1) == (slm & 1)) slm = (slm  & ~1);
	lmx = smx;
	lmy = smy;
	lky = sky;
	llm = slm;

	MoOvrTst();

	for(nob=0; nob < pageObj; nob++) {
//		ref = pObjLst[nob];
		gcx = 0;
		gcy = 0;
		cobj = pObjLst[nob]
		Cgrp = ob[cobj].grp;
		if(!Cgrp) doObject(cobj);
	}
}
</script>
 
Posts: 302 | Location: London - UK | Registered: May 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
VM Staff
Picture of Derry
Posted Hide Post
Great looking site. Good examples of the use of DHTML for interactive animation.

Small point: you may want to disable the nasty IE toolbar that displays over larger images, it obscures the presentation at times.

In WE, go to the Page Editor > Special Effects tab, and be sure that 'no copy image toolbar' is checked.


- Derry
 
Posts: 4167 | Location: Toronto, Canada | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
VM Staff
Picture of Harpo
Posted Hide Post
Thanks for letting everyone know.

Just to emphasize, as you pointed out, it is an unsupported change to the core code. It may not work on future versions.

The good news: future versions of the core code may include built-in pause, resume and a few other commands
 
Posts: 3215 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Adroit' Mechanic
Picture of BruceM
Posted Hide Post
Derry,

Thanks for the tip - I'll implement it.

Harpo,

Given that the next version of webengine will presumably be as a bolt on to sitespinner rather than the stand alone tool it currently is, which from my perspective makes it a much more significant release than usual; any idea of ETA timescale - just wondering if I should be reserving time to trial it this year or next.

Also, do we expect the next webengine release to be backwardly compatible?


-Bruce
 
Posts: 302 | Location: London - UK | Registered: May 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
VM Staff
Picture of Harpo
Posted Hide Post
Hi Bruce,

I don't have a release date or other details. I will try to get some more information for you.
 
Posts: 3215 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.