;

PDA

Click to See Complete Forum and Search --> : Photo Gallery Question


taurusguy
06-03-2008, 08:35 PM
Ok ... im a code newb. I have asked this question before .. but no one replied.

What i am asking here is .. how do i get a text decription show up in a 3rd content pane with the photo gallery necromanthus put up a while back?

I have made some adjustments to get his gallery to fit my site ...all i need now is a way to have the descriptions show up next to the bigger image that loads.

www.bcscenery.ca

Check out the galleries .... only a few work atm ....i dont wana change what i got going .. but add to what i got already to make text appear in the blank spot under the gallery heading.

PLEASE if you can, tell me how to go about accomplishing this seemingly impossible feat. I have bashed my head over and over and over trying to get text to show up in another box so there would be 3 panes on the waterfall page.

Thanks

Putz
06-04-2008, 01:02 AM
taurusguy,

nice site ! looking good.

ok, I'll try to answer your question without really knowing how necromanthus' gallery works, but if you can find the code where the larger version of the picture is diplayed, then add a line to set the content of the contentpane you are using.

For example you might have : contentpaneX.setContent(2,"picture1.txt");

(the 2 tells it an external text file and then file of picture1.txt)
(there are more options on the setContent function - but type and source are required)

hope that helps, if you need more help, please post your .fun file

Below is the syntax for the setContent function :


setContent ( type, source [, transition, transitTime [, clipRect [, initObject ]]] )
------------------------------------------------------------------------------------
Type Source

0 text string containing text
1 html text string containing html text
2 external text filename of text file
3 external html text file name of html text file
4 external graphic file name of swf, gif, png or jpg file
5 symbol library mc linkage ID of movieclip
6 symbol library bitmap linkage ID of bitmap
7 bitmap bitmap

Transition

0 Crossfade
1 Dissolve
2 Left to right
3 Top to bottom

taurusguy
06-04-2008, 02:21 PM
Thanks for the reply.

Its sure hlps me to understand what some of the characters in the code means.

Here is the code that runs necromanthus's Gallery
---------------------------------------------------
o = new Object();

o.thumb_first = 11;
o.thumb_last = 26;
o.thumb_prefix = '_';

o.img_path = 'waterfalls/';

contentpane1.setContent(5,'thumbs',0,1,null,o); // set thumbs mc from symbol library as content
-----------------------------------------------------

That code operates 2 content panes .. how?? I dunno .. but contentpane1 is thumbnails .. and contentpane2 is the larger image. I dont see how they relate in this code or understand how to get contentpane1 to show an image on contentpane2 and then add a text description for contentpane3 in one click. This is all new to me .. so its taking me forever lol ... but i appreciate your advice and hlp. But at least i understand now what those numbers are ... :)

I am gonna fart around with an actionscript for contentpane2 .. at least i think thats how it would work .. not entirely sure. If you have some suggestions or know of the line of code to get contentpane1 to operate 2 (show larger pic) and 3(show text description) at same time in one click .. that would be much appreciated.

thanks

taurusguy
06-04-2008, 03:13 PM
ok .. here is my .fun file ... it controls my entire site. Hopefully it will help you help me lol ...

If you can get this to work like i want .. i can make a small donation to your paypal account. I dont have much money online .. but .. i can offer like 10bucks for your efforts.

1. TO be able to click on thumbnails in contentpane1 and have it show the larger pic (it does this already)

2. to be able to change the text in contentpane3 to match the pic in contentpane2 when you click on the thumbnail in contentpane1 so each image recieves a seperate description when the thumb is clicked.

Thanks

Putz
06-04-2008, 07:13 PM
taurusguy,

I'm a photographer too ! I got started in this because of the site I wanted built was very expensive, so I having to learn myself. No need to pay me, if I gave out $10 for every question I asked, I'd be flat broke. These people here are really generous and helpful, I have learned a lot from reading the board regularly and help out when I can.



before I forget, check out the documentation koolmoves has, it located in C:\Program Files\KoolMoves\Examples\Components\Flash 8\API, or where ever
you have koolmoves installed. The API is Application Programming Inteface or something like that, it show the methods and properties that you can use.
Also, try googling the command in question. I don't think its so great for the components, but it is great for flash commands - ie. duplicateMoviClip etc...


Basically, he has made the thumbnails in to individual buttons and when you click it, it loads the image in contentpane2. On the koolmoves menu, go to "Views", and select "Symbols Library". A window will pop up, you will see it has one symbol called "thumbs". Select it, then click the edit button ( on the right hand side) then you will be editing the movie clip "thumbs". The timeline should be open, then look at the actionscript code in there, that is where he is setting the content for contentpane2. that should get you going. I would name the text file the same as the picture file, one will be like .jpg or gif, and the other will be a .txt file. Now put the contentpane3.setContent(2,txtfilename,0,1); you just have to figure out how to get the right text file name ! Look at the code - if you need more help let me know

taurusguy
06-04-2008, 07:47 PM
Thanks .. i appreciate that .. i got lots of learning to do.

Would i have to create a text file for each image?? .... im a bit confused as to how it would pull up different descriptions with one line of code ... im gonna poke around again in that area you described .. and see if i cant make sense out of it.

Another question ... would i have to have contentpane3.setContent(2,txtfilename,0,1); for each image?? ..... guess i should go look at the code lol .. ok .. ill post again if i begin to loose more hair :P

Thanks tho ... i really appreciate you looking into this for me .. stay tuned lol

edit:
here is the code inside where you described.

__proto__ = Object.KC8.prototype; // make this mc a KC8 object

