Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old July 10th, 2008, 11:23 PM
Needs Regular Fix
 
Join Date: Sep 2007
Location: Canada
Posts: 264
Default 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:

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>
Reply
  #2  
Old July 11th, 2008, 01:54 AM
Needs Regular Fix
 
Join Date: Sep 2007
Location: Canada
Posts: 264
Default

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?
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles