Search…

X3 Photo Gallery Support Forums

Search…
 
hagai
Topic Author
Posts: 16
Joined: 13 Nov 2006, 10:55

javascript function to control the imagevue/slideshow

15 Nov 2006, 07:05

hi,

can we use javascript to control the imagevue / slideshow from outside of the flash object ?

let's say my flash object is:

<OBJECT id="test" classid="....

this script:

<script>
<function>
</script>

will go to picture 1.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

17 Nov 2006, 07:26

You can control the Slideshow by javascript, but not the Imagevue gallery.

Embed this javascript onto your page:
Code
<SCRIPT>
function getFlashMovieObject(movieName) {
  if (window.document[movieName]) {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1) {
    if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; 
  } else {
    return document.getElementById(movieName);
  }
}
function setcontrol(func){
	var flashMovie=getFlashMovieObject("slideshow");
  	flashMovie.TCallLabel("js_remote", func);
}
</SCRIPT>
You can then control the clip by the following javascript links:
Code
    <a href="javascript:setcontrol('previous');">previous</a>
    <a href="javascript:setcontrol('next');">next</a>
    <a href="javascript:setcontrol('toggleplay');">toggleplay</a>
Make sure you referr the correct instancenames, in the example "slideshow":
Code
var flashMovie=getFlashMovieObject("slideshow");
..
var so = new SWFObject("slideshow.swf", "slideshow", "800", "600", "7", "#103152");
 
hagai
Topic Author
Posts: 16
Joined: 13 Nov 2006, 10:55

17 Nov 2006, 11:40

thanks,
but can i go directly to a specific file name of image number ?
 
hagai
Topic Author
Posts: 16
Joined: 13 Nov 2006, 10:55

10 Dec 2006, 12:46

any way that it can be done ?!
to go with javascript to an image directlly and not by next/back ?

thanks.