...

View Full Version : Opening new window for graphics



gamesir
05-28-2008, 01:19 PM
Okay, I tried making a flash portfolio from a certain tutorial, that uses the loader component, but the only problem is, the loader window where all the graphics go to, once the user clicks a thumbnail stretches, or shrinks the image.

It would help me more if that once you click the large loader area(main_mc), it would open up its own window for the specific graphics



comp1_btn.contentPath = "hsigAVY.jpg";
comp2_btn.contentPath = "sigAVY.jpg";
comp3_btn.contentPath = "haloAVY.jpg";
comp4_btn.contentPath = "projAVY.jpg";
comp5_btn.contentPath = "idesignAVY.jpg";
comp6_btn.contentPath = "restrictions.jpg";
comp7_btn.contentPath = "jesterAVY.jpg";
comp8_btn.contentPath = "h2.jpg";
comp9_btn.contentPath = "explosionAVY.jpg";
comp10_btn.contentPath = "dieAVY.jpg";
comp11_btn.contentPath = "bugAVY.jpg";
function portfolioLoader (image) {
main_mc.contentPath = image;
}

comp1_btn.onRelease = function (){
portfolioLoader("halosig1.jpg");
}
comp2_btn.onRelease = function (){
portfolioLoader("siggy.jpg");
}
comp3_btn.onRelease = function (){
portfolioLoader("halofrosty.jpg");
}
comp4_btn.onRelease = function (){
portfolioLoader("image4.jpg");
}
comp5_btn.onRelease = function (){
portfolioLoader("image5.jpg");
}
comp6_btn.onRelease = function (){
portfolioLoader("image6.jpg");
}
comp7_btn.onRelease = function (){
portfolioLoader("image7.jpg");
}
comp8_btn.onRelease = function (){
portfolioLoader("image8.jpg");
}
comp9_btn.onRelease = function (){
portfolioLoader("image9.jpg");
}
comp10_btn.onRelease = function (){
portfolioLoader("image10.jpg");
}
comp11_btn.onRelease = function (){
portfolioLoader("image11.jpg");
}

gnomeontherun
05-28-2008, 06:40 PM
You can make a new variable which tracks the currently selected image. Then make another onRelease function for the main_mc which when clicked will use getURL(); to open a new window. You will need to figure out also how to pass that variable in the URL to the linked page in order to display the image in that page, using something like PHP to grab the variable from the URL and select it from the folder.

gamesir
05-30-2008, 03:47 PM
And how would I do that?

gnomeontherun
05-31-2008, 02:42 AM
Do you know any scripting language? I'll show you how to send a variable from Flash using the URL (GET method for PHP). From here you will need something like PHP to make the rest of it.


var currentImage = "hsigAVY.jpg"; // Set the variable globally
comp1_btn.onRelease = function (){
portfolioLoader("halosig1.jpg");
currentImage = "halosig1.jpg"; // Change the variable
}
main_mc.onRelease = function (){
getURL("opennewimage.php?img="+currentImage, "_blank"); // When main_mc is clicked it will open a new window and pass currentImage in URL
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum