How to open a site on click of an image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • creative1
    Contributor
    • Sep 2007
    • 274

    How to open a site on click of an image

    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:

    Code:
    ......
    function callFullImage(myNumber) {   // call full image once the thumb is clicked
    
    	myURL = myImages[myNumber].attributes.full_url; // name of the image to be opned
    	myTitle = myImages[myNumber].attributes.title;  // name of the title
    	mySend = myImages[myNumber].attributes.url;    // Site to re-direct
    	
    	_root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
    	fullImage_mc._x = _root.full_x; //position of the image along x-axis
    	fullImage_mc._y = _root.full_y;
    
    	var fullClipLoader = new MovieClipLoader();
    	var fullPreloader = new Object();
    	fullClipLoader.addListener(fullPreloader);
    
    	fullPreloader.onLoadStart = function(target) {
    		target.createTextField("my_txt",fullImage_mc.getNextHighestDepth,0,0,200,20);
    		target.my_txt.selectable = false;
    	};
    
    	fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
    		target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
    	};
    
    	fullPreloader.onLoadComplete = function(target) {
    		new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
    		target.my_txt.text = myTitle;
    		target.
    	};
    
    	fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc); // display image with specefied dimensions 
    
    
    }
    ......
    Code:
    Code from XML file
    <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">
    <image thumb_url="mahindra.jpg" full_url="mahindra.jpg" title="" url = "http://www.Google.com.com" />
    <image thumb_url="ganpati.jpg" full_url="ganpati.jpg" title="" url = "http://www.yahoo.com" />
    </gallery>
  • creative1
    Contributor
    • Sep 2007
    • 274

    #2
    I furured out how it would work.
    here is what I played with
    Code:
    target.onRelease = function() {
    				getURL(mySend);  // here goes where to go
    			};
    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?

    Comment

    Working...