|
|
|
#1 |
|
Junior Member
Join Date: May 2008
Posts: 19
|
Navigate within dynamic flash gallery
I have created with the help of a tutorial an awesome sliding gallery. I am going to be using over 100 pictures in it and would like to allow the user the ability to jumb from one section of the gallery to the next.
I really have no clue what kind of coding I would need to use on my navigation buttons. Can someone help me out? Here's my code for the gallery all in frame 1 of scene 1. Thanks for any advice! ![]() import mx.transitions.Tween; import mx.transitions.easing.*; this.createEmptyMovieClip("container",1); var imagesNumber:Number = 140; var scrolling:Boolean = true; catalog_str.text = i; for (i=1; i<=imagesNumber; i++) { var mynumber = i; container.attachMovie("thumb"+i,"thumb"+i+"_mc",i) ; container.attachMovie("catalog","catalog"+i+"_mc", i+200, {catalog_str:"#LR"+mynumber}); myThumb_mc = container["thumb"+i+"_mc"]; myThumb_mc._x = (i-1)*myThumb_mc._width; myThumb_mc._y = (Stage.height-myThumb_mc._height)/2; mycatalog_mc = container["catalog"+i+"_mc"]; mycatalog_mc._x = (i-1)*myThumb_mc._width; mycatalog._y = (Stage.height-myThumb_mc._height)/2; myThumb_mc._alpha = 90; myThumb_mc.largerImage = i; var myDesign = i; myThumb_mc.onRollOver = function() { this._alpha = 100; }; myThumb_mc.onRollOut = function() { this._alpha = 90; }; myThumb_mc.onRelease = function() { this._alpha=90; for (i=1; i<=imagesNumber; i++) { var myClip = container["thumb"+i+"_mc"]; myClip.enabled = false; } scrolling = false; _root.attachMovie("image"+this.largerImage,"large_ mc",i+1000); var myDesign = "LR"+this.largerImage; var line= "\r" mybutton1 = _root.attachMovie("emailpiece","emailbutton",0); mybutton1.onPress = function(){ getURL("mailto:?subject=Check out this design!"+"&body="+"Visit http://www.TamRonJewelry.com/ladiesrings.hml and click on "+myDesign+"!"); } large_mc._x = (Stage.width-large_mc._width)/2; large_mc._y = (Stage.height-large_mc._height)/2; new Tween(large_mc, "_alpha", Strong.easeOut, 0, 100, 0.5, true); new Tween(container,"_alpha",Strong.easeOut,100,50,0.5 ,true); large_mc.onRelease = function() { mybutton1.removeMovieClip(); scrolling = true; var myFadeOut = new Tween(large_mc, "_alpha", Strong.easeOut, 100, 0, 0.5, true); new Tween(container,"_alpha",Strong.easeOut,50,100,0.5 ,true); myFadeOut.onMotionFinished = function() { for (i=1; i<=imagesNumber; i++) { var myClip = container["thumb"+i+"_mc"]; myClip.enabled = true; } large_mc.removeMovieClip(); }; }; }; } container.onEnterFrame = function() { if (scrolling){ this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*15; if (this._x>0) { this._x = 0; } if (-this._x>(this._width-Stage.width)) { this._x = -(this._width-Stage.width); } } }; |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: May 2008
Posts: 19
|
I figured it out. Here's what the answer was in case anyone else is looking for it.
First I needed to create buttons in my library with no actionscript. Then use the following code to attach them to my movie and make them functional by positioning the container moviecli that all my pictures are being loaded into. attachMovie("jump","jump_btn",1001); jump_btn.onRelease = function() { container._x = -4930; } |
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|