Advanced Photo Album Template Issue
Hey all. I tried to create a photo album using the Advanced Photo Album Template that comes in Flash CS5. Everything seems to work fine - however, when you click on the thumbnails on the left hand side, the titles do not change to the appropriate thumbnail. The title simply remains the same for any thumbnail image, until you click the play or forward/backward buttons. The titles change fine when I hit the play button or scroll through with the forward or backward buttons, but not when you click on the individual thumbnails. Any idea how to change this so it functions correctly? Thanks everyone.
Code for updating the title is missing. Add following line of code inside function fl_tileClickHandler()
title_txt.text = imageDP.getItemAt(currentImageID).label;
Similar Messages
-
Adobe Flash Professional CS5, advanced photo album template
Hi there,
Hope someone can help me with this easy question.
When I use the test movie function working with the advanced photo album template my photos can not be found. I get the error message "Error #2044: Ej hanterad ioError:. text=Error #2035: URL:enhittades inte. URL: file:"
I've checked the spelling of the filenames, I use for the photos: image1.jpg, image2.jpg etc. so the filenames should be correct.
Also all the files are in the same folder, both the fla-files and the image files.
I'm using a 64 bit Windows 7 operating system, but except for this snag the program seems to be working perfectly ok..
Getting weary of all the time consuming problems.
Hoping someone can straighten this one out for me.
br/Mats JacobssonCode for updating the title is missing. Add following line of code inside function fl_tileClickHandler()
title_txt.text = imageDP.getItemAt(currentImageID).label; -
CS5 Advanced Photo Album Template Upload Issue
I just created a new flash ap from the template Advanced Photo Album (File->new->Templates->Media Playback->Advanced Photo Album)
I set everything up put my photos where they needed to be and coded the xml section of the action script. I tested it and it runs perfectly on my system. However as soon as I upload it to my server I get the flash app to load but no images appear. Its as if it can't find the xml file however its hardcoded into the flash app. How can I fix this?
Help would be greatly appreciated
Thanks
Stjc
Ps all images are in the same directory as the swf and index.html files just as they were on my local machine
Link to non working app page
Link to non working swf
AS Code
import fl.data.DataProvider;
import fl.events.ListEvent;
import fl.transitions.*;
import fl.controls.*;
// USER CONFIG SETTINGS =====
var secondsDelay:Number = 4;
var autoStart:Boolean = true;
var transitionOn:Boolean = true; // true, false
var transitionType:String = "Fade"; // Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom, Random
var hardcodedXML:String="<photos><image title='Exterior 1'>010.jpg</image><image title='Exterior 2'>012.jpg</image><image title='Exterior 3'>013.jpg</image><image title='Exterior 4'>014.jpg</image><image title='Exterior 5'>015.jpg</image><image title='Exterior 6'>016.jpg</image><image title='Exterior 7'>017.jpg</image><image title='Exterior 8'>018.jpg</image><image title='Kitchen 1'>019.jpg</image><image title='Kitchen 2'>020.jpg</image><image title='Kitchen 3'>031.jpg</image><image title='Dining Room 1'>021.jpg</image><image title='Dining Room 2'>022.jpg</image><image title='Basement 1'>027.jpg</image><image title='Basement 2'>028.jpg</image><image title='Great Room 1'>032.jpg</image><image title='Great Room 2'>033.jpg</image><image title='Bed Rooms 1'>034.jpg</image><image title='Bed Rooms 2'>035.jpg</image><image title='Bed Rooms 3'>036.jpg</image><image title='Bed Rooms 4'>037.jpg</image><image title='Bed Rooms 5'>038.jpg</image><image title='Bed Rooms 6'>039.jpg</image><image title='Bed Rooms 7'>040.jpg</image><image title='Bed Rooms 8'>042.jpg</image><image title='Bed Rooms 9'>043.jpg</image><image title='Bed Rooms 10'>044.jpg</image><image title='Interior 1'>041.jpg</image><image title='Interior 2'>046.jpg</image></photos>";
// END USER CONFIG SETTINGS
// DECLARE VARIABLES AND OBJECTS =====
var imageList:XML = new XML();
var currentImageID:Number = 0;
var imageDP:DataProvider = new DataProvider();
var slideshowTimer:Timer = new Timer((secondsDelay*1000), 0);
// END DECLARATIONS
// CODE FOR HARDCODED XML =====
imageList = XML(hardcodedXML);
fl_parseImageXML(imageList);
// END CODE FOR HARDCODED XML
// EVENTS =====
imageTiles.addEventListener(ListEvent.ITEM_CLICK, fl_tileClickHandler);
function fl_tileClickHandler(evt:ListEvent):void
imageHolder.imageLoader.source = evt.item.source;
currentImageID = evt.item.imgID;
title_txt.text = imageDP.getItemAt(currentImageID).label;
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_togglePlayPause(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
function fl_nextButtonClick(evt:MouseEvent):void
fl_nextSlide();
function fl_prevButtonClick(evt:MouseEvent):void
fl_prevSlide();
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
function fl_slideShowNext(evt:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_parseImageXML(imageXML:XML):void
var imagesNodes:XMLList = imageXML.children();
for(var i in imagesNodes)
var imgURL:String = imagesNodes[i];
var imgTitle:String = imagesNodes[i].attribute("title");
imageDP.addItem({label:imgTitle, source:imgURL, imgID:i});
imageTiles.dataProvider = imageDP;
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_startSlideShow():void
slideshowTimer.start();
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_nextSlide():void
currentImageID++;
if(currentImageID >= imageDP.length)
currentImageID = 0;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_prevSlide():void
currentImageID--;
if(currentImageID < 0)
currentImageID = imageDP.length-1;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_doTransition():void
if(transitionType == "Blinds")
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fade")
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fly")
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Iris")
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Photo")
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
} else if (transitionType == "PixelDissolve")
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Rotate")
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Squeeze")
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Wipe")
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Zoom")
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Random")
var randomNumber:Number = Math.round(Math.random()*9) + 1;
switch (randomNumber) {
case 1:
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
break;
case 2:
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});
break;
case 3:
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
break;
case 4:
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
break;
case 5:
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
break;
case 6:
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
break;
case 7:
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
break;
case 8:
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
break;
case 9:
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
break;
case 10:
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
break;
} else
trace("error - transitionType not recognized");
if(autoStart == true)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
// END FUNCTIONS AND LOGICI am havign the same problem with mine and i have tried all the suggestion on this thread, nothing is working. Still doesnt show images if I send the .swf file to a co worker. Anyone have any other ideas
my code:
import fl.data.DataProvider;
import fl.events.ListEvent;
import fl.transitions.*;
import fl.controls.*;
// USER CONFIG SETTINGS =====
var secondsDelay:Number = 2;
var autoStart:Boolean = true;
var transitionOn:Boolean = true; // true, false
var transitionType:String = "Squeeze"; // Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom, Random
var hardcodedXML:String = "<photos><image title='Quality Coverage'>images/image1.JPG</image><image title='Money Savings'>images/image2.JPG</image><image title='Home Insurance'>images/image3.JPG</image><image title='Fred Loya has Got You Covered'>images/image4.JPG</image></photos>";
// END USER CONFIG SETTINGS
// DECLARE VARIABLES AND OBJECTS =====
var imageList:XML = new XML();
var currentImageID:Number = 0;
var imageDP:DataProvider = new DataProvider();
var slideshowTimer:Timer = new Timer((secondsDelay*1005), 0);
// END DECLARATIONS
// CODE FOR HARDCODED XML =====
imageList = XML(hardcodedXML);
fl_parseImageXML(imageList);
// END CODE FOR HARDCODED XML
// EVENTS =====
imageTiles.addEventListener(ListEvent.ITEM_CLICK, fl_tileClickHandler);
function fl_tileClickHandler(evt:ListEvent):void
imageHolder.imageLoader.source = evt.item.source;
currentImageID = evt.item.imgID;
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_togglePlayPause(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
function fl_nextButtonClick(evt:MouseEvent):void
fl_nextSlide();
function fl_prevButtonClick(evt:MouseEvent):void
fl_prevSlide();
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
function fl_slideShowNext(evt:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_parseImageXML(imageXML:XML):void
var imagesNodes:XMLList = imageXML.children();
for(var i in imagesNodes)
var imgURL:String = imagesNodes[i];
var imgTitle:String = imagesNodes[i].attribute("title");
imageDP.addItem({label:imgTitle, source:imgURL, imgID:i});
imageTiles.dataProvider = imageDP;
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_startSlideShow():void
slideshowTimer.start();
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_nextSlide():void
currentImageID++;
if(currentImageID >= imageDP.length)
currentImageID = 0;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_prevSlide():void
currentImageID--;
if(currentImageID < 0)
currentImageID = imageDP.length-1;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_doTransition():void
if(transitionType == "Blinds")
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fade")
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fly")
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Iris")
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Photo")
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
} else if (transitionType == "PixelDissolve")
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Rotate")
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Squeeze")
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Wipe")
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Zoom")
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Random")
var randomNumber:Number = Math.round(Math.random()*9) + 1;
switch (randomNumber) {
case 1:
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
break;
case 2:
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});
break;
case 3:
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
break;
case 4:
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
break;
case 5:
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
break;
case 6:
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
break;
case 7:
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
break;
case 8:
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
break;
case 9:
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
break;
case 10:
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
break;
} else
trace("error - transitionType not recognized");
if(autoStart == true)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
// END FUNCTIONS AND LOGIC
/* Click to Load/Unload SWF or Image from a URL.
Clicking on the symbol instance loads and displays the specified SWF or image URL. Clicking on the symbol instance a second time unloads the SWF or image.
Instructions:
1. Replace "http://www.helpexamples.com/flash/images/image1.jpg" below with the desired URL address of the SWF or image. Keep the quotation marks ("").
2. Files from internet domains separate from the domain where the calling SWF resides cannot be loaded without special configuration.
imageHolder.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF);
import fl.display.ProLoader;
var fl_ProLoader:ProLoader;
//This variable keeps track of whether you want to load or unload the SWF
var fl_ToLoad:Boolean = true;
function fl_ClickToLoadUnloadSWF(event:MouseEvent):void
if(fl_ToLoad)
fl_ProLoader = new ProLoader();
fl_ProLoader.load(new URLRequest("http://www.helpexamples.com/flash/images/image1.jpg"));
addChild(fl_ProLoader);
else
fl_ProLoader.unload();
removeChild(fl_ProLoader);
fl_ProLoader = null;
// Toggle whether you want to load or unload the SWF
fl_ToLoad = !fl_ToLoad;
/* Click to Load/Unload SWF or Image from a URL.
Clicking on the symbol instance loads and displays the specified SWF or image URL. Clicking on the symbol instance a second time unloads the SWF or image.
Instructions:
1. Replace "http://www.helpexamples.com/flash/images/image1.jpg" below with the desired URL address of the SWF or image. Keep the quotation marks ("").
2. Files from internet domains separate from the domain where the calling SWF resides cannot be loaded without special configuration.
imageHolder.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_2);
import fl.display.ProLoader;
var fl_ProLoader_2:ProLoader;
//This variable keeps track of whether you want to load or unload the SWF
var fl_ToLoad_2:Boolean = true;
function fl_ClickToLoadUnloadSWF_2(event:MouseEvent):void
if(fl_ToLoad_2)
fl_ProLoader_2 = new ProLoader();
fl_ProLoader_2.load(new URLRequest("http://www.helpexamples.com/flash/images/image1.jpg"));
addChild(fl_ProLoader_2);
else
fl_ProLoader_2.unload();
removeChild(fl_ProLoader_2);
fl_ProLoader_2 = null;
// Toggle whether you want to load or unload the SWF
fl_ToLoad_2 = !fl_ToLoad_2; -
CS6 Advanced Photo Album Template Upload Issue
When I send the .swf to my coworker the images do not load. I have already made sure they image files are in the same folder has the .swf file. Please help
Here is my code:
import fl.data.DataProvider;
import fl.events.ListEvent;
import fl.transitions.*;
import fl.controls.*;
// USER CONFIG SETTINGS =====
var secondsDelay:Number = 2;
var autoStart:Boolean = true;
var transitionOn:Boolean = true; // true, false
var transitionType:String = "Squeeze"; // Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom, Random
var hardcodedXML:String = "<photos><image title='Quality Coverage'>image1.JPG</image><image title='Money Savings'>image2.JPG</image><image title='Home Insurance'>image3.JPG</image><image title='Fred Loya has Got You Covered'>image4.JPG</image></photos>";
// END USER CONFIG SETTINGS
// DECLARE VARIABLES AND OBJECTS =====
var imageList:XML = new XML();
var currentImageID:Number = 0;
var imageDP:DataProvider = new DataProvider();
var slideshowTimer:Timer = new Timer((secondsDelay*1005), 0);
// END DECLARATIONS
// CODE FOR HARDCODED XML =====
imageList = XML(hardcodedXML);
fl_parseImageXML(imageList);
// END CODE FOR HARDCODED XML
// EVENTS =====
imageTiles.addEventListener(ListEvent.ITEM_CLICK, fl_tileClickHandler);
function fl_tileClickHandler(evt:ListEvent):void
imageHolder.imageLoader.source = evt.item.source;
currentImageID = evt.item.imgID;
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_togglePlayPause(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
function fl_nextButtonClick(evt:MouseEvent):void
fl_nextSlide();
function fl_prevButtonClick(evt:MouseEvent):void
fl_prevSlide();
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
function fl_slideShowNext(evt:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_parseImageXML(imageXML:XML):void
var imagesNodes:XMLList = imageXML.children();
for(var i in imagesNodes)
var imgURL:String = imagesNodes[i];
var imgTitle:String = imagesNodes[i].attribute("title");
imageDP.addItem({label:imgTitle, source:imgURL, imgID:i});
imageTiles.dataProvider = imageDP;
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_startSlideShow():void
slideshowTimer.start();
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_nextSlide():void
currentImageID++;
if(currentImageID >= imageDP.length)
currentImageID = 0;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_prevSlide():void
currentImageID--;
if(currentImageID < 0)
currentImageID = imageDP.length-1;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_doTransition():void
if(transitionType == "Blinds")
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fade")
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fly")
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Iris")
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Photo")
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
} else if (transitionType == "PixelDissolve")
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Rotate")
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Squeeze")
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Wipe")
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Zoom")
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Random")
var randomNumber:Number = Math.round(Math.random()*9) + 1;
switch (randomNumber) {
case 1:
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
break;
case 2:
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});
break;
case 3:
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
break;
case 4:
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
break;
case 5:
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
break;
case 6:
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
break;
case 7:
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
break;
case 8:
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
break;
case 9:
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
break;
case 10:
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
break;
} else
trace("error - transitionType not recognized");
if(autoStart == true)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
// END FUNCTIONS AND LOGIC
/* Click to Load/Unload SWF or Image from a URL.
Clicking on the symbol instance loads and displays the specified SWF or image URL. Clicking on the symbol instance a second time unloads the SWF or image.
Instructions:
1. Replace "http://www.helpexamples.com/flash/images/image1.jpg" below with the desired URL address of the SWF or image. Keep the quotation marks ("").
2. Files from internet domains separate from the domain where the calling SWF resides cannot be loaded without special configuration.
imageHolder.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF);
import fl.display.ProLoader;
var fl_ProLoader:ProLoader;
//This variable keeps track of whether you want to load or unload the SWF
var fl_ToLoad:Boolean = true;
function fl_ClickToLoadUnloadSWF(event:MouseEvent):void
if(fl_ToLoad)
fl_ProLoader = new ProLoader();
addChild(fl_ProLoader);
else
fl_ProLoader.unload();
removeChild(fl_ProLoader);
fl_ProLoader = null;
// Toggle whether you want to load or unload the SWF
fl_ToLoad = !fl_ToLoad;
/* Click to Load/Unload SWF or Image from a URL.
Clicking on the symbol instance loads and displays the specified SWF or image URL. Clicking on the symbol instance a second time unloads the SWF or image.
Instructions:
1. Replace "http://www.helpexamples.com/flash/images/image1.jpg" below with the desired URL address of the SWF or image. Keep the quotation marks ("").
2. Files from internet domains separate from the domain where the calling SWF resides cannot be loaded without special configuration.
imageHolder.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_2);
import fl.display.ProLoader;
var fl_ProLoader_2:ProLoader;
//This variable keeps track of whether you want to load or unload the SWF
var fl_ToLoad_2:Boolean = true;
function fl_ClickToLoadUnloadSWF_2(event:MouseEvent):void
if(fl_ToLoad_2)
fl_ProLoader_2 = new ProLoader();
fl_ProLoader_2.load(new URLRequest("http://www.helpexamples.com/flash/images/image1.jpg"));
addChild(fl_ProLoader_2);
else
fl_ProLoader_2.unload();
removeChild(fl_ProLoader_2);
fl_ProLoader_2 = null;
// Toggle whether you want to load or unload the SWF
fl_ToLoad_2 = !fl_ToLoad_2;how would I check to make sure I am using relative paths?
-
Cs5 Advanced Photo Album Template Live Links
I'm using this template as a "quick & dirty" content slider for my website. I got everything to work great, there's no issues with it's functionality or actionscript. I would just like to make each image a "clickable" link. I got 4 images that I want to take users to 4 separate webpages, I've searched and searched for answers but most are over my head. Is there anybody that could help me? Here's the actions:
import fl.data.DataProvider;
import fl.events.ListEvent;
import fl.transitions.*;
import fl.controls.*;
// USER CONFIG SETTINGS =====
var secondsDelay:Number = 7;
var autoStart:Boolean = true;
var transitionOn:Boolean = true; // true, false
var transitionType:String = "Fade"; // Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom, Random
var hardcodedXML:String="<photos><image title='Your Choice'>image1.jpg</image><image title='Quick Option'>image2.jpg</image><image title='New Product'>image3.jpg</image><image title='Get Started'>image4.jpg</image></photos>";
// END USER CONFIG SETTINGS
// DECLARE VARIABLES AND OBJECTS =====
var imageList:XML = new XML();
var currentImageID:Number = 0;
var imageDP:DataProvider = new DataProvider();
var slideshowTimer:Timer = new Timer((secondsDelay*1000), 0);
// END DECLARATIONS
// CODE FOR HARDCODED XML =====
imageList = XML(hardcodedXML);
fl_parseImageXML(imageList);
// END CODE FOR HARDCODED XML
// EVENTS =====
imageTiles.addEventListener(ListEvent.ITEM_CLICK, fl_tileClickHandler);
function fl_tileClickHandler(evt:ListEvent):void
imageHolder.imageLoader.source = evt.item.source;
currentImageID = evt.item.imgID;
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_togglePlayPause(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
function fl_nextButtonClick(evt:MouseEvent):void
fl_nextSlide();
function fl_prevButtonClick(evt:MouseEvent):void
fl_prevSlide();
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
function fl_slideShowNext(evt:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_parseImageXML(imageXML:XML):void
var imagesNodes:XMLList = imageXML.children();
for(var i in imagesNodes)
var imgURL:String = imagesNodes[i];
var imgTitle:String = imagesNodes[i].attribute("title");
imageDP.addItem({label:imgTitle, source:imgURL, imgID:i});
imageTiles.dataProvider = imageDP;
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_startSlideShow():void
slideshowTimer.start();
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_nextSlide():void
currentImageID++;
if(currentImageID >= imageDP.length)
currentImageID = 0;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_prevSlide():void
currentImageID--;
if(currentImageID < 0)
currentImageID = imageDP.length-1;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_doTransition():void
if(transitionType == "Blinds")
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fade")
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fly")
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Iris")
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Photo")
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
} else if (transitionType == "PixelDissolve")
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Rotate")
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Squeeze")
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Wipe")
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Zoom")
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Random")
var randomNumber:Number = Math.round(Math.random()*9) + 1;
switch (randomNumber) {
case 1:
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
break;
case 2:
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});
break;
case 3:
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
break;
case 4:
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
break;
case 5:
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
break;
case 6:
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
break;
case 7:
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
break;
case 8:
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
break;
case 9:
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
break;
case 10:
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
break;
} else
trace("error - transitionType not recognized");
if(autoStart == true)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");Without writing the code for you, the general idea is knowing what the image number is. That seems to be your issue. Your click events need to be able to extract the name of the image that was clicked (who's instance name can have that number in it). Based on that number you can determine what to do.
Any MouseEvent.CLICK function handlers will give you the name (if you set it) of what was clicked.
e.g.
import flash.display.Sprite;
import flash.events.MouseEvent;
var a:Sprite = new Sprite();
a.beginFill(0xFF0000,1);
a.graphics.drawRect(0,0,100,100); // draw red rectangle
a.graphics.endFill();
addChild(a);
// give it a name
a.name = "a_1";
a.addEventListener(MouseEvent.CLICK, handleClick);
// Now on a click, extract the name and use it:
function handleClick(e:MouseEvent):void
// what button was clicked?
trace(e.target.name);
// get the number
var num:int = int(e.target.name.toString().split('_')[1]);
trace("Button #" + num + " clicked");
// do something based on the number
if (num == 1)
// do something based on button 1
else if (num == 2)
// do something based on button 2
// etc... -
Advanced Photo Album SWF Movies Playback
Hello
I linked an .swf movie into the Flash CS5 Advanced Photo Album template and have found that if I press the "next" button, the movie continues to play. You can't go back to it.
Does anyone have a tip to stop a .swf movie when I proceed to the next one?Hello
I linked an .swf movie into the Flash CS5 Advanced Photo Album template and have found that if I press the "next" button, the movie continues to play. You can't go back to it.
Does anyone have a tip to stop a .swf movie when I proceed to the next one? -
Wanted to Edit "Create Web Photo Album" template
I'm using MX2004.
I've recently done a major, major overhaul on a website I
manage. We use the "Create Web Photo Album" (not an extension - the
one that came with DW) extensively, but with the new design, the
basic photo album template isn't going to cut it. I could probably
sit with it myself and drop created photo albums into a template
page and make it work, but I'm not the only one doing photo albums
and some of the other people aren't the most... technically
competent.
What I'd like to do is somehow edit the template that
Dreamweaver uses to create the photo album so that it looks like
how we're wanting without any post-album-created-action.
Is this possible? Is there an extension that'll work for this
as well? (Looks like the Exchange is currently down, so that isn't
helping me in my search.)Get the free extension "Create Web Photo Album 2" from Adobe.
It has many
pre made templates plus instructions on how to create your
own.
Michael Hager
www.cmhager.com
"Dexter74656" <[email protected]> wrote in
message
news:eor42n$oe3$[email protected]..
> I'm using MX2004.
>
> I've recently done a major, major overhaul on a website
I manage. We use
> the
> "Create Web Photo Album" (not an extension - the one
that came with DW)
> extensively, but with the new design, the basic photo
album template isn't
> going to cut it. I could probably sit with it myself and
drop created
> photo
> albums into a template page and make it work, but I'm
not the only one
> doing
> photo albums and some of the other people aren't the
most... technically
> competent.
>
> What I'd like to do is somehow edit the template that
Dreamweaver uses to
> create the photo album so that it looks like how we're
wanting without any
> post-album-created-action.
>
> Is this possible? Is there an extension that'll work for
this as well?
> (Looks
> like the Exchange is currently down, so that isn't
helping me in my
> search.)
> -
Can I adjust size of the photos on front page of the photo album template?
When I am working on a Photo Album page, how can I make the "front page" photos larger? I am talking about the photos arranged in rows, not the photos that show in the slide show carousel. Is it a set size in the Photo Album template or is it a consequence of how large a photo I set into the page?
Also, how is "large" defined? Is it about inches, or is it about resolution?
— Lorna in Southern CaliforniaI found the large too large and the small too large.
How large do you want them Lorna?
.......... Lorna says ................................................
Michael, where did you go to check to see that the large was indeed too large and the small too large? What method of adjusting the size are you using?
If you want them really large, why don't you just
plonk the real photo on the page sized as large as
you wish, and you can always link it to its own page
with an even larger version!!
.......... Lorna says ................................................
Michael, actually I misstated in my first post. Actually I would not like the photos in the Photo page to be too large, because then no one will be motivated to click onto the See Slideshow button.
My mind is getting so crammed with input and other people's websites that I now cannot even recall with certainty which pictures I wanted larger. 8-( Oh, this is giving me a cramped-in-the-chest feeling. I had best take a break now and finally eat a legitimate meal.
— Lorna in Southern California -
How to mod Photo Album Template
Web Photo Album – Part 3: How to Modify a Web Photo
Album Template - is a great tutorial for DW MX, but is there a
similar one for DW8? The template's and directory structure
outlined in this rather old tutorial, is no longer the same in DW8.
Since it is impossible to apply a template to a group of pages,
being able to customize this "create photo album" extension would
be great....thanksYou can select any object on one page and copy and paste it to another. You can also select a group of objects (like several images or text boxes) and copy and paste them over. Then you can move thess objects around and reposition them on the photo page.
-
hi
i have created the album successfully with my pictures, but i would like to know how to remove the autostart from the code. i want to do this becasue i am putting it on the website with a couple other albums and they all start to play at once. please let me know how to remove autostart from the code.
thanksWhat are they? Are these albums individual .swf files that are imported, are they movie clips in the Library or are they actionscript classes? How are they added to the timeline or the display list?
-
Photos: album list issue
Occasionally my album list scrolls up beneath the "Albums" title. It eventually corrects or I need to power cycle to get it uncovered. Any simple change to fix this?
Your fix ( or a reset) is the only one I have seen discussed in this forum for the problem.
-
Forward button bypasses delay in photo album
I am a novice with Flash Pro but took on the challenge of creating a slideshow for a website. I used Flash Pro CS5 and the Advanced Photo Album template. I fought it out for a while and searched around for information before eventually getting it to load the images and work as coded.
All went well and I published the .SWF and all the images to the site's root folder but whenever I click the 'forward' button it skips an image. The delay is set to 5 seconds but it would appear that the forward button bypasses the delay i.e. if I leave an image up for 3 seconds and then press the forward button, the next image will only display for 2 seconds before siwtching to the following one, despite the delay being set to 5. If I let it run automatically all the images follow the delay rule. I have included the code below. The only thing I have altered is the duration of the 'fade' transition from 0.25 to 1.
Note: I have had to embed the HTML not the .SWF as when embedding the .SWF on the site it brought up the flash element but none of the images. Not sure if this is having an effect on the coding.
Many thanks for any assistance
import fl.data.DataProvider;
import fl.events.ListEvent;
import fl.transitions.*;
import fl.controls.*;
// USER CONFIG SETTINGS =====
var secondsDelay:Number = 5;
var autoStart:Boolean = true;
var transitionOn:Boolean = true; // true, false
var transitionType:String = "Fade"; // Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom, Random
var hardcodedXML:String="<photos><image title='Rank Badges'>image1.png</image><image title='How It Works'>image2.png</image><image title='First Steps'>image3.png</image><image title='Brain Crank'>image4.png</image><image title='Natural Friendship'>image5.png</image><image title='Fire Hazard'>image6.png</image><image title='I Got This'>image7.png</image><image title='Magic Act'>image8.png</image><image title='Replay'>image9.png</image><image title='Samaritan'>image10.png</image><image title='No Tag Backs'>image11.png</image></photos>";
// END USER CONFIG SETTINGS
// DECLARE VARIABLES AND OBJECTS =====
var imageList:XML = new XML();
var currentImageID:Number = 0;
var imageDP:DataProvider = new DataProvider();
var slideshowTimer:Timer = new Timer((secondsDelay*1000), 0);
// END DECLARATIONS
// CODE FOR HARDCODED XML =====
imageList = XML(hardcodedXML);
fl_parseImageXML(imageList);
// END CODE FOR HARDCODED XML
// EVENTS =====
imageTiles.addEventListener(ListEvent.ITEM_CLICK, fl_tileClickHandler);
function fl_tileClickHandler(evt:ListEvent):void
imageHolder.imageLoader.source = evt.item.source;
currentImageID = evt.item.imgID;
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_togglePlayPause(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
function fl_nextButtonClick(evt:MouseEvent):void
fl_nextSlide();
function fl_prevButtonClick(evt:MouseEvent):void
fl_prevSlide();
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
function fl_slideShowNext(evt:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_parseImageXML(imageXML:XML):void
var imagesNodes:XMLList = imageXML.children();
for(var i in imagesNodes)
var imgURL:String = imagesNodes[i];
var imgTitle:String = imagesNodes[i].attribute("title");
imageDP.addItem({label:imgTitle, source:imgURL, imgID:i});
imageTiles.dataProvider = imageDP;
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_startSlideShow():void
slideshowTimer.start();
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_nextSlide():void
currentImageID++;
if(currentImageID >= imageDP.length)
currentImageID = 0;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_prevSlide():void
currentImageID--;
if(currentImageID < 0)
currentImageID = imageDP.length-1;
if(transitionOn == true)
fl_doTransition();
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_doTransition():void
if(transitionType == "Blinds")
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fade")
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:1});
} else if (transitionType == "Fly")
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Iris")
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Photo")
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
} else if (transitionType == "PixelDissolve")
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Rotate")
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Squeeze")
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Wipe")
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Zoom")
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Random")
var randomNumber:Number = Math.round(Math.random()*9) + 1;
switch (randomNumber) {
case 1:
TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});
break;
case 2:
TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:1});
break;
case 3:
TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});
break;
case 4:
TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});
break;
case 5:
TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});
break;
case 6:
TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
break;
case 7:
TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});
break;
case 8:
TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});
break;
case 9:
TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});
break;
case 10:
TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});
break;
} else
trace("error - transitionType not recognized");
if(autoStart == true)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
// END FUNCTIONS AND LOGICYes, declared the var transition:Class
The error it gives now is:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_rank_fla::MainTimeline/fl_parseImageXML()
at flash_rank_fla::MainTimeline/frame1()
The template is in Flash Professional CS5. New/Templates/Media Playback/Advanced Photo Album.
I will admit this is all alien to me but I suppose this is the par for the course - trial and error.
I am tempted to abandon this and go with something simpler but I was looking for the ability to pause the slide show and move froward/backward between images independant of the timer.
This is the code as it stands
import fl.data.DataProvider;
import fl.events.ListEvent;
import fl.transitions.*;
import fl.controls.*;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.utils.Timer;
// USER CONFIG SETTINGS =====
var secondsDelay:Number = 5;
var autoStart:Boolean = true;
var transitionOn:Boolean = true; // true, false
var transitionsList:Object = {Blinds: Blinds, Fade: Fade, Fly: Fly, Iris: Iris, Photo: Photo, PixelDissolve: PixelDissolve, Rotate: Rotate, Rotate: Rotate, Squeeze: Squeeze, Wipe: Wipe, Zoom: Zoom};
var randomTransitions:Array = [Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom];
var transitionType:String = "Fade"; // Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom, Random
var imageList:XML = new XML(<photos><image title='Rank Badges'>image1.png</image><image title='How It Works'>image2.png</image><image title='First Steps'>image3.png</image><image title='Brain Crank'>image4.png</image><image title='Natural Friendship'>image5.png</image><image title='Fire Hazard'>image6.png</image><image title='I Got This'>image7.png</image><image title='Magic Act'>image8.png</image><image title='Replay'>image9.png</image><image title='Samaritan'>image10.png</image><image title='No Tag Backs'>image11.png</image></photos>);
fl_parseImageXML(imageList);
// END USER CONFIG SETTINGS
// DECLARE VARIABLES AND OBJECTS =====
var _currentImageID:Number = 0;
var imageDP:DataProvider = new DataProvider();
var slideshowTimer:Timer = new Timer((secondsDelay * 1000));
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
// END DECLARATIONS
// EVENTS =====
imageTiles.addEventListener(ListEvent.ITEM_CLICK, fl_tileClickHandler);
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_tileClickHandler(e:ListEvent):void
imageHolder.imageLoader.source = e.item.source;
currentImageID = e.item.imgID;
function fl_togglePlayPause(e:MouseEvent):void
if (playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if (playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
function fl_nextButtonClick(e:MouseEvent):void
fl_pauseSlideShow();
fl_nextSlide();
function fl_prevButtonClick(e:MouseEvent):void
fl_pauseSlideShow();
fl_prevSlide();
function fl_slideShowNext(e:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_parseImageXML(imageXML:XML):void
var imagesNodes:XMLList = imageXML.children();
for (var i:String in imagesNodes)
imageDP.addItem({label: imagesNodes[i].@title, source: imagesNodes[i], imgID: int(i)});
imageTiles.dataProvider = imageDP;
imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;
title_txt.text = imageDP.getItemAt(currentImageID).label;
function fl_startSlideShow():void
slideshowTimer.start();
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_nextSlide():void
currentImageID++;
function fl_prevSlide():void
currentImageID--;
function get currentImageID():Number
return _currentImageID;
function set currentImageID(value:Number):void
_currentImageID = value < 0 ? imageDP.length - 1 : value;
_currentImageID = value >= imageDP.length ? 0 : value;
imageHolder.imageLoader.source = imageDP.getItemAt(_currentImageID).source;
title_txt.text = imageDP.getItemAt(_currentImageID).label;
if (transitionOn)
fl_doTransition();
function fl_doTransition():void
var transition:Class;
var duration:Number = .25;
if (transitionType == "Random")
transition = randomTransitions[int(randomTransitions.length * Math.random())] as Class;
duration = transition == Fade ? 1 : duration;
else
transition = transitionsList[transitionType] as Class;
if (!transition)
return;
TransitionManager.start(imageHolder, {type: transition, direction: Transition.IN, duration: duration});
if (autoStart)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
// END FUNCTIONS AND LOGIC -
Simple Photo Album "previous" button issue
Hello! I have created a slide show using the Simple Photo Album template in Flash. All works fine except for when I click the "previous" button to view the previous slide. When I click it, the movie skips back 3 slides instead of just one. How can I fix this?
Thanks!
Jessietry:
jwood_its wrote:
Oops, here it is!
// USER CONFIG SETTINGS =====
var autoStart:Boolean = false; //true, false
var secondsDelay:Number = 2; // 1-60
// END USER CONFIG SETTINGS
// EVENTS =====
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_togglePlayPause(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
function fl_nextButtonClick(evt:MouseEvent):void
fl_nextSlide();
function fl_prevButtonClick(evt:MouseEvent):void
fl_prevSlide();
var currentImageID:Number;
var slideshowTimer:Timer;
var appInit:Boolean;
function fl_slideShowNext(evt:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_startSlideShow():void
slideshowTimer.start();
function fl_nextSlide():void
currentImageID++;
if(currentImageID >= totalFrames)
currentImageID = 0;
gotoAndStop(currentImageID+1);
function fl_prevSlide():void
currentImageID--;
if(currentImageID < 0)
currentImageID = totalFrames+1;
gotoAndStop(currentImageID+1);
if(autoStart == true)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
} else {
gotoAndStop(1);
function initApp(){
currentImageID = 0;
slideshowTimer = new Timer((secondsDelay*1000), 0);
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
if(appInit != true){
initApp();
appInit = true;
// END FUNCTIONS AND LOGIC -
Flash Prof. CS5 simple photo album/slideshow template
I am trying to use the "simple photo album" template that comes with Flash Prof. CS5. I have it working except I want it to play by default. The actionscript that came with the template is below (in blue), but if I set var autoStart:Boolean = true; I get the following error and the controls do not work:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at nt_fla::MainTimeline/fl_startSlideShow()
at nt_fla::MainTimeline/frame1()
// USER CONFIG SETTINGS =====
var autoStart:Boolean = false; //true, false
var secondsDelay:Number = 2; // 1-60
// END USER CONFIG SETTINGS
// EVENTS =====
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_togglePlayPause(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
function fl_nextButtonClick(evt:MouseEvent):void
fl_nextSlide();
function fl_prevButtonClick(evt:MouseEvent):void
fl_prevSlide();
var currentImageID:Number;
var slideshowTimer:Timer;
var appInit:Boolean;
function fl_slideShowNext(evt:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_startSlideShow():void
slideshowTimer.start();
function fl_nextSlide():void
currentImageID++;
if(currentImageID >= totalFrames)
currentImageID = 0;
gotoAndStop(currentImageID+1);
function fl_prevSlide():void
currentImageID--;
if(currentImageID < 0)
currentImageID = totalFrames+1;
gotoAndStop(currentImageID-1);
if(autoStart == true)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
} else {
gotoAndStop(1);
function initApp(){
currentImageID = 0;
slideshowTimer = new Timer((secondsDelay*1000), 0);
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
if(appInit != true){
initApp();
appInit = true;
// END FUNCTIONS AND LOGIC
Does anyone have any idea how to fix this so that the slideshow starts automatically and stops when the pause button is clicked?
Thanks,
LisaI finally got it to work, but had to edit the action script because it seemed to have a logic error. Here is the action script I finally used; maybe this will help you:
// USER CONFIG SETTINGS =====
var autoStart:Boolean = false; //true, false
var secondsDelay:Number = 3; // 1-60
// END USER CONFIG SETTINGS
// EVENTS =====
playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
function fl_togglePlayPause(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "play")
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
else if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
function fl_nextButtonClick(evt:MouseEvent):void
if(playPauseToggle_mc.currentLabel == "pause")
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
fl_nextSlide();
function fl_prevButtonClick(evt:MouseEvent):void
fl_pauseSlideShow();
playPauseToggle_mc.gotoAndStop("play");
fl_prevSlide();
var currentImageID:Number;
var slideshowTimer:Timer;
var appInit:Boolean;
function fl_slideShowNext(evt:TimerEvent):void
fl_nextSlide();
// END EVENTS
// FUNCTIONS AND LOGIC =====
function fl_pauseSlideShow():void
slideshowTimer.stop();
function fl_startSlideShow():void
slideshowTimer.start();
function fl_nextSlide():void
currentImageID++;
if(currentImageID > totalFrames)
currentImageID = 1;
gotoAndStop(currentImageID);
function fl_prevSlide():void
currentImageID--;
if(currentImageID <= 0)
currentImageID = totalFrames;
gotoAndStop(currentImageID);
if(autoStart == true)
fl_startSlideShow();
playPauseToggle_mc.gotoAndStop("pause");
} else {
gotoAndStop(1);
function initApp(){
currentImageID = 0;
slideshowTimer = new Timer((secondsDelay*1000), 0);
slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
slideshowTimer.start();
playPauseToggle_mc.gotoAndStop("pause");
if(appInit != true){
initApp();
appInit = true;
// END FUNCTIONS AND LOGIC -
So I have an issue. All the .gif files I have on my computer that I upload to my phone via iTunes (syncing photo albums) are magically converted to .jpg files. This is incredibly annoying because I want them to be animated when I email or text them. Is there a way to fix his, or perhaps use an SSH program to manually create photo albums on the iPhone?
Thanks in advance
~NateRight... But I definitely dont want to do that for 90+ images.
Besides I dont want them in the normal camera roll. I want them in a separate album
Maybe you are looking for
-
How to create and attach a castlib to a movie
Hi, I would like to know if there is a way to create and attach an external castlib to a movie with lingo. I need to insert a new cast in about 2 hundred movies... Thanks Paolo
-
Why won't my App Store open? (OS X 10.8.4)
Whenever I try to open my App Store, the App Store appears but immediately crashes. I am really bummed out because I can't do updates and get apps! Can anyone help me Here is the crash report: Process: App Store [3255] Path: /Appli
-
Migrating From Lotus-TeamRoom to Sharepoint
Hi , We are planning to shift to sharepoint From TeamRoom , I need to clarify few things 1) There are about 100 categories with documents in each category . Is it possible to import all the documents from Teamroom to Sharepoint with the same categori
-
Shipment cost for inbound deliveries
HI ALL, pls can anyone tell me how to transfer or add the frieht cost calculated during the inbound shipment to the material cost(inventory costing). how is it doneand in which transaction it is done pls ASASP thanks in advance
-
How dowe add the standard profile for example :S_A.ADMIN into a role ? Or do we Directly assign it ?