A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Picture Sliding

Hybrid View

  1. #1
    http://www.in3d.eu Kostas Zotos's Avatar
    Join Date
    Jul 2007
    Location
    Athens - Greece
    Posts
    408
    Hi,

    I've modified a bit the original code to include images instead of colored boxes.. (Images attached to stage from library, so you have to import your images insted of the existing). For further details (and instrunctions) please read some comments inside code.

    Here is also a very similar slideshow: http://board.flashkit.com/board/showthread.php?t=765860

    Note: The attached file is for Flash 8 and above..

    Regards!

    Kostas
    Last edited by Kostas Zotos; 06-09-2008 at 09:24 AM.
    K. Zotos online portfolio: http://www.in3d.eu

  2. #2
    http://www.in3d.eu Kostas Zotos's Avatar
    Join Date
    Jul 2007
    Location
    Athens - Greece
    Posts
    408
    Hi,

    I improved the file a bit.. Here is the (new) attachement:

    [As an alternative (the example attaches the images symbols from library), someone may manually add movie clips in the array, like this:
    pix = [Pic1_mc, Pic2_mc, Planet_mc, Sky_mc, myLogo] // The image clips
    (these must exist on stage as movie clip instances -you have to assign your specific names-]
    Attached Files Attached Files
    Last edited by Kostas Zotos; 06-09-2008 at 09:40 AM.
    K. Zotos online portfolio: http://www.in3d.eu

  3. #3
    Junior Member
    Join Date
    May 2006
    Posts
    4
    EXCELLENT! Thank you very much.

  4. #4
    Junior Member
    Join Date
    Oct 2008
    Posts
    1
    hey guys!
    i tried to add different links and tooltips for each image but i am not good at flash and i couldnt manage it. i have an array of 5 links corresponding to each image. what i want is sth like this.

    Clip.onRelease=function()
    {
    getURL(links[a],"_blank")
    }

    but apparently this function is not called until pressing the button and "a" seems to be undefined. how can i get the actual order of the image at this point, any ideas??

  5. #5
    http://www.in3d.eu Kostas Zotos's Avatar
    Join Date
    Jul 2007
    Location
    Athens - Greece
    Posts
    408
    Hi,

    May this helps (locate this part in the script of .fla file and modify in the way shown below):

    Code:
    // Array to hold pictures
    pix = [];
    
    links=[]   // add the links -as comma separated strings-  in the array (must correspond one link per image)
    
    for (a=1;a<=kNbrPictures;a++){
    	var ID:String="img"+a
    
    	// IMPORTANT: The Images have been converted to graphic symbols 
    	// and Linkage IDs have been assigned to them.
    	// (just import an image on stage. Select it and press F8. Give a name and id linkage)
    	// right clik an image symbol on library (eg: img1) , then select: "Linkage..." 
    	var Clip=_root.attachMovie(ID,ID,this.getNextHighestDepth())
    	Clip._y=kPictureY
    	Clip.id=a  // Assign the current value of "a" to a clip property "id"
    	
    	// ------------ If want interaction with images ------------------
    	// If don't want, just comment or delete this part (between ---- lines)
    	Clip.onRollOver=function(){
    		this._alpha=70
    	}
    	Clip.onRollOut=function(){
    		this._alpha=100
    	}
    
    	// Assign an onRelease handler
    	Clip.onRelease=function() {
     		trace(this.id)
    		getURL(links[this.id-1],"_blank")  
    		// links must be an array with URL strings
     		// Since array elements are zero based, we use: "this.id-1"
    
    		// Put any actions here (executed when click on image)
    	}
    	// ------------ If want interaction with images (END)------------------
    	
    	pix.push(Clip)
    }
    The approach is similar for tooltips

    Kostas
    K. Zotos online portfolio: http://www.in3d.eu

  6. #6
    Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Links to open inside the fla doc?

    This is great work!

    I'm curious if it is possible to have the pictures clickable (say acting as buttons) if you can add this property in order to have them clickable to open another section of information in a specified area of the same .fla file?

    Would it be as simple as just converting each image to a button and adding the behavior?

    Any help or insight is much appreciated!

    CR

  7. #7
    Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Slow down the speed of the boxes?

    I've tried everything I can think of to slow down the speed of the boxes.
    Anyone have an insight!?

    Not much hair left!












    Quote Originally Posted by Kostas Zotos
    Hi,

    May this helps (locate this part in the script of .fla file and modify in the way shown below):

    Code:
    // Array to hold pictures
    pix = [];
    
    links=[]   // add the links -as comma separated strings-  in the array (must correspond one link per image)
    
    for (a=1;a<=kNbrPictures;a++){
    	var ID:String="img"+a
    
    	// IMPORTANT: The Images have been converted to graphic symbols 
    	// and Linkage IDs have been assigned to them.
    	// (just import an image on stage. Select it and press F8. Give a name and id linkage)
    	// right clik an image symbol on library (eg: img1) , then select: "Linkage..." 
    	var Clip=_root.attachMovie(ID,ID,this.getNextHighestDepth())
    	Clip._y=kPictureY
    	Clip.id=a  // Assign the current value of "a" to a clip property "id"
    	
    	// ------------ If want interaction with images ------------------
    	// If don't want, just comment or delete this part (between ---- lines)
    	Clip.onRollOver=function(){
    		this._alpha=70
    	}
    	Clip.onRollOut=function(){
    		this._alpha=100
    	}
    
    	// Assign an onRelease handler
    	Clip.onRelease=function() {
     		trace(this.id)
    		getURL(links[this.id-1],"_blank")  
    		// links must be an array with URL strings
     		// Since array elements are zero based, we use: "this.id-1"
    
    		// Put any actions here (executed when click on image)
    	}
    	// ------------ If want interaction with images (END)------------------
    	
    	pix.push(Clip)
    }
    The approach is similar for tooltips

    Kostas

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center