Page 5 of 9 FirstFirst ... 34567 ... LastLast
Results 61 to 75 of 130

Thread: XML + flash photo gallery tutorial help

  1. #61

    thank you

    Quote Originally Posted by stringy View Post
    see if you can finish it off on your own
    thank you a lot, ill try it and get back to you.

    tanx mate

  2. #62

    photo gallery modifications

    Quote Originally Posted by stringy View Post
    see if you can finish it off on your own
    Dear Stringy,
    i attached the file modified as i could, but i got 3 small tasks that i couldnt accomplish, if you can help me in them. the main picture image it is always aligned to the top left to the movieclip by deault, is there a way to make it load in the top center?, second issue is about the thumbnails, i removed the scroll and i tried to make them be arranged in rows and columns, but i couldnt, is there a way to do this?

    thank you for your help
    Attached Files Attached Files

  3. #63
    Quote Originally Posted by safdaa View Post
    Dear Stringy,
    i attached the file modified as i could, but i got 3 small tasks that i couldnt accomplish, if you can help me in them. the main picture image it is always aligned to the top left to the movieclip by deault, is there a way to make it load in the top center?, second issue is about the thumbnails, i removed the scroll and i tried to make them be arranged in rows and columns, but i couldnt, is there a way to do this?

    thank you for your help
    You will have to position the pics after they load if you want them to center about a point
    for example
    Code:
    cx=50
    cy = 50
    this.onEnterFrame = function() {
    	filesize = picture.getBytesTotal();
    	loaded = picture.getBytesLoaded();
    	preloader._visible = true;
    	if (loaded != filesize) {
    		preloader.preload_bar._xscale = 100*loaded/filesize;
    	} else {
    		picture._x =cx-picture._width/2
    		picture._y = cy-picture._height/2
    		preloader._visible = false;
    		if (picture._alpha<100) {
    			picture._alpha += 10;
    		}
    	}
    };


    just change the value "2" to the number of columns

    Code:
    function thumbnails_fn(k) {
    	thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
    	tlistener = new Object();
    	tlistener.onLoadInit = function(target_mc) {
    		//change 200 & 20 what you require
    		target_mc._x = 200+(target_mc._width+5)*(k%2)
    		target_mc._y =20+ Math.floor(k/2)*(target_mc._height+5)
    //.....etc
    Not sure what your third problem is.

  4. #64

    3rd question

    thank you a lot for your help, ill try to add what you suggested and get back to you.

    i forgot to mention the 3rd question, when the caption appears, i want it to appear over the main picture, but it need a certain background color so you can read it, can a certain background color with a certain alpha appear behind the "info" whenever you click on the caption button??

    thanx again.

  5. #65
    Quote Originally Posted by safdaa View Post
    thank you a lot for your help, ill try to add what you suggested and get back to you.

    i forgot to mention the 3rd question, when the caption appears, i want it to appear over the main picture, but it need a certain background color so you can read it, can a certain background color with a certain alpha appear behind the "info" whenever you click on the caption button??

    thanx again.
    if you convert info to a movieclip and then inside that mc on a lower layer than the textfield you draw a background square which you convert to mc, you will be able to create a new color object to adjust RGB of this background.Obviously you will need to change all the paths

  6. #66

    hi again

    i worked it out and i think it is not bad, although i am not a programmer, but i could read and understood the script, if you can have a look at it, i think it is a useful gallery for anybody who wants to use it.

    i have one more thing to ask you, i hope that you can help me achieve it. is to make the galleries to be in a drop down menu. is it difficult?

    i downloaded some flash/XML drop down menu but i couldnt make them function as the gallery buttons that you made, they all call for an external link. i had a lot of script conflicts.

    i attached the fla file where you can find the galleries button on the left.
    Attached Files Attached Files

  7. #67
    Quote Originally Posted by safdaa View Post
    i worked it out and i think it is not bad, although i am not a programmer, but i could read and understood the script, if you can have a look at it, i think it is a useful gallery for anybody who wants to use it.

    i have one more thing to ask you, i hope that you can help me achieve it. is to make the galleries to be in a drop down menu. is it difficult?

    i downloaded some flash/XML drop down menu but i couldnt make them function as the gallery buttons that you made, they all call for an external link. i had a lot of script conflicts.

    i attached the fla file where you can find the galleries button on the left.
    I don`t really see what you have done with the text ..maybe the wrong file?

    you maybe able to use some fancy script someone else has made as all the buttons are in an array and a lot of these scripts are array based.
    see if this gets you started
    Code:
    myvar = false;
    function ro() {
    	if (!myvar) {
    		_root.sw._visible = true;
    		myvar = true;
    		this.my.text = "MENU CLOSE";
    	} else {
    		_root.sw._visible = false;
    		myvar = false;
    		this.my.text = "MENU OPEN";
    	}
    }
    function loadXML(loaded) {
    	if (loaded) {
    		rem();
    		lip = _root.attachMovie("mc", "mc"+45, 345);
    		lip.my.text = "MENU OPEN";
    		lip._x = 1;
    		lip._y = 1;
    		_root.createEmptyMovieClip("sw", 100);
    		_root.sw._y = lip._y+lip._height;
    		_root.sw._visible = false;
    		lip.onPress = ro;
    		//lip.onRollOut = ro2
    		for (var j = 0; j<this.firstChild.childNodes.length; j++) {
    			if (!allLoaded) {
    				clip = _root.sw.attachMovie("mc", "mc"+j, j);
    				clip._x = 1;
    				clip._y = 1+j*(clip._height+1);
    				clip.my.text = this.firstChild.childNodes[j].attributes.name;
    				clip.jvar = j;
    				cliparray.push(clip);
    				clip.onPress = presto;
    			}
    		}
    		
    		
    		allLoaded = true
    //rest same as is

  8. #68
    5
    posts
    Registered User

    Newby request for help.

    Hello Kirupa forum viewers/helpers/users/mods,

    This is the first time I have posted on any forum of any type ever so be nice please.

    Firstly it's a good idea that I admit to being a complete and utter novice with actionscript and, it would seem, that like a lot of other people I have been drawn to the Kirupa.com xml driven slideshow as a starting point to gaining some knowledge.

    While I have had some success in understandings it's workings and adapting it my use (I am actually just intrested in the scroller element of the gallery) I have reached the point where I really need to seek some advice.

    Fortuantly one of my earlier problems, getting the thumbnail scroller to scroll in both directions i.e. loop, appears to have been addressed.

    However I still have 2 remining issues. Firstly I want my scroller to be activated by buttons i.e. that instead of the mouse pointer reaching the left or right edges of the scroller causing the scrolling function i would like to use left/right button instances to achieve this function. So question one how do I alter the script I have already found on this site to do this.

    My second question is how do I space my images out evenly? In the original and updated versions of the tutorial the spacing is fine and in my early experiments I have quite happily had my images spaced evenly apart. I'm confident i know what part of the script does this spacing and have changed the spacing to prove it to myself.

    The problem I have experienced has occured since I removed all other elements of the gallery, including the height restriction, leaving just the scroller behind, and i'm loading images via the xml which are of varrying dimensions and not the regularly sized images the original tutorial (or I) used. Now my images appear unevenly spaced and overlap. However if you scroll long enough on the looping version it seems to fix itself!!

    Any suggestions what I might do to fix this would be really welcome.

    Of course if anyone is kind enought to help out and needs me to send further information I will be happy to do so.

    Looking forward to some advice. Thanks in advance.

    Regards,

    AWTP

  9. #69
    Quote Originally Posted by AWTP View Post
    Hello Kirupa forum viewers/helpers/users/mods,

    This is the first time I have posted on any forum of any type ever so be nice please.

    Firstly it's a good idea that I admit to being a complete and utter novice with actionscript and, it would seem, that like a lot of other people I have been drawn to the Kirupa.com xml driven slideshow as a starting point to gaining some knowledge.

    While I have had some success in understandings it's workings and adapting it my use (I am actually just intrested in the scroller element of the gallery) I have reached the point where I really need to seek some advice.

    Fortuantly one of my earlier problems, getting the thumbnail scroller to scroll in both directions i.e. loop, appears to have been addressed.

    However I still have 2 remining issues. Firstly I want my scroller to be activated by buttons i.e. that instead of the mouse pointer reaching the left or right edges of the scroller causing the scrolling function i would like to use left/right button instances to achieve this function. So question one how do I alter the script I have already found on this site to do this.

    My second question is how do I space my images out evenly? In the original and updated versions of the tutorial the spacing is fine and in my early experiments I have quite happily had my images spaced evenly apart. I'm confident i know what part of the script does this spacing and have changed the spacing to prove it to myself.

    The problem I have experienced has occured since I removed all other elements of the gallery, including the height restriction, leaving just the scroller behind, and i'm loading images via the xml which are of varrying dimensions and not the regularly sized images the original tutorial (or I) used. Now my images appear unevenly spaced and overlap. However if you scroll long enough on the looping version it seems to fix itself!!

    Any suggestions what I might do to fix this would be really welcome.

    Of course if anyone is kind enought to help out and needs me to send further information I will be happy to do so.

    Looking forward to some advice. Thanks in advance.

    Regards,

    AWTP
    welcome to K forums

    2 buttons/mcs instance names r & l
    in standard kirupa file
    change last part of code to this
    Code:
    left = false
    right = false
    
    l.onPress = function(){
    	left=true
    	right = false
    	thumbNailScroller()
    }
    r.onPress = function(){
    	right=true
    	left = false
    	thumbNailScroller()
    }
    l.onRelease = r.onRelease = l.onReleaseOutside=r.onReleaseOutside=stopstuff
    function stopstuff(){
    	tscroller.removeMovieClip()
    }
    function thumbNailScroller() {
    	// thumbnail code! 
    	this.createEmptyMovieClip("tscroller", 1000);
    	scroll_speed = 10;
    	tscroller.onEnterFrame = function() {
    		if (left && thumbnail_mc.hitTest(hit_right)) {
    			thumbnail_mc._x -= scroll_speed;
    		} else if (right && thumbnail_mc.hitTest(hit_left)) {
    			thumbnail_mc._x += scroll_speed;
    		} else {
    			delete tscroller.onEnterFrame;
    		}
    	};
    }
    totalw = 0;
    function thumbnails_fn(k) {
    	var yy = thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
    	cliparray.push(yy);
    	tlistener = new Object();
    	tlistener.onLoadInit = function(target_mc) {
    		//i have put these 2 lines in to test
    		target_mc._width = random(50)+50;
    		target_mc._height = random(50)+50;
    		//put in if different heights -67 is for K gallery you may have to change for yours
    		target_mc._y = 67/2-target_mc._height/2;
    		target_mc._x = totalw+5;
    		totalw += target_mc._width+5;
    		target_mc.pictureValue = k;
    		tot += target_mc._x;
    		target_mc.onRelease = function() {
    			p = this.pictureValue-1;
    			nextImage();
    		};
    		target_mc.onRollOver = function() {
    			this._alpha = 50;
    			
    		};
    		target_mc.onRollOut = function() {
    			this._alpha = 100;
    		};
    	};
    	image_mcl = new MovieClipLoader();
    	image_mcl.addListener(tlistener);
    	image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
    }
    you will have to edit out the 2 line i highlight if you have already changed the xml

  10. #70
    5
    posts
    Registered User
    Thanks for your help Stringy, really appreciated.

    I may well have been implementing your suggestions incorrectly, so I apologise in advance for being thick & wasting your time, but I’m still experiencing some difficulty.

    2 things:

    1.) FYI I’m using, as my start point, the adapted gallery you posted here: http://www.kirupa.com/forum/showthread.php?p=2001002 to allow for continuous scrolling. From which I’ve removed all the elements with the exception of the scroller. The action script you have posted relating to replacing the mouse movement activated scrolling with button activated scrolling seems to be in the context of the original gallery (apologies if I’ve got that wrong). I’m not sure it should make a difference though. Anyway I added one button for test purposes (a button mc I have created myself and given the instance name of ‘r_button’ to) and replaced your 'r' with my button instance name. If I then preview the whole movie nothing happens when I click said button. In fact nothing happens at all. What am I getting wrong?

    Code:
    left = false
    right = false
     
    l.onPress = function(){
       left=true
       right = false
       thumbNailScroller()
    }
    r_button.onPress = function(){
       right=true
       left = false
       thumbNailScroller()
    }
    l.onRelease = r_button.onRelease = l.onReleaseOutside=r_button.onReleaseOutside=stopstuff
    function stopstuff(){
       tscroller.removeMovieClip()
    }
    
    2.) The two lines you marked as for “test": Am I correct in thinking these where “randomly” (clues in the name) assigning a height and width, based on the subsequent number, to each image loaded into the scroller? Including these two lines distorted my pictures and meant that large ones could appear small and small large. Removing them meant the pictures reverted to their natural dimensions. So I have left them out.

    Regarding the values/numbers in these lines:
    Code:
    target_mc._y = 67/2-target_mc._height/2;
           target_mc._x = totalw+5;
           totalw += target_mc._width+5;

    when altered induvidaully none of them appear to affect the space between each image. Although I have adjusted them so my images appear bigger and do not disappear off the top of the whole movie. Please can you provide a little more information as to what they are all doing?

    When I preview my file now all the images appear stacked one above the other until I begin to scroll… at which point they immediately order themselves to be sapced evenly apart. This is an improvement on before where I would have had to have scrolled through all the pictures before the sorted themselves out so I've moved on a little bit!!

    I hope I’m providing enough information.

    Thanks in advance for your help

    AWTP

  11. #71
    see if this helps
    Attached Files Attached Files

  12. #72
    Hey guys this is my first post here and I'm pretty sure my problem is an easy one. In Kirupa's demo of this gallery you can click on the big picture and it will take you to a link that has been defined in the XML file. I can't figure out how to make that happen. I'm pretty new with ActionScript so this question is probably pretty dumb but I'm not having any luck. Thanks in advance for any help!

  13. #73
    Quote Originally Posted by fireflip View Post
    Hey guys this is my first post here and I'm pretty sure my problem is an easy one. In Kirupa's demo of this gallery you can click on the big picture and it will take you to a link that has been defined in the XML file. I can't figure out how to make that happen. I'm pretty new with ActionScript so this question is probably pretty dumb but I'm not having any luck. Thanks in advance for any help!
    i`m pretty sure kirupa has put the source files for that in the source/experiment forum.

  14. #74
    Quote Originally Posted by stringy View Post
    i`m pretty sure kirupa has put the source files for that in the source/experiment forum.
    Thanks for the suggestion. I actually do have the source file from the tutorial, it just seems to be missing that one part. I looked in the forum you recommended and didn't find it, but that certainly doesn't mean it's not there! Thanks anyway.

  15. #75
    Quote Originally Posted by fireflip View Post
    Thanks for the suggestion. I actually do have the source file from the tutorial, it just seems to be missing that one part. I looked in the forum you recommended and didn't find it, but that certainly doesn't mean it's not there! Thanks anyway.
    yeh searching is sometimes difficult-i remembered the title

    http://www.kirupa.com/forum/showthread.php?t=81020

Page 5 of 9 FirstFirst ... 34567 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012