Flash Actionscript Photo Gallery Question
So basically im putting together a little flash website and i created a photo gallery and put it on a frame seperate from the others and i want a button on the first frame to take you automatically to the photo gallery. So i did and it worked. I also created a little x-out button on the photo gallery so that when you click it it takes you back to frame 1 [index]. And it also works except the large thumbnails in my gallery follow it home and then you just stuck with a big old unwanted picture on your homepage. This is the code i put into the frame of the photo gallery::Any Thoughts?Attach Codethis.createEmptyMovieClip("images", 100);this.attachMovie("mask", "mask", 101);mask._x = images._x =243;mask._y = target =170;images.setMask(mask);images._y = -1000;speed = 5;for (var i = 0; i<8; i++) {var img = images.attachMovie("image"+i, "image"+i, i);img._y = img._height*i;var thumb = this["thumb"+i];thumb._alpha = 60;thumb.pos = target+(i*-img._height);thumb.onPress = function() {target = this.pos;};thumb.onRollOver = function() {this._alpha = 100;};thumb.onRollOut = function() {this._alpha = 60;};}this.onEnterFrame = function() {images._y += (target-images._y)/speed;};
Adobe > ActionScript 1 and 2
Posted on: 06/22/2008 08:47:42 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Flash Actionscript Help For The Photo Gallery
Hi,
I used you template to make a photo gallery for myself. I have been looking over the code, and I need to change it so that it loops back to the 1st image once it has reached the end of the xml file. Please tell me where to make that change, and what to change it to.. Thanks
Colleen
Flash Actionscript Photo Gallery Question
So basically im putting together a little flash website and i created a photo gallery and put it on a frame seperate from the others and i want a button on the first frame to take you automatically to the photo gallery. So i did and it worked. I also created a little x-out button on the photo gallery so that when you click it it takes you back to frame 1 [index]. And it also works except the large thumbnails in my gallery follow it home and then you just stuck with a big old unwanted picture on your homepage. This is the code i put into the frame of the photo gallery::
Any Thoughts?
Attach Code
this.createEmptyMovieClip("images", 100);
this.attachMovie("mask", "mask", 101);
mask._x = images._x =243;
mask._y = target =170;
images.setMask(mask);
images._y = -1000;
speed = 5;
for (var i = 0; i<8; i++) {
var img = images.attachMovie("image"+i, "image"+i, i);
img._y = img._height*i;
var thumb = this["thumb"+i];
thumb._alpha = 60;
thumb.pos = target+(i*-img._height);
thumb.onPress = function() {
target = this.pos;
};
thumb.onRollOver = function() {
this._alpha = 100;
};
thumb.onRollOut = function() {
this._alpha = 60;
};
}
this.onEnterFrame = function() {
images._y += (target-images._y)/speed;
};
Photo Gallery Actionscript Help
Photo gallery
flash 2004
Right now I must click on a thumbnail image which then opens the larger Image plus some description text. Works great.
I would like to be able to modify it to automatically loop through the images at set intervals and yet still be able to use the thumbnail images to move through the photos if desired.
My question: what actioncript do I add to this to achieve this?
Thank you for any help.
Cheers
---------- Here is my xml file ----------
<textandImages>
<PICTURENAME="Move 1"
TEXT="thetrainer/text/description1.txt"
THUMB="thetrainer/images/thumbs/image1.jpg"
IMAGE="thetrainer/images/image1.jpg"
/>
<PICTURENAME="Move 2"
TEXT="thetrainer/text/description2.txt"
THUMB="thetrainer/images/thumbs/image2.jpg"
IMAGE="thetrainer/images/image2.jpg"
/>
<PICTURENAME="Move 3"
TEXT="thetrainer/text/description3.txt"
THUMB="thetrainer/images/thumbs/image3.jpg"
IMAGE="thetrainer/images/image3.jpg"
/>
<PICTURENAME="Move 4"
TEXT="thetrainer/text/description4.txt"
THUMB="thetrainer/images/thumbs/image4.jpg"
IMAGE="thetrainer/images/image4.jpg"
/>
<PICTURENAME="Move 5"
TEXT="thetrainer/text/description5.txt"
THUMB="thetrainer/images/thumbs/image5.jpg"
IMAGE="thetrainer/images/image5.jpg"
/>
<PICTURENAME="Move 6"
TEXT="thetrainer/text/description6.txt"
THUMB="thetrainer/images/thumbs/image6.jpg"
IMAGE="thetrainer/images/image6.jpg"
/>
</textandImages>
-------- Here is my actionscript --------------
thetrainer = new XML();
thetrainer.ignoreWhite = true;
timeline = this;
baseurl = _url.substr(0,_url.lastIndexOf("/")+1);
thetrainer.onLoad = function(){
trainerTag = this.firstChild;
trace(count = trainerTag.childNodes.length);
for (child = 0; child < count; child++){
currentPicture = trainerTag.childNodes[child];
// this offset (_x positioning).
currentThumb = menu_mc.createEmptyMovieClip("thumbnail"+child,chi ld);
currentThumb._x = child * 72;
image = currentThumb.createEmptyMovieClip("thumbnail_image ",0);
image.loadMovie(baseurl + currentPicture.attributes.THUMB);
currentThumb.NAME = currentPicture.attributes.NAME;
currentThumb.IMAGE = currentPicture.attributes.IMAGE;
currentThumb.TEXT = currentPicture.attributes.TEXT;
currentThumb.onRollOver = currentThumb.onDragOver = function(){
showName_txt.text = this.NAME;
}
currentThumb.onRollOut = currentThumb.onDragOut = function(){
showName_txt.text = "";
}
currentThumb.onPress = currentThumb.onDragOver = function(){
image_mc.loadMovie(baseurl + this.IMAGE);
info_txt.text = "Loading...";
timeline.loadVariables(baseurl + this.TEXT);
}
}
}
thetrainer.load(baseurl + "thetrainer.xml");
ActionScript Photo Gallery...
Hi everyone, I am developing a website for someone and I am having trouble with the photo gallery.
The last step is to make a button on the thumbnail bar (two arrows, one for going forward and one for going back) (in City.swf) that loads a different section in it's place (for the sake of being able to put a name to a section we'll call it CityA.swf). To do this we have to call from an imported SWF into the parent SWF, any ideas?
Please take a look at the site, and when you click into the portfolios section, chose any of the galleries.
http://www.theaxiomproject.com/joan/flash
Any and all help will be greatly appreciated, thank you all for your kindness.
HELP W/ This Actionscript 4 Photo Gallery
Hey ya'll,
I'm trying to do this http://www.cambodiaxp.com/tutorial/f...oto-slider.php
BUT i want my pictures to go vertical slide up and down not across.
i have this AS for horizontal sliding:
final_x=0;
speed =5;
photo_width = 280; //width of each individual photo, you may choose the one that suit photos
photo_mc.onEnterFrame = function() {
photo_mc._x += (final_x - photo_mc._x)/speed;
}
b1.onRelease = function() {
final_x =0;
}
b2.onRelease = function() {
final_x =-photo_width;
}
b3.onRelease = function() {
final_x =-photo_width*2;
}
b4.onRelease = function() {
final_x =-photo_width*3;
}
b5.onRelease = function() {
final_x =-photo_width*4;
}
your help will be very much appreciated!
Thanks!
xTINA
Photo Gallery - Help Tweak The Actionscript
Hi
I found this tutorial - http://www.kirupa.com/developer/mx20...otogallery.htm
(I have attached the files), but i am having trouble tweaking it.
I want the pictures to fade in and out like they are, but automatically, every 15 seconds. I dont need thumbnails, but i do need text to fade in and out with each image. I want the pause button when pressed to change into a play button and visa versa.
Any help would be much appreciated!
Leigh
[flashMX] Photo Gallery Actionscript
i want to use the crank handle to scroll images instead of the arrows (see crank script at bottom).
i started w/ a photo gallery from kirupa http://www.kirupa.com/developer/mx/photogallery.htm (go here to download images)
//here is the galleryscript://
/// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "animation/";
// fill this array with your pics
this.pArray = ["image1.jpg", "image2.jpg", "image3.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);
--------------------------------------------------------------------------
the arrows have this script:
//right arrow//
on (release) {
_root.changePhoto(1);
}
//left arrow?
on (release) {
_root.changePhoto(-1);
}
---------------------------------------------------------------------------
//the crank//
mc.btn.onPress = function(){
scrolling = true;
}
mc.btn.onmouseUp = function(){
scrolling = false;
}
onEnterFrame = function(){
if(scrolling){
var dx=mc._x-_xmouse;
var dy=mc._y-_ymouse;
var rad = Math.atan2(-dy,-dx);
var angle = (rad*180)/Math.PI;
mc._rotation=angle;
}
}
flash file is attached if it helps.
thanks!
[flashMX] Photo Gallery Actionscript
i want to use the crank handle to scroll images instead of the arrows (see crank script at bottom).
i started w/ a photo gallery from kirupa http://www.kirupa.com/developer/mx/photogallery.htm (go here to download images)
//here is the galleryscript://
/// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "animation/";
// fill this array with your pics
this.pArray = ["image1.jpg", "image2.jpg", "image3.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);
--------------------------------------------------------------------------
the arrows have this script:
//right arrow//
on (release) {
_root.changePhoto(1);
}
//left arrow?
on (release) {
_root.changePhoto(-1);
}
---------------------------------------------------------------------------
//the crank//
mc.btn.onPress = function(){
scrolling = true;
}
mc.btn.onmouseUp = function(){
scrolling = false;
}
onEnterFrame = function(){
if(scrolling){
var dx=mc._x-_xmouse;
var dy=mc._y-_ymouse;
var rad = Math.atan2(-dy,-dx);
var angle = (rad*180)/Math.PI;
mc._rotation=angle;
}
}
flash file is attached if it helps.
thanks!
::photo Gallery Need Actionscript For Larger Images? ::
Hi All,
Im in the process of creating a picture gallery and I initially used a rollover for the images to present the bigger version of the image on the left-hand side of the page. however, ive encountered an issue with this method and would like the larger version of the image to appear when the image is clicked not rolled over (ive saved these as buttons), my query is, do I need Actionscript for this, if so, how could i solve the problem.
thanks
E.V.E
Problem Tweaking My Actionscript (Photo Gallery)
Hi
I found this tutorial - http://www.kirupa.com/developer/mx20...otogallery.htm
i have attached files too, but i am having trouble tweaking the code.
I need the images to fade in and out, like they are, but automatically every 15 seconds. I dont need thumbnails but i need text to fade in and out with each image. I also want the pause button when pressed to turn into a play button and visa versa, and funtion that way too.
Any help much appreciated!
Leigh
Adding Easing And Tweening To A Xml Photo Gallery W/actionscript
I'm pretty new to alot of this and I was wondering if anyone knows how to add some tweens and some easing with actionsscript to make this xml photogallery look smoother. here is the link the tutorial is on.
http://www.kirupa.com/developer/mx2004/thumbnails.htm
Making Actionscript Photo Gallery Fade Automatically
Hey all,
Hopefully this hasn't been covered a lot here... I'm a newbie when it comes to ActionScript so hopefully someone here can help me out.
I've been using this kirupa designed flash photo gallery because it's far more efficent size wise than just creating the tweens in flash:
http://www.kirupa.com/developer/mx/photogallery.htm
My question is this:
What is the best way to change this photogallery so that rather than manually changing the photos with a button, it will fade them in and out automatically?
(i.e. on (release) {
_root.changePhoto(1);
} )
I tried wiring it up using "onEnterFrame" as a function to change _root.changePhoto but maybe I'm placing the code in the wrong place because I can't seem to get that to work.
Any help with this would be greatly appreciated.
Actionscript For Adding Sound To An XML Based Photo Gallery
I was wondering how I could add sound to a gallery that is driven by xml.
I have a gallery that loads the picture, Title and description. the gallery is downloadable here. http://www.flashmo.com/prev...o_133_fisheye
The regular gallery loads a web page when the picture is clicked. I am trying to make each picture load a different mp3.
I have the general Idea of how it would be done but I don't know how put it to actionscript.
I figured you would basically create a sound object that loads the specific mp3 from the xml file when the picture is clicked from the gallery.
Can Anyone help me with this?
I think I might have some what of the idea right but I get an error everytime I load the swf file.
"ArgumentError: Error #2068: Invalid sound.
at flash.media::Sound/play()
at MethodInfo-6()"
If anyone could help me with this I would greatly appreciate it.
Here is the actionscript.
Code:
// Copyright © flashmo.com
// Developed by Min Thu
stop();
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var filename_list = new Array();
var url_list = new Array();
var url_target_list:Array = new Array();
var title_list = new Array();
var description_list = new Array();
var song_list = new Array();
var i:Number;
var j:Number;
var tn:Number = 0;
var default_scale:Number = 0.6;
var new_scale:Number;
var center_x:Number = tn_group_mask.x + tn_group_mask.width * 0.5;
var half_of_tn_width:Number = 80;
var current_mc:MovieClip;
var total:Number;
var flashmo_xml:XML = new XML();
var folder:String = "thumbnails/";
var xml_loader:URLLoader = new URLLoader();
xml_loader.load(new URLRequest("flashmo_129_thumbnail_list.xml"));
xml_loader.addEventListener(Event.COMPLETE, create_thumbnail);
var thumbnail_group:MovieClip = new MovieClip();
stage.addChild(thumbnail_group);
thumbnail_group.mask = tn_group_mask;
thumbnail_group.x = tn_group.x;
thumbnail_group.y = tn_group.y;
tn_group.visible = false;
tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";
function create_thumbnail(e:Event):void
{
flashmo_xml = XML(e.target.data);
total = flashmo_xml.thumbnail.length();
for( i = 0; i < total; i++ )
{
filename_list.push( flashmo_xml.thumbnail[i].@filename.toString() );
url_list.push( flashmo_xml.thumbnail[i].@url.toString() );
title_list.push( flashmo_xml.thumbnail[i].@title.toString() );
description_list.push( flashmo_xml.thumbnail[i].@description.toString() );
song_list.push (flashmo_xml.thumbnail[i].@filename.toString() );
load_tn();
stage.addEventListener(Event.ENTER_FRAME, fisheye );
}
function load_tn():void
{
var pic_request:URLRequest = new URLRequest( folder + filename_list[tn] );
var pic_loader:Loader = new Loader();
pic_loader.load(pic_request);
pic_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, on_loaded);
tn++;
}
function on_loaded(e:Event):void
{
if( tn < total )
{
load_tn();
}
var flashmo_bm:Bitmap = new Bitmap();
var flashmo_mc:MovieClip = new MovieClip();
flashmo_bm = Bitmap(e.target.content);
flashmo_bm.x = - flashmo_bm.width * 0.5;
flashmo_bm.y = - flashmo_bm.height * 0.5;
flashmo_bm.smoothing = true;
var bg_width = flashmo_bm.width + 10;
var bg_height = flashmo_bm.height + 10;
flashmo_mc.addChild(flashmo_bm);
flashmo_mc.graphics.lineStyle(1, 0x666666);
flashmo_mc.graphics.beginFill(0xFFFFFF);
flashmo_mc.graphics.drawRect( - bg_width * 0.5, - bg_height * 0.5, bg_width, bg_height );
flashmo_mc.graphics.endFill();
flashmo_mc.name = "flashmo_" + thumbnail_group.numChildren;
flashmo_mc.buttonMode = true;
flashmo_mc.addEventListener( MouseEvent.MOUSE_OVER, tn_over );
flashmo_mc.addEventListener( MouseEvent.MOUSE_OUT, tn_out );
flashmo_mc.addEventListener( MouseEvent.CLICK, tn_click );
flashmo_mc.scaleX = flashmo_mc.scaleY = default_scale;
flashmo_mc.x = thumbnail_group.numChildren * 94;
thumbnail_group.addChild(flashmo_mc);
}
function tn_over(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.target);
var s_no:Number = parseInt(mc.name.slice(8,10));
if( s_no > 1 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no-2) ) );
if( s_no > 0 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no-1) ) );
if( s_no < thumbnail_group.numChildren - 2 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no+2) ) );
if( s_no < thumbnail_group.numChildren - 1 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no+1) ) );
thumbnail_group.addChild( mc );
tn_title.text = title_list[s_no];
tn_desc.text = description_list[s_no];
tn_url.text = url_list[s_no];
}
function tn_out(e:MouseEvent):void
{
tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";
}
function tn_click(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.target);
var s_no:Number = parseInt(mc.name.slice(8,10));
var s:Sound = new Sound();
var sc:SoundChannel = s.play();
navigateToURL(new URLRequest(song_list[s_no]));
}
}
function fisheye(e:Event):void
{
thumbnail_group.x -= ( mou*** - center_x ) * 0.05;
if( thumbnail_group.x > tn_group_mask.x + half_of_tn_width )
{
thumbnail_group.x = tn_group_mask.x + half_of_tn_width;
}
else if( thumbnail_group.x < tn_group_mask.x - thumbnail_group.width + tn_group_mask.width )
{
thumbnail_group.x = tn_group_mask.x - thumbnail_group.width + tn_group_mask.width;
}
if( mouseY > tn_group_mask.y && mouseY < tn_group_mask.y + tn_group_mask.height )
{
for( j = 0; j < thumbnail_group.numChildren; j++ )
{
current_mc = MovieClip(thumbnail_group.getChildAt(j));
var distance:Number = Math.sqrt(
Math.pow( Math.abs( stage.mou*** - (current_mc.x + thumbnail_group.x) ) , 2)
+ Math.pow( Math.abs( stage.mouseY - (current_mc.y + thumbnail_group.y) ) , 2)
);
new_scale = 1 - ( distance * 0.002 );
current_mc.scaleX += (new_scale - current_mc.scaleX) * 0.2;
current_mc.scaleY += (new_scale - current_mc.scaleY) * 0.2;
if( current_mc.scaleX < default_scale )
current_mc.scaleX = current_mc.scaleY = default_scale;
}
}
else
{
for( j = 0; j < thumbnail_group.numChildren; j++ )
{
current_mc = MovieClip(thumbnail_group.getChildAt(j));
current_mc.scaleX += (default_scale - current_mc.scaleX) * 0.2;
current_mc.scaleY += (default_scale - current_mc.scaleY) * 0.2;
}
}
}
And here is the XML shortened.
Code:
<thumbnails>
<thumbnail filename="flashmo_128_elegant.jpg" url="http://www.flashmo.com/preview/flashmo_128_elegant" target="_parent._parent"
title="Item No. 1 (128 elegant)"
description="Elegant Design - Flash website template, subpages for products, AS3 contact form"
song="Sound.mp3"/>
<thumbnail filename="flashmo_127_curtain.jpg" url="http://www.flashmo.com/preview/flashmo_127_curtain" target="_parent._parent"
title="Item No. 2 (127 curtain)"
description="Curtain template for making simple Flash websites including ActionScript 3 + PHP contact form"
song="Sound.mp3"/>
<thumbnail filename="flashmo_126_envelope.jpg" url="http://www.flashmo.com/preview/flashmo_126_envelope" target="_parent._parent"
title="Item No. 3 (126 envelope)"
description="Envelope Template with drag N drop Flash photo gallery, ActionScript 3.0"
song="Sound.mp3"/>
</thumbnails>
Photoshop CS2: Web Photo Gallery: Flash - Gallery 1
I'm interested to know the code that Adobe Uses with one of their Web Photo Gallery (Photoshop CS2) - it's the one called "Flash - Gallery 1".
Here's a sample of it:
http://www.newrisedesigns.com/charlie/060416/
What I'm interested in, is how to do the thumbnails...when you roll over them - they move all of the other thumbnails around - and also show the name of the external jpg file.
Anyone know or have the source code to do that? What about any kind of tutorial out there that can do this?
Help please?
Actionscript Problem With "Kirupa Photo Gallery"
As per this guide:
http://www.kirupa.com/developer/mx/photogallery.htm
I implimented it,
It didn't load the images at all at first. Then, I found the problem to be that this clip is not located at root level, so I changed the two instances of _root.photo in the actionsctipt to this.photo, which sucessfully loaded the first image. The problem is that now it wont load any new images when I click next or previous.
Here's my code on my buttons:
Code:
on (release) {
this._parent.changePhoto(1);
}
Here's my edited actions code:
Code:
/*
i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it
easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "photos/";
// fill this array with your pics
this.pArray = ["image0.jpg", "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], this.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = this.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);
Flash: Photo Gallery
Before I attempt to go off and build this myself, I thought to see if something is already available or close to it.
I am looking for a for a Flash photo gallery with audio. (See examples) I discovered some software (see software) that does almost what I want. However, it’s Shockwave and its branded PhotoJam. Even though it would make creating a photo gallery almost effort less its just too cookie cutter. I am looking to create something more like the msnbc flash galleries. I would like to create a template that I can drop photos and a sound clip into the Flash document with minor adjustments each time I create a gallery. I was hoping that someone could give some direction or know of a Flash source file that I can modify to create this.
Flash photo gallery examples:
http://www.msnbc.com/modules/ps/0105...ica/splash.asp
http://www.msnbc.com/c/0/24/9/ssMain...09&sld=18&v=28
http://www.msnbc.com/c/0/16/454/ssMain.asp?fmt=Child
Software:
http://www.shockwave.com/sw/downloads/photojam/
Thanks,
Joel
Flash Photo Gallery
hi.
i'll be making a photo gallery soon with hundreds of pictures. is there a fast way to make some sort of template with some AS that would make the job a little eaisier?
i plan to have two copies of the same image on each flash page - one copy for the full size and another scalled down for the thumb and when the mouse rolls over, it displays the full size.
Flash Photo Gallery
hi.
i'll be making a photo gallery soon with hundreds of pictures. is there a fast way to make some sort of template with some AS that would make the job a little eaisier?
i plan to have two copies of the same image on each flash page - one copy for the full size and another scalled down for the thumb and when the mouse rolls over, it displays the full size.
Flash Mx Photo Gallery - How Do They Do That?
http://www.irinagavrich.com/
I was checking out the photo gallery on this website and I'm interested in doing this somehow, but I'm not sure how. I use Flash MX. I'm interested in being able to scroll through the images (how they slide automatically) and then being able to click on one and it opens still having the sliding menu there. Anyone have any ideas on this? Please advise and thanks!!!
-Foochuck
Flash Photo Gallery
I tried making a photo gallery with the tutorial from www.kirupa.com it doesn';t work though heres my action script, can anyone tell me what i did wrong?
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "http://www.thozeguys.com/pics";
// fill this array with your pics
this.pArray = ["DSCF0019.JPG", "DSCF0022.JPG", "DSCF0027.JPG", "DSCF0028.JPG", "DSCF0029.JPG", "DSCF0031.JPG", "DSCF0033.JPG", "DSCF0035.JPG", "DSCF0038.JPG", "DSCF0049.JPG", “DSCF0042.JPG”, “DSCF0052.JPG”, “DSCF0053.JPG”, “DSCF0055.JPG”, “DSCF0057.JPG”, “DSCF0062.JPG”, “DSCF0068.JPG”, “DSCF0070.JPG”, “DSCF0071.JPG”];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);
Flash Photo Gallery
I am using MX and have searched the tutorials looking for ways to create a flash photo gallery. Does anyone have some sample code or tips on how to do this?
Flash Photo Gallery
Hey all,
I created a Flash photo gallery that dynamically loads the images and I have come to a road block. I need it to be set up where when you click on a thumbnail the corresponding full size image shows up in the "main" movie clip. The thumbnails are named correspondingly to the full size images (Thumb: thumbs/1.jpg Full: images/1.jpg). No matter how I set it up, I can't seem to get my thumbnail to be clickable. Currently my AS looks like this :
count = "2";
number_of_images = count;
for (i=0; i<number_of_images; ++i) {
var currentImage = attachMovie("image", "image"+i, i+1);
currentImage._xscale = currentImage._yscale=100;
if (i<=4) {
currentImage._y += 320;
currentImage._x += 75*i+75;
}
if (i>=5) {
currentImage._y += 395;
currentImage._x += 75*i-300;
}
currentImage.loadMovie(i+".jpg");
}
The script I think you would use to make the thumbnails clickable and for when you click the thumbnail the main image to show up is :
currentImage.onPress = function() {
Main.loadMovie(i+".jpg");
};
But obviously that isn't working. If you can help at all please post here or message me on AIM at r0ller rebel. All help is greatly appreciated.
Thanks,
Jay
Flash Photo Gallery - Help
I'll explain the overall problem and then if you have ideas on either Photoshop or Flash solutions please let me know.
Problem:
create a photo gallery with:
---side thumbnail menu
---top day / special events menu linking to galleries
---control panel with forward / back / stop/ auto slide buttons
---save High-res photo ( print version of photo )
Solution Option 1:
Photoshop created gallery based on autocreation feature in Photoshop. The Photoshop option does provide thumbnail view / big view, but doesn't provide the control panel with forward / back / stop/ auto slide buttons or a place to link to high res pictures for print download.
Is there a way to add a control panel using javascript or PHP or by modifying the Photoshop template file? Would you know how to do / add this? Have you worked with the auto photo gallery function in photoshop?
Solution Option 2:
Flash gallery based on http://linkshare.org/flashgallery which is by http://chasebrammer.com/comps
( I chose this option because I think it would make changing the GUI simpler but other problems were created! )
Repeated errors:
- accessing galleries.phpÂ_ error message says "error during read of ( gallery name )"
Seems to happen after I've gone into "owner comments" to add comments to photos in the gallery. When I go back to update gallery error message appears and I can't access the gallery.
- accessing comments.php no comments appear in the text boxes. http://www.linkshare.org/flashgaller...?dir=italytrip
If I use the flat file option, are my comments not going to appear in the text boxes in the comments.php page? If so, it seems that I would have to reinsert comments everytime I opened the comments.php page?
- accessing the gallery frontend http://www.linkshare.org/flashgallery/ ,the owner comments don't show up but if you post comments then the comments appear but only for the public comments.
Want to change pulldown menu into button menu?
- how add a top menu of 7 days plus 3 special events buttons that link to different galleries. Currently galleries are linked from the pulldown menu but I can't figure out the actionscript code in the Flash source file to put gallery links in the buttons. I do have a Flash source file for the gallery which you can use.
Ideally, the gallery part would work like this: http://www.jsensei.com/jsensei.html
The top day / special event menu would link to the different galleries.
Ack...help?
flashgalleryhelp@linkshare.org
Flash Photo Gallery
please visit this site:
photo gallery
click on 'cars'
and tell me how to create such an album or where i can find a tutorial to create such an album...
thanx a load!
Flash Photo Gallery
Is There A Easy Way Of Creating A Flash Photo Gallery Of Over A Hundred Photo
Flash Photo Gallery
Hi there, I found this photo gallery on this site and modified it to my look. Now when I test it on my computer it works but as soon as I put it in an HTML page it stops working. Can you guys help me figure out what is going because I am a new to action script and dont know enough to see what is wrong. Also the author of the gallery said that it used and external XML file but I dont know how to set up the XML file as he does not include it in the zipped file. Maybe there is a problem in the action script or maybe I need the XML file but I dont know.
Here is a link to the zipped file as it is too large to attach.
http://paratwins.paragliderworld.com/gallery.zip
Also here is what the author sais:
Quote:
reads from GALLERY.XML file a list of directories & gallery names (photos must be in format 0001.jpg, 0002.jpg, etc)and from PLAYLIST.XML info on the Song & Artists (mp3 must be in same directory of flash file, named 0.mp3, 1.mp3, etc). This is a first version, so many features are still incomplete. Drag the tabs to pull out the panels.
All help would be greatly appreciated. Thanks
Nick
Flash Photo Gallery
Hi Guys,
Where Do I find flash photo gallery.
my requirement is I have 15 photos on every page likewise have 25 pages for now.
Where Do I get the way to manage photos with next and back interaction.
the file should not be heavy even, coz there will be a plenty of fotos.
each foto is 130*130 in size!!!
Ram
Flash Photo Gallery
Hi
I have tried creating one but I'm stuck is there anyone out there who could send me a template or something?
Thanks
Flash Photo Gallery
I have flash mx 2004. i want to be able to click on one thumbnail photo on the left, one of a series, and have the photo appear on the right, enlarged. and when i click on another thumbnail, for it to be replaced by the new selection, and at the same time, a caption at the bottom to change with each new selection as well.
how would I do this?
thx in advance.
me.
Flash Photo Gallery
Hi,
Planning to build a nice scrolling photo gallery, any suggestions? sample application? Tutorials?
thanks in advance.
hammer
Flash Photo Gallery
I'm trying to make a flash photo gallery for my website, but I don't know how to do it manually. I'm trying to find a program that will let me make just a simple (but nice looking) layout, looking something like this:
Where the white squares are the photo icons and when you click them, they will enlarge. I want to be able to save a gallery and open it back up to edit whenever and drag and drop pictures wherever I want. I also dont want to have to make all the thumbnails and stuff, so I also need it to do it automatically. It would also be cool if I could mouse over the small picture and it would enlarge it a little to give kind of a preview.
Flash Photo Gallery
hey guys is there such a thing as a flash photogallery without an xml file?
cause i want it that we can juste upload pics to the photo folder and they apear in the gallery.
instead of editing the xml file all the time..
Flash Photo Gallery Help
Hi. I'm making a Flash photo gallery with a lot of photos. I want to have corresponding thumbnails for each photo below the photo viewer. The problem is, I want to externally load those files when the thumbnails are clicked. How do I make those thumbnails WITHOUT importing the image itself into Flash?
Also: What are the advantages of making an XML-Based photo gallery?
Thanks a lot,
Sportzguy933
[F8] Flash Photo Gallery
In this tutorial http://www.kirupa.com/developer/mx2004/thumbnails5.htm it explain how to make a Flash Thumbnail Photo Gallery. I am designing a bigger photo gellery based on this code. how do I have the photo gallery to list 5 across and 2 rows. This code is the code that designs the thumbnail movie clip.
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
Flash Photo Gallery
some time ago i so on the "Flash Related Announcements" an flash application that lets you create a photo gallery that looks like the itunes album gallery as shown bellow.
if some one nows were to buy it let me know. or if you have seen a better slide show made with flash that looks neo concept. please let me know.
Name That Flash Photo Gallery App?
A client of mine would like to create multiple flash photo galleries like the one in this examle:
http://www.photoquestadventures.com/
Im guessing this is some sort of app you can buy.
Anyone know of something similar and where I can purchase?
thanks
Flash XML Photo Gallery
Hi friends,
I have this Photo Gallery with next and previous button which is working like loading images from the XML file.
I want to have a slide show with out next and previous instead of that stop and play. How can it be possible I am not good in programming. Please help.
ActionScript Code:
delay = 500;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
// ///////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
// ///////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
Flash Photo Gallery?
Anyone seen any examples/tutorials on how to build a photo gallery similar to the one at http://www.danicaracing.com/flashIndex.html? (click on "Photo Finish" link). I'm assuming it incorporates a database and stuff. I've build news systems that function a little like that...with boxes for the news headlines (where each gallery title is), but not sure how to do it for a photo gallery.
Flash XML Photo Gallery
Does anyone know of a simple flash/xml photo gallery editor?
With captions, and ability to upload/delete photos.
Photo Gallery Using XML And Flash
I am working on a Photo Gallery Using XML and Flash… I am using one of the popular tutorials.. it’s great for me… I am a really a beginner in flash and this tutorial has helped me to understand the magic of flash… I need help regarding the displaying the Thumbnails.
The one in source (FLA) and the tutorial explains about scrolling thumbnails. I am really looking for thumbnail to display in grid (just small thumbnail boxes)… can anyone help me please, I really appreciate it, thank you
http://www.kirupa.com/developer/mx2004/thumbnails.htm
Flash Photo Gallery
Hi, ive been trying to make a photo galley in flash like the one in (JMN PHOTOGRAPHY.COM) but i,ve not been able to, please help.
Flash Photo Gallery
Hi,
I'm trying to create a simple photography portfolio in Flash 8, whereby the user clicks on a thumbnail and the image fades up. I have 24 thumnails, so do I need to create 24 different 'fading image' movie clips, or is there an easier way to do this? Is it possible to create one movie clip and then just update the image within it?
I'm quiet a newbie so i might be missing somehting here...
Any help greatly appreciated. David.
Flash Photo Gallery
Hello. I'm looking for a flash template that is highly compatible with browsers that will scan a folder for all pictures and then allow end users to click through them using <<back and next>> Anyone know where I can get this? I'll take a tutorial :)
Flash Photo Gallery
Hi. I'm a graphic designer trying to create an online portfolio. To display my print pieces I would like to have an image gallery with a large photo to the left and text to the right. I would like to have small thumbnails a user can scroll through at the bottom. Something like these:
http://www.gatheringofthevibes.com/2007/gallery
http://www.beneventorussoduo.com/album3/index.html
I bought a template to create this type of gallery unfortunately it uses xml. I am very familiar with flash but the xml file completely throws me and I hope to stay away from it. Any help would be greatly appreciated. Thanks.
Paul
Flash Photo Gallery
Hi,
I'm trying to create a simple photography portfolio in Flash 8, whereby the user clicks on a thumbnail and the image fades up. I have 24 thumnails, so do I need to create 24 different 'fading image' movie clips, or is there an easier way to do this? Is it possible to create one movie clip and then just update the image within it?
I'm quiet a newbie so i might be missing somehting here...
Any help greatly appreciated. David.
HELP With Flash Photo Gallery
I have no clue how to program these flash galleries....My site www.al-burke.com contains a flash web gallery that I purchased online and I have been able to upload it to the site but its says movie not loaded. I have all the neccessary files in place I believe (gallery.xlm, main.html, main.swf) all under a folder. Can anyone please help me out? Thanks
Flash XML Photo Gallery
In this tutorial http://www.kirupa.com/developer/mx2004/thumbnails5.htm it explain how to make a Flash Thumbnail Photo Gallery. I am designing a bigger photo gellery based on this code. how do I have the photo gallery to list 5 pictures it create a new row . This code is the code that designs the thumbnail movie clip with all the thumbs in 1 row.
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
Edited: 09/08/2007 at 08:19:43 AM by samuels2921
Photo Gallery (flash 5)
Hi
I've tried the photo gallery tutorial but it won't work on flash 5. I've done everything that it said (and all the suggestions in the forum) but I am unable to view any of the images. Can anyone help or provide me with another photo gallery tutorial?
Cheers
jonnyB
Photo Gallery And Flash 5...
Heya all,
I am trying to get the Photo Gallery tutorial to work with flash 5, and seem to be having some diffaculty with it. First I tried to put in some custom AS, that did not work, so I opened the tut fla and exported it without changing anything and it still did not work. It will open and display the first picture, but will not scroll through the pictures using the arrow keys or the buttons. Is there something is the code that needs to be changed so it will work with Flash 5? I am just curious. I spent all day yesterday trying to get this to work with no luck.
Edit: link to the tutorial... http://www.kirupa.com/developer/mx/photogallery.htm
Thanks a bunch!
Cheers!
-Niann
|