for (i = this.thumb_first; i <= this.thumb_last; i++){
var m = o_rmc_btn(105,105,0xfff8f0,'th'+i,i,120*(i - this.thumb_first),0); // add the buttons
m.f = this.img_path + i + '.jpg';
m.pressed = function(){
_root.contentpane2.setContent(4,this.f,0,1);
}
m = m.createEmptyMovieClip('img',1);
m._x = m._y = 2;
m.loadMovie(this.img_path + this.thumb_prefix + i + '.jpg'); // load a thumbnail
}

scrollRect = null; // clear the preset clipping rectangle
_component._update(true); // update the scrollers of the contentpane component

---------------------------------------------------------------------------------------

Where would i put contentpane3.setContent(2,txtfilename,0,1); in that?? or does it matter?? And do i have to make that code for each image?? Man .. flash code is DEF not easy lol ..

Putz
06-04-2008, 09:40 PM
I don't know if you want one description in contentpane3 for the whole category, or you want to be able to have a different description for every picture ?
Assuming that you would want a different description for each picture :

yes, you would have to create a text file for each picture. its a loop,so it goes thru and runs all of the code, except for the last two lines, for every picture.

m is the button (each thumb is a button) where it says :

m.pressed = function(){
_root.contentpane2.setContent(4,this.f,0,1);
_root.contentpane3.setContent(2,txtfilename,0,1);
}
now we have to get the filename of the text file

Putz
06-04-2008, 11:34 PM
Taurusguy,

do you have the .fun file for the gallery ? without all the clutter of your site ?
I went to his site and couldn't find it, where did you get it ?

taurusguy
06-05-2008, 01:20 AM
Yeah i do ... its just on my work PC. I'll attach it tomorrow.

Yeah i cant find it again .. good thing i saved it as a seperate file.

:)

taurusguy
06-05-2008, 03:51 AM
WOOTS!! TY very much for your explanations, advice and time! It has paid off ... after hours and hours messing around with the code and what everyhting does .. I have FINALLY figured out what i needed to alter to get contentpane3 to function with 1 and 2

so .. just incase anyone else needs this thread to hlp them with this same issue

on the "thumbs" movie clip actionscript the code is THIS
---------------------------------------------------------------------
__proto__ = Object.KC8.prototype; // make this mc a KC8 object

for (i = this.thumb_first; i <= this.thumb_last; i++){
var m = o_rmc_btn(105,105,0xfff8f0,'th'+i,i,120*(i - this.thumb_first),0); // add the buttons
m.f = this.img_path + i + '.jpg';
m.pressed = function(){
_root.contentpane2.setContent(4,this.f,0,1);
}
m = m.createEmptyMovieClip('img',1);
m._x = m._y = 2;
m.loadMovie(this.img_path + this.thumb_prefix + i + '.jpg'); // load a thumbnail
}

scrollRect = null; // clear the preset clipping rectangle
_component._update(true); // update the scrollers of the contentpane component
-------------------------------------------------------------------------

Here is the NEW code to allow contentpane3 to operate with the same buttons as contentpane2 reacts with.
----------------------------------------------------------------------
__proto__ = Object.KC8.prototype; // make this mc a KC8 object

for (i = this.thumb_first; i <= this.thumb_last; i++){
var m = o_rmc_btn(105,105,0xfff8f0,'th'+i,i,120*(i - this.thumb_first),0); // add the buttons
m.f = this.img_path + i + '.jpg';
m.t = this.img_path + i + '.txt';
m.pressed = function(){
_root.contentpane2.setContent(4,this.f,0,1);
_root.contentpane3.setContent(4,this.t,0,1);
}
m = m.createEmptyMovieClip('img',1);
m._x = m._y = 2;
m.loadMovie(this.img_path + this.thumb_prefix + i + '.jpg'); // load a thumbnail
}

scrollRect = null; // clear the preset clipping rectangle
_component._update(true); // update the scrollers of the contentpane component

------------------------------------------------------------------------
I added this line:
_root.contentpane3.setContent(4,this.t,0,1);

And this line:
m.t = this.img_path + i + '.txt';
-----------------------------------------------------------------------

So ... in the end it was simpler than all the other tactics i had been trying lol .. Now all i gotta do is tweak the text and the contentpane3 to match my site design and POOF descriptions that load with the IMG!

:)

p.s. Sorry for the long post

edit to say .. after messing with the text .. how do i make the background of the .txt files black to display white text? Currently it shows a white rectangle with the text description in black on my black background. Looks kinda sloppy now... maybe a .gif text img ..... not sure ... if ya got any suggestions im all ears .. until then .. ill tweak what i got going and see if i cant smooth it out some. Its late .. so . im prolly just tired lol.

Gnight

necromanthus
06-05-2008, 07:59 AM
Here is a better approach:
http://necromanthus.com/KoolMoves/AK/AK.html
XML controlled, much faster & more versatile.

p.s.
For those who didn't know: Anastasia is a KoolMoves user!
:cap:

Putz
06-05-2008, 08:40 AM
congatulations ! I know that was painful, but I'm sure you learned a lot.

on the white background, just go into the GUI, the text property has the the text and background colors - set them there.

taurusguy
06-05-2008, 01:48 PM
ok .. here is the source for the gallery. To get it to function on a per gallery basis .. a few things have to be changed.

1. you have to change the code on the 'thumbs' movie clip actionscript with the updated codes on the previous posts to get the 3rd contentpane to function.

2. you have to alter the actionscript on the main page (the image_path)

3. Depending on the number of images you have per gallery ... that will also have to be changed too on the actionscript in the main page.


Hope this hlps someone in the future, now back to getting the text to appear to match my site. (no explanation for that yet lol still learning)

Peace

byweb
06-08-2008, 04:16 PM
I would try to do a gallery with xml. For example the one that the teacher proposes Necromanthus, it is a good idea. For those who didn't know: Anastasia is a KoolMoves user! it is a great notice.... I love it..:cap: