Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash - ActionScript

dynamic image gallery

 
Jump to:  
 
horicolonoma
PostPosted: Mon Jul 28, 2008 9:21 pm    Post subject: dynamic image gallery
       
Hi all, I am new to the forum and I have a specific question about a dynamic
image gallery i am making.

Everything goes well, until I want to click from a thuimbnail to see an
enlarged image that is another file.
here is the specific code for that:

1) one problem is that -when I wlick one of the 5 jpegs attached- I always see
the last one enlarged...
2) another problem is to go back to the thumbs after clicking the enlarged
image...

PLease help me


//adding the thumbnails
//loading the vars
var loader:MovieClipLoader = new MovieClipLoader(); //loads the movieclip
var loader2:MovieClipLoader = new MovieClipLoader(); //loads the movieclip
var thumbPlace:MovieClip = thumbs_mc //the main movieclip on stage
var mc:MovieClip //the thumb movieclip under iteration
var lmc:MovieClip //the enlarged movieclip when RollOver/click
var mcInstance:String //the variable instance name of the thumb movieclip
//localizing the thumbplace and lmc empty movieclips
thumbPlace._x = 0
thumbPlace._y = 0
//let's make lmc
LargeMovie = _root.createEmptyMovieClip("LargeMovie",
_root.getNextHighestDepth());
LargeMovie._x = 0 ;
LargeMovie._y = 0;
lmc = LargeMovie.createEmptyMovieClip("bigImage", _root.getNextHighestDepth());
lmc._x = 0
lmc._y = 0
//making the iteration
for (var i:Number=1; i<6; i++){
//making the thumbs
mcInstance = "thumb" + i //instance of the iterated movieclips
mc = thumbPlace.createEmptyMovieClip (mcInstance,
thumbPlace.getNextHighestDepth()); //mc is being linked to the iteration,
copying the thumbs
mc._x = i*90
mc._y = 300
var thumbPath = "Rozenhof/thumbs/" + i + ".jpg";
var bigImagePath = "Rozenhof/" + i + ".jpg";
loader.loadClip (thumbPath, mc) //loading the jpegs into the mc
movieclip
var loaderListener:Object = new Object(); //making a loadlistener
variable
loader.addListener (loaderListener); //make an addlistenser to the
loaded movieclips
loaderListener.onLoadInit = function (target: MovieClip){
trace (target);
target.onPress = function (){
LargeMovie.enabled = true
LargeMovie._alpha = 100;
thumbPlace._alpha = 0;
loader2.loadClip (bigImagePath, lmc)
var loaderListener2:Object = new Object();
loader2.addListener (loaderListener2);
loaderListener2.onLoadInit = function (target2:
MovieClip){
trace (target2)
target2.onPress = function (){
LargeMovie.enabled = false;
LargeMovie._alpha = 0;
thumbPlace._alpha = 100;
gotoAndPlay (target.onPress);
}
}
}
}
}
 

 
DLMAES
PostPosted: Tue Jul 29, 2008 4:02 am    Post subject: Re: dynamic image gallery
       
One issue it might be, is that in your for loop you have var i:Number=1; Set
to 1 not 0. Then you referrence that number when declaring your small and large
images by i.

Remember actionscript always starts at zero not 1 when creating objects
dynamically.
 

 
horicolonoma
PostPosted: Tue Jul 29, 2008 8:44 am    Post subject: Re: dynamic image gallery
       
ok, thanks...I changed it, but it didn't provide me an answer.

Does anyone know how I can jump to a place in Actionscript? Like gotoAndPlay ();?
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Armatura Ɓazienki Meble biurowe forum bmw koszulki Stwarzanie ƛwiata - MiƂosz CzesƂaw