To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-04-2009, 05:20 PM   #1
katiekatie
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);
}
}
};
katiekatie is offline   Reply With Quote
Old 11-04-2009, 08:23 PM   #2
katiekatie
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;
}
katiekatie is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:49 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.