MOVIECLIP SLIDESHOW
Hi,
I am trying to create a slideshow that has a 'next' and
'previous' button, which lets you see the next or previous
movieclip when you click one of the buttons. I have done the 'next'
button but cannot do the 'previous' button, please can someone
help!! Also, I would like the next button to disappear when you are
at the last image, and the 'previous button' to disappear when you
are on the first image. I have attached the code I have created so
far.
Thanks alot!!
Hi,
I tried doing the links like this a couple of days ago and it
does not work, it only takes you to the first url (which is the
'Greenfield' one in this case, but when you are on the 'Millstock'
image it does not take you to the 'Millstock' Website, it still
takes you to the 'Greenfield' one). Please see the example of this
http://abwebsitedesign.co.uk/flashtest/
. It also takes you to the adobe website in the current page, any
idea why it might do this? also, the 'previous' button does not
show when you click 'back' on the last image, it only shows when
you click the 'previous' button 2 times.please let me know if you
can help with this. Attached is what my code looks like.
Many Thanks.
Similar Messages
-
How can I restart or load function
I am creting an application that containts 3 seperate slideshows inside movie clips, when one slideshow finishes the other starts. I do this by triggering the function inside the other movieclip slideshow ( _root.slideshow2.startSlideshow(); ) and stopping the currently running function startSlideshow = null; inside existing slide. It works until it gets to the 3rd slideshow and than everything freezes because all the functions where deleted. My question is how can I restart or reload the sam function again?
use another variable to reference startSlideshow so you can alternately null and then re-define that variable. for example, define startSlideshow:
function startSlideshow(){
//whatever
and don't ever directly call it. use another variable to reference startSlideshow:
var startSS:Function = startSlideshow;
when you want that code to executed, null startSS when you want that code to stop
startSS = null
and then when you want it to restart,
startSS = startSlideshow
make sure none of your nested code calls startSlideshow directly. all those old references to startSlideshow need to be changed to startSS. -
Slideshow, Thumbnails& MovieClips Oh My!
I would like to create a thumbnail scrollbar where there is a
panel of thumbnails (SlideShow1, Slideshow2, Slideshow3, etc) which
are MovieClips populated from external jpgs. The Movie clip also
needs to be able to display a description of the thumbnail. I want
to be able to click on the thumbnail and load a movie (SlideshowMC)
into the big picture area
To put it visually:
| |
| |
| |
| SlideshowMC# |
| |
| |
|___________________|
{Scrollbar <<<<<
MC.Slideshow1[ThumbPic1 and ThumbDesc1]
MC.Slideshow2[ThumbPic2 and ThumbDesc2] MC.Slideshow3[ThumbPic3 and
ThumbDesc3] MC.Slideshow3[ThumbPic4 and ThumbDesc4]
>>>>>Scrollbar}
Any help would be appreciatedHere is the code I have in place for the thumbnails, is there
a way to truncate this?
function loadThmb() {
_level0.myMCL.loadClip("Pix/thmb0.jpg",
this.panelTop.thmb0.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb1.jpg",
this.panelTop.thmb1.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb2.jpg",
this.panelTop.thmb2.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb3.jpg",
this.panelTop.thmb3.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb4.jpg",
this.panelTop.thmb4.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb5.jpg",
this.panelMid.thmb5.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb6.jpg",
this.panelMid.thmb6.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb7.jpg",
this.panelMid.thmb7.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb8.jpg",
this.panelMid.thmb8.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb9.jpg",
this.panelMid.thmb9.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb10.jpg",
this.panelBot.thmb10.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb11.jpg",
this.panelBot.thmb11.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb12.jpg",
this.panelBot.thmb12.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb13.jpg",
this.panelBot.thmb13.MC_thmbPic);
_level0.myMCL.loadClip("Pix/thmb14.jpg",
this.panelBot.thmb14.MC_thmbPic);
(The MCL is on a Master swf which loads all the other
movies) -
MovieClip buttons inside a MovieClip button inside another MovieClip button
I am trying to make a Portfolio of my study abroad experience and can get something right about the movie clip buttons inside each other. I have a button to click on titled "travel" and a window shows up with more movieclip buttons to organize different locations of pictures. I can click on the button to have to slide of pictures but nothing happens. I have the "turnOffAllButtons" coding and also have the coding for stay clicked, but I can't get the 3rd set to show up. what am i not doing?
I don't have any errors or output comments showing upI have it working now. what I did, I make a slideshow setup (gotoAndStop(1);) in a specific frame and the code I put in for the next, didnt work.
this is was I have now, without the "turnOffAllButtons" coding:
Main Button (actions Layer):
stop();
travelButton_mc.buttonMode=true;
travelButton_mc.addEventListener(MouseEvent.ROLL_OVER, colorizetravelButton);
function colorizetravelButton(givenEvent:MouseEvent){
if (givenEvent.currentTarget.currentFrame != 50)
travelButton_mc.gotoAndPlay(2);
travelButton_mc.addEventListener(MouseEvent.ROLL_OUT, decolorizetravelButton);
function decolorizetravelButton(givenEvent:MouseEvent){
if (givenEvent.currentTarget.currentFrame != 50)
travelButton_mc.gotoAndPlay(21);
travelButton_mc.addEventListener(MouseEvent.CLICK, loadtravelLocations);
function loadtravelLocations(givenEvent:MouseEvent){
travelButton_mc.gotoAndStop(50);
travelLocations_mc.gotoAndPlay(1);
Inside the travelLocations_mc I have currently one button to show a slide of pictures, this is the second layer of buttoncode:
stop();
scotlandButton_mc.buttonMode=true;
scotlandButton_mc.addEventListener(MouseEvent.ROLL_OVER, colorizescotlandButton);
function colorizescotlandButton(givenEvent:MouseEvent){
if (givenEvent.currentTarget.currentFrame != 50)
scotlandButton_mc.gotoAndPlay(2);
scotlandButton_mc.addEventListener(MouseEvent.ROLL_OUT, decolorizescotlandButton);
function decolorizescotlandButton(givenEvent:MouseEvent){
if (givenEvent.currentTarget.currentFrame != 50)
scotlandButton_mc.gotoAndPlay(21);
scotlandButton_mc.addEventListener(MouseEvent.CLICK, loadscotlandInfoPage);
function loadscotlandInfoPage(givenEvent:MouseEvent){
scotlandButton_mc.gotoAndStop(50);
scotlandInfoPage_mc.gotoAndPlay(1);
I turned the alpha up so you can see the mc that loads
I currently have a keyframe at 60 with a code of stop(); so the travelLocations_mc will still
does this make sense? -
How to create buttons for each slide in slideshow
I currently have a slideshow working with prev and next buttons,
but would like to add numbered buttons for each slide at bottom of images,
with a static number for the active slide that has a colored circle around that number.
I can create static number with colored circle in Photoshop and add that to a layer,
but it's labor intensive to do that for all numbers.
Is there a better way to create the highlighted numbers for active slide?
For numbered buttons that link to non-active slides, I can create numbers in Photoshop and import images into Flash,
then convert to symbols and assign actions for them,
But that too is labor intensive to do for all the numbers.
Is there a better way to create numbered buttons for non-active slides?
I'd also like to have a hover function on the numbered buttons,
that changes from plain image of number to number with colored circle like I want to use for active slide.
How do I assign a hover function to button symbol, that will load another image or symbol?Try to think in terms of having reusable symbols. Think it thru before you try it.
Use a movieclip symbol instead of a button. Have a dynamic textfield in that movieclip for the number, and set the textfield to not be selectable. Have one frame of this movieclip where it displays as the highlighted (selected) one and have the movieclip go there where you are on that slide.
Use the textfield for the number--assign it dynamically so that you don't have to import an image for it. Use as many of these movieclips as you need to for all your buttons.
Have functions that reset all the buttons at once so that when you move to a new slide, the previously selected one goes back to mormal... follow that with setting the newly selected one to be in its "selected" frame. -
How to stop a slideshow and show another movie clip at the end?
Currently my slideshow is in a loop. At the end of last slideshow, I want to show another movie clip (End_mv) that's on another layer. How do I do that? My current scripts are below:
import fl.transitions.Tween;
import fl.transitions.easing.*;
//change scale on an image
var fadeTween:Tween;
//To slide in on X axis
var slideXTween:Tween;
//To slide in on Y axis
var slideYTween:Tween;
//To fade IN
var alphaTween:Tween;
//To get bigger on its X axis
var scaleXTween:Tween;
//To get bigger on its Y axis
var scaleYTween:Tween;
//var fadeTween:Tween;
//description place holder
var strDescrp:String;
//source place holder
var strSource:String;
//x poistion
var posX:Number;
//y position
var posY:Number;
//degree rotation
var degreeRot:Number;
// delay between slides
//const TIMER_DELAY:int = 5000;
var TIMER_DELAY:int = 5000;
// fade time between slides
const FADE_TIME:int = 3;
// reference to the current slider container
var currentContainer:Sprite;
// index of the current slide
var intCurrentSlide:int = -1;
// total slides
var intSlideCount:int;
// timer for switching slides
var slideTimer:Timer;
// slides holder
var sprContainer1:Sprite;
var sprContainer2:Sprite;
// slides loader
var slideLoader:Loader;
// url to slideshow xml
var strXMLPath:String = "lstHouse.xml";
// slideshow xml loader
var xmlLoader:URLLoader;
// slideshow xml
var xmlSlideshow:XML;
var txtField:TextField = new TextField();
var formatText:TextFormat = new TextFormat();
//start of sound section is for sound
var soundReq:URLRequest = new URLRequest("PaukenBrumfiel_AngelsOnHigh.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
//end of sound section
function onComplete(event:Event):void
sound.play();
function init():void
// create new urlloader for xml file
xmlLoader = new URLLoader();
// add listener for complete event
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
// load xml file
xmlLoader.load(new URLRequest(strXMLPath));
// create new timer with delay from constant
slideTimer = new Timer(TIMER_DELAY);
// add event listener for timer event
slideTimer.addEventListener(TimerEvent.TIMER, switchSlide);
// create 2 container sprite which will hold the slides and
// add them to the masked movieclip
sprContainer1 = new Sprite();
sprContainer2 = new Sprite();
mcSlideHolder.addChild(sprContainer1);
mcSlideHolder.addChild(sprContainer2);
// keep a reference of the container which is currently
// in the front
currentContainer = sprContainer2;
function onXMLLoadComplete(event:Event):void
// create new xml with the received data
xmlSlideshow = new XML(event.target.data);
// get total slide count
intSlideCount = xmlSlideshow..image.length();
// switch the first slide without a delay
switchSlide(null);
function fadeSlideIn(e:Event):void {
// add loaded slide from slide loader to the
// current container
currentContainer.addChild(slideLoader.content);
// clear preloader text
//mcInfo.lbl_loading.text = "";
// fade the current container in and start the slide timer
// when the tween is finished
//Tweener.addTween(currentContainer, {alpha:1, time:FADE_TIME, onComplete:function() { slideTimer.start(); }});
//strSource = xmlSlideshow.image[intCurrentSlide].@src;
fadeTween = new Tween(currentContainer, "alpha", Regular.easeInOut, 0, 1, 2, true)
//scale = new Tween(currentContainer, "alpha", Regular.easeInOut, 0, 1, 2, true)
slideTimer.start()
onComplete:function();
function switchSlide(e:Event):void
// check, if the timer is running (needed for the
// very first switch of the slide)
if(slideTimer.running)
slideTimer.stop();
// check if we have any slides left and increment
// current slide index
if(intCurrentSlide + 1 < intSlideCount)
intCurrentSlide++;
// if not, start slideshow from beginning
else
intCurrentSlide = 0;
// check which container is currently in the front and
// assign currentContainer to the one that's in the back with
// the old slide
if(currentContainer == sprContainer2)
currentContainer = sprContainer1;
else
currentContainer = sprContainer2;
// hide the old slide
currentContainer.alpha = 0;
// bring the old slide to the front
mcSlideHolder.swapChildren(sprContainer2, sprContainer1);
strDescrp = xmlSlideshow.image[intCurrentSlide].@desc;
//strSource = xmlSlideshow.image[intCurrentSlide].@src;
//txtField.border = true;
//txtField.x = 0;
//txtField.y = 600;
txtField.width = 855;
txtField.height = 200;
//txtField.background = true;
//txtField.backgroundColor = 0xEE9A00;
txtField.alpha = 20;
txtField.text = strDescrp;
formatText.align = TextFormatAlign.CENTER;
//txtField.autoSize = TextFieldAutoSize.LEFT;
formatText.color = 0x000;
formatText.size = 30;
txtField.x = 0;
txtField.y = 550;
posX = 0;
posY = 0;
degreeRot = 0;
// create a new loader for the slide
slideLoader = new Loader();
// add event listener when slide is loaded
slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, fadeSlideIn);
// load the next slide
slideLoader.load(new URLRequest(xmlSlideshow.image[intCurrentSlide].@src));
addChild(txtField);
txtField.setTextFormat(formatText)
// init slideshow
init();I got this error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/swapChildren()
at University_Advancement_Holiday_Greeting2012_fla::MainTimeline/switchSlide()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
And here's the code:
// import tweener
//import caurina.transitions.Tweener;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.MovieClip;
//change scale on an image
var fadeTween:Tween;
//To slide in on X axis
var slideXTween:Tween;
//To slide in on Y axis
var slideYTween:Tween;
//To fade IN
var alphaTween:Tween;
//To get bigger on its X axis
var scaleXTween:Tween;
//To get bigger on its Y axis
var scaleYTween:Tween;
//var fadeTween:Tween;
//description place holder
var strDescrp:String;
//source place holder
var strSource:String;
//x poistion
var posX:Number;
//y position
var posY:Number;
//degree rotation
var degreeRot:Number;
// delay between slides
//const TIMER_DELAY:int = 5000;
var TIMER_DELAY:int = 5000;
// fade time between slides
const FADE_TIME:int = 3;
// reference to the current slider container
var currentContainer:Sprite;
// index of the current slide
var intCurrentSlide:int = -1;
// total slides
var intSlideCount:int;
// timer for switching slides
var slideTimer:Timer;
// slides holder
var sprContainer1:Sprite;
var sprContainer2:Sprite;
// slides loader
var slideLoader:Loader;
// url to slideshow xml
var strXMLPath:String = "lstHouse.xml";
// slideshow xml loader
var xmlLoader:URLLoader;
// slideshow xml
var xmlSlideshow:XML;
var txtField:TextField = new TextField();
var formatText:TextFormat = new TextFormat();
//var myEnding:MovieClip = stage.getChildByName('End_mc') as MovieClip;
//start of sound section is for sound
var soundReq:URLRequest = new URLRequest("PaukenBrumfiel_AngelsOnHigh.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
//end of sound section
function onComplete(event:Event):void
sound.play();
function init():void
//reference my movie clip "End_mc" oon the stage and turn its visibility off
MovieClip(getChildByName('End_mc')).visible = false;
// create new urlloader for xml file
xmlLoader = new URLLoader();
// add listener for complete event
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
// load xml file
xmlLoader.load(new URLRequest(strXMLPath));
// create new timer with delay from constant
slideTimer = new Timer(TIMER_DELAY);
// add event listener for timer event
slideTimer.addEventListener(TimerEvent.TIMER, switchSlide);
// create 2 container sprite which will hold the slides and
// add them to the masked movieclip
sprContainer1 = new Sprite();
sprContainer2 = new Sprite();
mcSlideHolder.addChild(sprContainer1);
mcSlideHolder.addChild(sprContainer2);
// keep a reference of the container which is currently
// in the front
currentContainer = sprContainer2;
//function onXMLLoadComplete(e:Event):void
function onXMLLoadComplete(event:Event):void
// create new xml with the received data
xmlSlideshow = new XML(event.target.data);
// get total slide count
intSlideCount = xmlSlideshow..image.length();
// switch the first slide without a delay
switchSlide(null);
function fadeSlideIn(e:Event):void {
// add loaded slide from slide loader to the
// current container
currentContainer.addChild(slideLoader.content);
// clear preloader text
//mcInfo.lbl_loading.text = "";
// fade the current container in and start the slide timer
// when the tween is finished
//Tweener.addTween(currentContainer, {alpha:1, time:FADE_TIME, onComplete:function() { slideTimer.start(); }});
//strSource = xmlSlideshow.image[intCurrentSlide].@src;
fadeTween = new Tween(currentContainer, "alpha", Regular.easeInOut, 0, 1, 2, true)
//scale = new Tween(currentContainer, "alpha", Regular.easeInOut, 0, 1, 2, true)
slideTimer.start()
onComplete:function();
function switchSlide(e:Event):void
// check, if the timer is running (needed for the
// very first switch of the slide)
if(slideTimer.running)
slideTimer.stop();
// ADDED: Check if using sprContainer2 and at the last slide
//if ((currentContainer == sprContainer2) && (intCurrentSlide == intSlideCount))
trace("Current Slide: " + intCurrentSlide);
trace("SlideCount: " + intSlideCount);
if ((currentContainer == sprContainer2) && ((intCurrentSlide + 1) == intSlideCount))
// hide the slideshow (and other related elements, or remove them if desired)
//mcSlideHolder.visible = false;
// remove any clips directly inside slideshow (any timers/etc need to be stopped too)
while (mcSlideHolder.numChildren > 0)
mcSlideHolder.removeChildAt(0);
// I do see a var named 'sound' playing so you might want to:
//sound.stop();
//sound = null;
// etc any other slideshow-only elements to hide/remove..
// play your movie
MovieClip(getChildByName('End_mc')).visible = true;
MovieClip(getChildByName('End_mc')).play();
// check if we have any slides left and increment
// current slide index
if(intCurrentSlide + 1 < intSlideCount)
intCurrentSlide++;
// if not, start slideshow from beginning
else
intCurrentSlide = 0;
// check which container is currently in the front and
// assign currentContainer to the one that's in the back with
// the old slide
if(currentContainer == sprContainer2)
currentContainer = sprContainer1;
else
currentContainer = sprContainer2;
// hide the old slide
currentContainer.alpha = 0;
// bring the old slide to the front
mcSlideHolder.swapChildren(sprContainer2, sprContainer1);
strDescrp = xmlSlideshow.image[intCurrentSlide].@desc;
//strSource = xmlSlideshow.image[intCurrentSlide].@src;
//txtField.border = true;
//txtField.x = 0;
//txtField.y = 600;
txtField.width = 855;
txtField.height = 200;
//txtField.background = true;
//txtField.backgroundColor = 0xEE9A00;
txtField.alpha = 20;
txtField.text = strDescrp;
formatText.align = TextFormatAlign.CENTER;
//txtField.autoSize = TextFieldAutoSize.LEFT;
formatText.color = 0x000;
formatText.size = 30;
txtField.x = 0;
txtField.y = 550;
posX = 0;
posY = 0;
degreeRot = 0;
// create a new loader for the slide
slideLoader = new Loader();
// add event listener when slide is loaded
slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, fadeSlideIn);
// add event listener for the progress
//slideLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
// load the next slide
slideLoader.load(new URLRequest(xmlSlideshow.image[intCurrentSlide].@src));
addChild(txtField);
txtField.setTextFormat(formatText)
// init slideshow
init(); -
Probleme changing the value of a variable in movieclip from my scene
Hello,
i have a probleme changing the value of a variable in movieclip from my scene. i explain: I have combobox on my scene containing categories, and in the scene i load an xml file containing links to php files that work with the combobox.
Also on the scene i have a movieclip "filmstrip", inside this movieclip on the first frame i have a script loading the php file selected in the scene . i use a load() function with a variable "theUrl" inside like this : T.load(theUrl);.
In my scene i want to change the value of "theUrl" inside the movieClip filmstrip. I tried filmstrip.theUrl = url; But it doesnt work
the xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<slideshow>
<area title1="10 Last updated" link1="link1.php"/>
<area title1="special" link1="link2.php"/>
</slideshow>
here is the code on my scene:
var link1:Array = new Array();
var LINK:String;
var url:String;
var whoOn:Number;
whoOn=0;
var x:XML = new XML();
x.ignoreWhite = true;
x.onLoad = function(success) {
var photos:Array = this.firstChild.childNodes;
for (i=0; i<photos.length; i++) {
_root.link1.push(photos[i].attributes.link1);
url=link1[whoOn];
filmstrip.theUrl=url;//<<--HERE
x.load("category.xml");
var cbListener:Object = new Object();
cbListener.change = function(event_obj:Object) {
trace(select.selectedItem.label);
if (select.selectedItem.label == "Last updated") {
whoOn=0;
} else if (select.selectedItem.label == "Special") {
whoOn=1;
url=link1[whoOn];
filmstrip.theUrl=url; //<<-----HERE
select.addEventListener("change",cbListener);
here is the code inside the movie clip "filmstrip"
var T:XML = new XML();
T.ignoreWhite = true;
T.onLoad = function(xml) {
etc etc etc }
T.load(theUrl); //<<---HERE it still undefinedYESSSS . Thanks you very much Kglad it wotk i put all in a function inside the filmstrip function Tload(theUrl){etc ect}and in the root i call it like this filmstrip.Tload(theUrl); and it works
code in the root var link1:Array = new Array();
var LINK:String;
var url:String;
var whoOn:Number;
whoOn=0;
var x:XML = new XML();
x.ignoreWhite = true;
x.onLoad = function(success) {
var photos:Array = this.firstChild.childNodes;
for (i=0; i<photos.length; i++) {
_root.link1.push(photos[i].attributes.link1);
url=link1[whoOn];
theUrl=url;
filmstrip.Tload(theUrl);//<<--HERE
x.load("category.xml");
var cbListener:Object = new Object();
cbListener.change = function(event_obj:Object) {
trace(select.selectedItem.label);
if (select.selectedItem.label == "Last updated") {
whoOn=0;
} else if (select.selectedItem.label == "Special") {
whoOn=1;
url=link1[whoOn];
theUrl=url;
filmstrip.Tload(theUrl);//<<-----HERE
select.addEventListener("change",cbListener); -
Help with Buttons for Slideshow
I'm working on my first flash project. I have created a simple 4 image slideshow. I have created 4 Buttons that when clicked, jump to that image in the timeline. I have added Rollover States to the button. Everything is working like I want it to.
My question is how can I get the buttons to have a different look when that particular image is active?
Example. When the slideshow is on the 2nd image, I want Button 2 to have an active state (look different than the other three buttons).
Here is my project file.
Thanksyou have to use movieclip buttons.
-
How to place a movieclip on top of external swf
Hi there.
I have a main.swf in which i load a xml flash slideshow (.swf).
I want to place a menu which will be shown in front of the slideshow gallery.
I place the menu at an upper layer but the menu appears behind the slideshow.
Can anyone help with this and generally(i.e. in case i want to place something else on top or behind something else)
Thanks in advanceIf you were to replace that dynamically created empty movieclip with a manually created one placed in the timeline that would take care of the first suggestion I offered.
As for the the swapDepths usage and what you showed, you should be able to use something to the effect of... myGalleryContainer.swapDepths(myMenu);
If you want to see what depth am object resides at, you can use the getDepth() metod, as in... myMenu.getDepth(); -
Slideshow issues with variable time for each picture
Hi all,
I've migrated from AS1 to AS3, and boy, a lot has changed...
Anyhow, to learn and understand AS3, I'm modifying a slideshow I found through thetechlabs. I want it to play SWF as well as JPG. These files are passed through an XML file. I added an element called <delaytime> to the XML file that replaces the standard time a photo is shown in the slideshow.
I modified the onSlideFadeIn() function as follows:
function onSlideFadeIn():void {
slideTimer.removeEventListener(TimerEvent.TIMER, nextSlide);
slideTimer = new Timer(xmlSlideshow..file[intCurrentSlide].@time);
slideTimer.addEventListener(TimerEvent.TIMER, nextSlide);
if(bolPlaying && !slideTimer.running)
slideTimer.start();
However, when I run it, I get this error message:
## [Tweener] Error: [object Sprite] raised an error while executing the 'onComplete'handler.
TypeError: Error #1010: A term is undefined and has no properties.
at slideshow_fla::MainTimeline/onSlideFadeIn()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at caurina.transitions::Tweener$/::updateTweenByIndex()
at caurina.transitions::Tweener$/::updateTweens()
at caurina.transitions::Tweener$/onEnterFrame()
It stops at the first picture of my slideshow. When I push the 'next' button it displays the next pic, but I get the same error message again.
When I comment out this line:
slideTimer = new Timer(xmlSlideshow..file[intCurrentSlide].@time);
the slideshow runs OK, but without the delaytime specified in the XML file.
I'm lost here, what am I missing?
Any help to get me back on track is highly appreciated!
Thanks a bunch in advance,
Dirk
Here is the complete AS, should you need it:
// import tweener
import caurina.transitions.Tweener;
// delay between slides
const TIMER_DELAY:int = 5000;
// fade time between slides
const FADE_TIME:Number = 1;
// flag for knowing if slideshow is playing
var bolPlaying:Boolean = true;
// reference to the current slider container
var currentContainer:Sprite;
// index of the current slide
var intCurrentSlide:int = -1;
// total slides
var intSlideCount:int;
// timer for switching slides
var slideTimer:Timer;
// slides holder
var sprContainer1:Sprite;
var sprContainer2:Sprite;
// slides loader
var slideLoader:Loader;
// current slide link
var strLink:String = "";
// current slide link target
var strTarget:String = "";
// url to slideshow xml
var strXMLPath:String = "slideshow-data2.xml";
// slideshow xml loader
var xmlLoader:URLLoader;
// slideshow xml
var xmlSlideshow:XML;
function initSlideshow():void {
// hide buttons, labels and link
mcInfo.visible = false;
btnLink.visible = false;
// create new urlloader for xml file
xmlLoader = new URLLoader();
// add listener for complete event
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
// load xml file
xmlLoader.load(new URLRequest(strXMLPath));
// create new timer with delay from constant
slideTimer = new Timer(TIMER_DELAY);
// add event listener for timer event
slideTimer.addEventListener(TimerEvent.TIMER, nextSlide);
// create 2 container sprite which will hold the slides and
// add them to the masked movieclip
sprContainer1 = new Sprite();
sprContainer2 = new Sprite();
mcSlideHolder.addChild(sprContainer1);
mcSlideHolder.addChild(sprContainer2);
// keep a reference of the container which is currently
// in the front
currentContainer = sprContainer2;
// add event listeners for buttons
btnLink.addEventListener(MouseEvent.CLICK, goToWebsite);
btnLink.addEventListener(MouseEvent.ROLL_OVER, showDescription);
btnLink.addEventListener(MouseEvent.ROLL_OUT, hideDescription);
mcInfo.btnPlay.addEventListener(MouseEvent.CLICK, togglePause);
mcInfo.btnPause.addEventListener(MouseEvent.CLICK, togglePause);
mcInfo.btnNext.addEventListener(MouseEvent.CLICK, nextSlide);
mcInfo.btnPrevious.addEventListener(MouseEvent.CLICK, previousSlide);
// hide play button
mcInfo.btnPlay.visible = false;
function onXMLLoadComplete(e:Event):void {
// show buttons, labels and link
mcInfo.visible = true;
btnLink.visible = true;
// create new xml with the received data
xmlSlideshow = new XML(e.target.data);
// get total slide count
intSlideCount = xmlSlideshow..image.length();
// switch the first slide without a delay
switchSlide(0);
function fadeSlideIn(e:Event):void {
// add loaded slide from slide loader to the
// current container
addSlideContent();
// clear preloader text
mcInfo.lbl_loading.text = "";
// check if the slideshow is currently playing
// if so, show time to the next slide. If not, show
// a status message
if(bolPlaying) {
mcInfo.lbl_loading.text = "Next slide in " + TIMER_DELAY / 1000 + " sec.";
} else {
mcInfo.lbl_loading.text = "Slideshow paused";
// fade the current container in and start the slide timer
// when the tween is finished
Tweener.addTween(currentContainer, {alpha:1, time:FADE_TIME, onComplete:onSlideFadeIn});
function onSlideFadeIn():void {
slideTimer.removeEventListener(TimerEvent.TIMER, nextSlide);
slideTimer = new Timer(xmlSlideshow..file[intCurrentSlide].@time);
slideTimer.addEventListener(TimerEvent.TIMER, nextSlide);
if(bolPlaying && !slideTimer.running)
slideTimer.start();
function togglePause(e:MouseEvent):void {
// check if the slideshow is currently playing
if(bolPlaying) {
// show play button
mcInfo.btnPlay.visible = true;
mcInfo.btnPause.visible = false;
// set playing flag to false
bolPlaying = false;
// set status message
mcInfo.lbl_loading.text = "Slideshow paused";
// stop the timer
slideTimer.stop();
} else {
// show pause button
mcInfo.btnPlay.visible = false;
mcInfo.btnPause.visible = true;
// set playing flag to true
bolPlaying = true;
// show time to next slide
mcInfo.lbl_loading.text = "Next slide in " + TIMER_DELAY / 1000 + " sec.";
// reset and start timer
slideTimer.reset();
slideTimer.start();
function switchSlide(intSlide:int):void {
// check if the last slide is still fading in
if(!Tweener.isTweening(currentContainer)) {
// check, if the timer is running (needed for the
// very first switch of the slide)
if(slideTimer.running)
slideTimer.stop();
// change slide index
intCurrentSlide = intSlide;
// check which container is currently in the front and
// assign currentContainer to the one that's in the back with
// the old slide
if(currentContainer == sprContainer2)
currentContainer = sprContainer1;
else
currentContainer = sprContainer2;
// hide the old slide
currentContainer.alpha = 0;
// bring the old slide to the front
mcSlideHolder.swapChildren(sprContainer2, sprContainer1);
//Van hier
if (currentContainer.numChildren > 0) {
var slideObjRef:DisplayObject = currentContainer.getChildAt(0);
currentContainer.removeChildAt(0);
slideObjRef = null;
//Tot hier
// delete loaded content
clearLoader();
// create a new loader for the slide
slideLoader = new Loader();
// add event listener when slide is loaded
slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, fadeSlideIn);
// add event listener for the progress
slideLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
// load the next slide
slideLoader.load(new URLRequest(xmlSlideshow..image[intCurrentSlide].@src));
// show description of the next slide
mcInfo.lbl_description.text = xmlSlideshow..image[intCurrentSlide].@title;
// set link and link target variable of the slide
strLink = xmlSlideshow..image[intCurrentSlide].@link;
strTarget = xmlSlideshow..image[intCurrentSlide].@target;
mcInfo.mcDescription.lbl_description.htmlText = xmlSlideshow..image[intCurrentSlide].@desc;
// show current slide and total slides
mcInfo.lbl_count.text = (intCurrentSlide + 1) + " / " + intSlideCount + " Slides";
function showProgress(e:ProgressEvent):void {
// show percentage of the bytes loaded from the current slide
mcInfo.lbl_loading.text = "Loading..." + Math.ceil(e.bytesLoaded * 100 / e.bytesTotal) + "%";
function goToWebsite(e:MouseEvent):void {
// check if the strLink is not empty and open the link in the
// defined target window
if(strLink != "" && strLink != null) {
navigateToURL(new URLRequest(strLink), strTarget);
function nextSlide(e:Event = null):void {
// check, if there are any slides left, if so, increment slide
// index
if(intCurrentSlide + 1 < intSlideCount)
switchSlide(intCurrentSlide + 1);
// if not, start slideshow from beginning
else
switchSlide(0);
function previousSlide(e:Event = null):void {
// check, if there are any slides left, if so, decrement slide
// index
if(intCurrentSlide - 1 >= 0)
switchSlide(intCurrentSlide - 1);
// if not, start slideshow from the last slide
else
switchSlide(intSlideCount - 1);
function showDescription(e:MouseEvent):void {
// remove tweens
Tweener.removeTweens(mcInfo.mcDescription);
// fade in the description
Tweener.addTween(mcInfoThanks, but no luck so far...
With the debugging publish setting on, I get the following error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at slideshow_fla::MainTimeline/slideshow_fla::frame1()[slideshow_fla.MainTimeline::frame1:12 3]
Line 123 says:
trace(xmlSlideshow..file[intCurrentSlide].@time);
However, when I comment out the trace() line it gives another error message:
## [Tweener] Error: [object Sprite] raised an error while executing the 'onComplete'handler.
TypeError: Error #1010: A term is undefined and has no properties.
at slideshow_fla::MainTimeline/onSlideFadeIn()[slideshow_fla.MainTimeline::frame1:118]
Where line 118 is:
slideTimer = new Timer(Number(xmlSlideshow..file[intCurrentSlide].@time));
Now, according to my Flash manual I bought, I need to 'instanciate' things. Did I forget this?
Just can't get my head around this OOP stuff...
Thanks a bunch for helping me! -
Having problem aligning images in slideshow
Thw slide show can be viewed here http://www.jimslounge.com/slideshow/bio.swf
The images are added to a background MovieClip they are set to align in the center both horizontal and vertical. They usually do but often they are a little off and sometimes they are way off. Pics are added tha a Sprite called holder then holder is added to the background MovieClip holderBG the problem occures in the displaySlide function. I've noticed the alignment problem seems to go away when I create a new instance of holder there but when I do that the memory usage steadly climes higher with each new slide.
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import flash.net.*;
var myFont:Font2 = new Font2();
var externalReq:URLRequest = new URLRequest("bio.txt");
var externalLoad:URLLoader = new URLLoader();
var myFormat:TextFormat = new TextFormat();
var bars:Bars = new Bars();
var n:int = 0;
var intCurrentSlide:int;
var req:URLRequest;
var holder:Sprite = new Sprite();
var holderBG:HolderBG = new HolderBG();
var loader:Loader;
var rand:int;
var nxtNum:int;
var picNum:String;
var slideCount:int;
var xmlLoader:URLLoader; // slideshow xml loader
var xmlSlideshow:XML; // slideshow xml
var strXMLPath:String = "bioPics-data.xml";
var slideName:String;
// var history:Array = new Array();
var duration:Number=.5;
var prevSlide:String;
var timeline:TimelineMax;
addChild(holderBG);
holderBG.x = stage.stageWidth / 2 - holderBG.width / 2;
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
xmlLoader.load(new URLRequest(strXMLPath));
///////////// text setup ////////////////////
myFormat.font = myFont.fontName;
myFormat.size = 14;
myFormat.leading = 2.5;
bioText.setStyle("textFormat", myFormat);
bioText.setStyle("embedFonts", true);
bioText.textField.alpha=1;
externalLoad.load(externalReq);
externalLoad.addEventListener(Event.COMPLETE, textReady);
/////////////text setup////////////////////////
createTimeline();
function textReady(event:Event):void {
bioText.htmlText = event.target.data;
function onXMLLoadComplete(e:Event):void {
xmlLoader.removeEventListener(Event.COMPLETE, onXMLLoadComplete);
xmlSlideshow = new XML(e.target.data); // create new xml with the received data
slideCount = xmlSlideshow..image.length(); // get total slide count
loadSlide();
function loadSlide():void {
// prevSlide=history[history.length-1];
rand = Math.ceil(Math.random()* slideCount - 1);
loader = new Loader();
req = new URLRequest(xmlSlideshow..@src[rand]);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, displaySlide);
loader.load(req);
slideName = xmlSlideshow..@src[rand].toString();
function createTimeline():void {
timeline =new TimelineMax({repeat:1,repeatDelay:5,yoyo:true,onComplete:loadSlide, paused:true});
for (var count:int = 1; count <=10; count++) {
var mc:MovieClip=bars["bar"+count];
timeline.append(TweenMax.from(mc, duration, {x:"64", alpha:0, ease:Cubic.easeOut}), -.4);
function displaySlide(e:Event = null):void {
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, displaySlide);
// holder = new Holder(); if I do this lose the alignment problem but gain a menory problem.
if(holder.numChildren > 0){holder.removeChildAt(0);}
holder.addChild(loader.content);
// center the pic
holder.x=holderBG.width/2 - holder.width/2;
holder.y=holderBG.height/2 - holder.height/2;
// make the mask position over the pic
bars.x=holder.x;
bars.y=holder.y;
bars.cacheAsBitmap=true;
holder.cacheAsBitmap=true;
holder.mask=bars;
bars.width = holder.width;
bars.height = holder.height;
holderBG.addChild(holder);
holderBG.addChild(bars);
timeline.restart();Aha... I haven't had my coffee either
. That did it
if (holderBG.holder)
holderBG.removeChild(holder);
holderBG.holder = null;
It isn't perfect it sitll wonders around slightly like a drunk weaving on the road but only slightly he's only had a couple of beers and isn't likely to get pulled over which is an improvement. I'll go with it. Thanks! -
Problem aligning images in slideshow
I have a slide show in a site I'm building for a friend the slide show can be viewed by going to http://www.droolpigs.com/ and clicking the About Us button
the inages are supposed to be centered and 90% of the time they are. I would like to see them centered 100% of the time.
here's the code:
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
var myFont:Font3 = new Font3();
var extReq:URLRequest = new URLRequest("bio.txt");
var extLoader:URLLoader = new URLLoader();
var myFormat:TextFormat = new TextFormat();
var tf:TextField = new TextField();
var tf3:TextField = new TextField();
var msk:Sprite = new Sprite();
var tl:TimelineMax = new TimelineMax({repeat:-1});
// var bio:Bio = new Bio();
var bars:Bars = new Bars();
var n:int = 0;
var intCurrentSlide:int;
var req:URLRequest;
var holder:Sprite = new Sprite();
// var holderBG:HolderBG = new HolderBG();
var loader:Loader;
var rand:int;
var nxtNum:int;
var picNum:String;
var slideCount:int;
var xmlLoader:URLLoader; // slideshow xml loader
var xmlSlideshow:XML; // slideshow xml
var strXMLPath:String = "bioPics-data.xml";
var slideName:String;
var history:Array = new Array();
var duration:Number=.5;
var prevSlide:String;
var timeline:TimelineMax;
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
xmlLoader.load(new URLRequest(strXMLPath));
///////////// text setup ////////////////////
tf.x =-285;
//tf.y =655;
tf.y=700;
tf.width = 700;
tf.height = 800;
tf.multiline=true;
tf.wordWrap=true;
tf.condenseWhite=true;
//tf2
tf3.x =-285;
tf3.y =660;
tf3.width = 700;
tf3.height = 20;
tf3.htmlText = '<font color = "#dd8800" size = "14px">Contact links and Email: <a href="http://www.droolpigs.com">droolpigs.com</a> | <a href="http://www.myspace.com/acousticshadowz">myspace site</a> <a href="mailto://[email protected]//[email protected]">[email protected]</a> | <a href="mailto://[email protected]//[email protected]">[email protected]</a></font>';
addChild(tf);
addChild(tf3);
msk.graphics.beginFill(0x000000);
msk.graphics.drawRect(0, 0, 700, 165);
msk.x = -285;
msk.y = 485;
msk.graphics.endFill();
extLoader.addEventListener(Event.COMPLETE, textReady);
myFormat.font = myFont.fontName;
myFormat.color = "0xffaa00";
//0x77ffaa
myFormat.size = 18;
myFormat.leading = 2.5;
tf.defaultTextFormat=myFormat;
tf.embedFonts=true;
tf.alpha=1;
extLoader.load(extReq);
function textReady(e:Event):void {
tf.cacheAsBitmap=true;
msk.cacheAsBitmap=true;
tf.mask=msk;
addChild(msk);
tf.htmlText=e.target.data;
tl.insert( new TweenLite(tf, 70, {y:"-940", ease:Linear.easeNone}) );
//////////////text setup////////////////////////
createTimeline();
function onXMLLoadComplete(e:Event):void {
xmlLoader.removeEventListener(Event.COMPLETE, onXMLLoadComplete);
xmlSlideshow = new XML(e.target.data); // create new xml with the received data
slideCount = xmlSlideshow..image.length(); // get total slide count
loadSlide();
function loadSlide():void {
prevSlide=history[history.length-1];
rand = Math.ceil(Math.random()* slideCount - 1);
loader = new Loader();
req = new URLRequest(xmlSlideshow..@src[rand]);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, displaySlide);
loader.load(req);
slideName = xmlSlideshow..@src[rand].toString();
if(slideName != prevSlide){
history.push(slideName);
loader.load(new URLRequest(xmlSlideshow..@src[rand]));
}else{
loadSlide();
function createTimeline():void{
timeline =new TimelineMax({repeat:1,repeatDelay:5,yoyo:true,onComplete:loadSlide, paused:true});
for (var count:int = 1; count <=10; count++) {
var mc:MovieClip=bars["bar"+count];
timeline.append(TweenMax.from(mc, duration, {x:"64", alpha:0, ease:Cubic.easeOut}), -.4);
function displaySlide(e:Event = null):void {
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, displaySlide);
if (holderBG.holder)
holderBG.removeChild(holder);
holderBG.holder = null;
// trace ("holder.numChildren "+holder.numChildren);
if(holder.numChildren > 0){holder.removeChildAt(0);}
holder.addChild(loader.content);
// center the pic
holder.x=holderBG.width/2 - holder.width/2;
holder.y=holderBG.height/2 - holder.height/2;
// make the mask position over the pic
bars.x=holder.x;
bars.y=holder.y;
bars.cacheAsBitmap=true;
holder.cacheAsBitmap=true;
holder.mask=bars;
bars.width = holder.width;
bars.height = holder.height;
holderBG.addChild(holder);
holderBG.addChild(bars);
timeline.restart(); }I resized them all in Photshop so neither the width or height would exceed the width or height of the background. I'm not sure what you mean by properly croped but their dimensions do fit. I also noticed that if you see an image misaligned you'll notice later that the same image will be aligned. One of the folks a greensock suggested that it might be a bug in the Adobe loader so I'll try their loader and see if it makes a differencs.
-
Need help with automatic slideshow
I made an automatic slideshow that switches frames at a set
interval but now i want to load each frame from an extrenal swf and
add a preloader for each frame, how do i tell the slideshow to wait
until the frame is loaded before it proceeds to the next frame, but
still have the movieclip be automatic. Also the slideshow can be
controlled mannually so i also want to know how to disable the
manual control till each frame is loaded.Here is some of the action script for the slideshow.
This first bit sets up the automatic interval transitions in
the main movie timeline
function nextImage()
mc_slide.mc_transition.play();
} // End of the function
function waitImage()
clearInterval(slideTimer);
var slideTimer = setInterval(nextImage, timer * 1000);
nextImage();
} // End of the function
function pauseSlide()
mc_slide.mc_quicktransition.gotoAndPlay(2);
} // End of the function
var timer = 8;
var pauseTime = 20;
var slideTimer = setInterval(nextImage, timer * 2000);
stop ();
the movieclip loaders that load each movie clip are embedded
with the transition animation.
this is the code in the embedded mc-it loads the 1st movie
clip and allows the user to manually jump to any of the other movie
clips.
emptyMC.loadMovie("frame1.swf");
var pageAddress = "about:blank";
btn1.onRelease = function ()
_parent.pauseSlide();
gotoAndStop(1);
btn2.onRelease = function ()
_parent.pauseSlide();
gotoAndStop(2);
btn3.onRelease = function ()
_parent.pauseSlide();
gotoAndStop(3);
btn4.onRelease = function ()
_parent.pauseSlide();
gotoAndStop(4);
stop();
I need to know how to put the code for the automation of the
slideshow pause until each movieclip has finished loading and also
at the same time disable the manual control of the movie clips
before they are fully loaded. -
Trouble integrating tween into slideshow
I found a simple tween with the following code:
import com.greensock.*;
import com.greensock.easing.*;
bars.cacheAsBitmap=true;
img.cacheAsBitmap=true;
img.mask=bars;
//create TimelineMax instance and set to repeat infinitely
var timeline:TimelineMax=new TimelineMax({repeat:-1,repeatDelay:1,yoyo:true});
//speed vars
var duration:Number=.5;
//loop through bar in bars clip and add tween to timeline
for (var count:Number = 1; count <=10; count++) {
//create reference to each individual clip
var mc:MovieClip=bars["bar"+count];
timeline.append(TweenMax.from(mc, duration, {x:"64", alpha:0, ease:Cubic.easeOut}), -.4);
In the example the image and mask are both on the stage from the start - not added dynamically.
you can see it here: http://www.jimslounge.com/tweenTest/mask_bars.swf
I would like to integrate it into my slide show
here is the code:
import com.greensock.*;
import com.greensock.easing.*;
var bars:Bars = new Bars();
var xmlLoader:URLLoader; // slideshow xml loader
var xmlSlideshow:XML; // slideshow xml
var strXMLPath:String = "slideshow-data.xml";
var loader:Loader;
var intSlideCount:int;
var holder:Sprite = new Sprite();
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
xmlLoader.load(new URLRequest(strXMLPath));
function onXMLLoadComplete(e:Event):void {
xmlLoader.removeEventListener(Event.COMPLETE, onXMLLoadComplete);
xmlSlideshow = new XML(e.target.data); // create new xml with the received data
intSlideCount = xmlSlideshow..image.length(); // get total slide count
loadSlide(null);
function loadSlide(e:Event):void {
trace("we loaded slide");
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, displaySlide);
loader.load(new URLRequest(xmlSlideshow..@src[1]));
trace(loader.contentLoaderInfo);
function displaySlide(e:Event):void {
holder.addChild(loader);
bars.cacheAsBitmap=true;
holder.cacheAsBitmap=true;
holder.mask=bars;
addChild(holder);
var timeline:TimelineMax=new TimelineMax({repeat:-1,repeatDelay:2.5,yoyo:true});
var duration:Number=.5;
for (var count:Number = 1; count <=10; count++) {
//create reference to each individual clip
var mc:MovieClip=bars["bar"+count];
timeline.append(TweenMax.from(mc, duration, {x:"64", alpha:0, ease:Cubic.easeOut}), -.4);
bars.width=holder.width;
bars.height=holder.height;
I create an instance of a Sprite, load an external image using xml, add the image as a child of the Sprite instance "holder", add holder the the stage then run the tween.
this is what it looks like http://www.jimslounge.com/tweenTest/my_mask_bars.swf
The tween doesn't run till I re-size the stage and when it runs gives a different effect.There could be a compatibility issue between PostgreSQL and TestStand. I does seem to recognize the database but some of the functions may not be supported by TestStand. I have no experience using this DBMS but I would recommend you to use a supported one.
-
Interactive slideshow with JPGs
Hi Flash experts,
I have to build a Flash project. The challenges are:
1. Preload 5 JPG images onto a movieclip container
2. Produce a slideshow which loads the 5 external JPGs
3. Autoplay and transition between pictures
4. Have 5 buttons to go straight to the relevant image on the
slideshow and
smart enough continue playing the slideshow from that point
5. A clickable area within the slideshow image to display the
larger version
of the image (can use emptymovieclip actionscript function)
6. When user click to open the large version of the image,
the
transition/autoplay should pause and continue when it closes
I have done the first 3.5 points of the challenge but stuck
on the rest. If
anyone can suggest or direct me with an approach or example
to solve this
challenge that would be very much appreciated.
Thanks.
JayThat QT button behavior won't do what you want. It does a lot different things but its not designed to move one frame forward or back. A behavior like this wil do the job. Depending on your QT movie, you may need to adjust the number of frames that are moved each time the button is used. This is the next frame behavior:
property QTSprite
property thisDuration
property thisMember
property customCursor
property thisSprite
on getPropertyDescriptionList
myPropList = [:]
myPropList.addProp(#QTSprite,[#comment:"enter the Quicktime sprite number:",#format:#integer,#default:""])
myPropList.addProp(#customCursor,[#comment:"pick a cursor:",#format:#cursor,#default:280])
return myPropList
end
on beginSprite me
thisSprite = me.spriteNum
thisMember = sprite(QTSprite).member
thisDuration = thisMember.duration
sprite(thisSprite).cursor = customCursor
end
on endSprite me
sprite(thisSprite).cursor = 0
end
on mouseUp me
if sprite(QTSprite).movieTime < thisDuration then
sprite(QTSprite).movieTime = sprite(QTSprite).movieTime + 1
end if
end
and this is the previous button behavior:
property QTSprite
property thisMember
property customCursor
property thisSprite
on getPropertyDescriptionList
myPropList = [:]
myPropList.addProp(#QTSprite,[#comment:"enter the Quicktime sprite number:",#format:#integer,#default:""])
myPropList.addProp(#customCursor,[#comment:"pick a cursor:",#format:#cursor,#default:280])
return myPropList
end
on beginSprite me
thisSprite = me.spriteNum
thisMember = sprite(QTSprite).member
sprite(thisSprite).cursor = customCursor
end
on endSprite me
sprite(thisSprite).cursor = 0
end
on mouseUp me
if sprite(QTSprite).movieTime > 1 then
sprite(QTSprite).movieTime = sprite(QTSprite).movieTime - 1
end if
end
Try these and see if they work for you.
Maybe you are looking for
-
How do i install my scanner without a disc
I purchased a new computer without a cd element. How do I install my scanner from my HP printer?
-
Key command for track level?
how can i increase/decrease the track level with a key? i found it for "last clicked parameter"... can't find a direct way for the track level. thanks.
-
Itunes can't run because some of its required files are missing.
I've been having this problem for 2 weeks now, Every time I tried opening Itunes it would say Itunes can't run because some of its required files are missing. Please reinstall Itunes. Well I've reinstalled it a number of its and it kept giving me the
-
I am trying to install a new printer that I bought last year (because it matches the 3 other printeres I have). I just recently tried to download the drivers from the disk that came with the printer. I realize that the drivers needed to be updated, s
-
Partners not defaulting in UB doc type STO
Hi Gurus, Can anybody please explain why the partners do not default in the partners tab of the PO with doc type UB when i enter the supplying plant. But the partners default in NB doc type when i enter the vendor. Why is this so? Thanks Anusha