471,108 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,108 software developers and data experts.

How to open a site on click of an image

274 100+
I have designed a gallery using XML FILE. File uploads the thumbnails and displays the big image on click of the image. I wan to open a site on click of the bigger image. Can someone help me how I can do that?
here is code:
Choped:

Expand|Select|Wrap|Line Numbers
  1. ......
  2. function callFullImage(myNumber) {   // call full image once the thumb is clicked
  3.  
  4.     myURL = myImages[myNumber].attributes.full_url; // name of the image to be opned
  5.     myTitle = myImages[myNumber].attributes.title;  // name of the title
  6.     mySend = myImages[myNumber].attributes.url;    // Site to re-direct
  7.  
  8.     _root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
  9.     fullImage_mc._x = _root.full_x; //position of the image along x-axis
  10.     fullImage_mc._y = _root.full_y;
  11.  
  12.     var fullClipLoader = new MovieClipLoader();
  13.     var fullPreloader = new Object();
  14.     fullClipLoader.addListener(fullPreloader);
  15.  
  16.     fullPreloader.onLoadStart = function(target) {
  17.         target.createTextField("my_txt",fullImage_mc.getNextHighestDepth,0,0,200,20);
  18.         target.my_txt.selectable = false;
  19.     };
  20.  
  21.     fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
  22.         target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
  23.     };
  24.  
  25.     fullPreloader.onLoadComplete = function(target) {
  26.         new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
  27.         target.my_txt.text = myTitle;
  28.         target.
  29.     };
  30.  
  31.     fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc); // display image with specefied dimensions 
  32.  
  33.  
  34. }
  35. ......
Expand|Select|Wrap|Line Numbers
  1. Code from XML file
  2. <gallery thumb_width="120" thumb_height="126" gallery_width="400" gallery_height="126" gallery_x="50" gallery_y="450" full_x="130" full_y="20">
  3. <image thumb_url="mahindra.jpg" full_url="mahindra.jpg" title="" url = "http://www.Google.com.com" />
  4. <image thumb_url="ganpati.jpg" full_url="ganpati.jpg" title="" url = "http://www.yahoo.com" />
  5. </gallery>
Jul 10 '08 #1
1 2322
creative1
274 100+
I furured out how it would work.
here is what I played with
Expand|Select|Wrap|Line Numbers
  1. target.onRelease = function() {
  2.                 getURL(mySend);  // here goes where to go
  3.             };
Now the issue is when I try to embedd this code in html. It does not open the site. and does nothing. if I try it with
http://google.com
or
http://www.google.com
it does not responds at all.
however if Itry like this

google.com
I get error that says address is invalid.
any help?
Jul 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Merlin | last post: by
18 posts views Thread by Wladimir Borsov | last post: by
6 posts views Thread by optxx | last post: by
5 posts views Thread by Miguel Dias Moura | last post: by
6 posts views Thread by qysbc | last post: by
reply views Thread by Craig | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.