Adding Pause and Replay Buttons

Ok here is my script for an external XML loading Flash
Gallery...
1. How do I add a "constant" Pause and Replay on this?
2. Every time I add something to the stage the "fade effect"
affects that too!
Thanks in advance.
delay = 5000;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image
= xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
description
= xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
id = setInterval(preloadPic, 100);
} else {
content = "file not loaded!";
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
var loadTot = 0;
var k = 0;
function preloadPic() {
clearInterval(id);
var con = picture.duplicateMovieClip("con"+k, 9984+k);
con.loadMovie(image[k]);
var temp = _root.createEmptyMovieClip("temp"+k, 99+k);
temp.onEnterFrame = function() {
var total = con.getBytesTotal();
var loaded = con.getBytesLoaded();
percent = Math.round((loaded/total*100)/image.length);
preloader.preload_bar._xscale = loadTot+percent;
info.text = "Loading picture "+k+" of "+image.length+"
total";
if (loaded == total && total>4) {
con._visible = 0;
nextPic();
loadTot += percent;
delete this.onEnterFrame;
function nextPic() {
if (k<image.length-1) {
k++;
preloadPic();
else {
firstImage();
preloader._visible = 0;
info.text = "";
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
next_btn.onRelease = function() {
nextImage();
var p = 0;
var current;
MovieClip.prototype.fadeIn = function() {
if (this._alpha<100) {
current._alpha -= 5;
this._alpha += 5;
} else {
current._visible = 0;
delete this.onEnterFrame;
function nextImage() {
if(p<(total-1)){
current = this["con"+p];
p++;
var picture = this["con"+p];
picture._visible = 1;
picture._alpha = 0;
picture.onEnterFrame = fadeIn;
desc_txt.text = description[p];
picture_num();
slideshow();
if (isPaused == true) {
current = this["con"+p];
p<total-1 ? p++ : p=0;
preloadPic();
function prevImage() {
if (p>0){
current = this["con"+p];
p--;
var picture = this["con"+p];
picture._visible = 1;
picture._alpha = 0;
picture.onEnterFrame = fadeIn;
desc_txt.text = description[p];
picture_num();
function firstImage() {
con0._visible = 1;
con0._alpha = 0;
con0.onEnterFrame = fadeIn;
desc_txt.text = description[0];
picture_num();
slideshow();
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
//Resetting...fadeout=300 milliseconds.
endFadeOut = setInterval(fadeOut, 300);
//Try using a movie clip called restart_mc that is a button
_root.attachMovie("restart_mc");
} else {
nextImage();
Here is the Source Files:
Download the
Sources

anyone?

Similar Messages

  • Adding Pause and Play Buttons to an embedded SWF

    I'm having trouble with a navigation skin of a SWF file I'm
    embedding in one of my Dreamweaver sites. The SWF shows fine when
    embedded without the skin but draws a blank when embedded with it,
    even though they are published simultaneously from the same file.
    I would like to ADD a Stop or Pause button from Dreamweaver
    to the SWF to control the animation.

    anyone?

  • How can I make easier case structure? Or can it possible to have one Pause and reset button in same structure.??

    hello,
    I am tring to convert my main test vi in case structure so latter on i can make some changes in that for example i want creat one pause button and reset button in that.
    I am not so much familer with case structure i want your guidence that how can i make my vi in globle case stucture in that i m having case 1 ,case 2...
    i already tried for that but then i got confused.
    here i am attaching my .llb file in that aa.vi is my main testing vi.
    will you plese guide me so i can make confort vi in case structure.
    Or can it possible to have one pause button and one reset button in same stucture,so User can pause or reset execution at any time when they want.
    Thank you very much in advance.
    Attachments:
    aa.llb ‏3338 KB

    Hello,
    I have change my entire structure ,now is it possible to have pause and reset button.
    here i have attached my changed vi.
    if still any changes required then please suggest me.
    Thank you.
    Attachments:
    aa.vi ‏75 KB
    aa1.llb ‏3333 KB

  • HT1689 On the new version of  iTunes the shuffle button and replay buttons appear to have disappeared on the genius tab and am always having to listen to shuffled songs now :( how can I stop this?

    On the new version of  iTunes the shuffle button and replay buttons appear to have disappeared on the genius tab and am always having to listen to shuffled songs now :( how can I stop this?

    It appears from many other posts that the " Keep This iPod in the Source List" function isn't included in iTunes 7 unfortunately. You can leave your feedback on it's absence at this link: Apple Product Feedback
    You can check out a workaround at this link which may help out for now: Create ready-to-sync playlists for Shuffles in iTunes 7

  • Previous, play/pause, and next buttons don't work now?!

    Hey everyone so i recently downloaded and installed itunes 9.2.1 I don't have any problems with it now but i've noticed that on my mac the previous, play/pause, and next buttons on the top row of keys don't work now has that happened with anyone else? now when i look under controls on itunes it says to pause its the space key and previous and next are command then left or right arrow but those only work when you have itunes open in front of you. Its not a huge deal but i was so used to just flipping through music and pausing and started when i wanted its just annoying!!! lol is there anyway to get them to work again?

    I was having this problem as well. They were working with everything else, including my Google Chrome media keys extension (Sway.fm Unified Music Media Keys in my case). If you're running a browser extension that allows you to use your media keys on your browser, disable it. In my case it seems the extension was somehow blocking iTunes from being able to use the media keys. Once I disabled it, the keys worked perfectly with iTunes. I imagine this is probably a problem with the latest iTunes update not wanting to share use of the media keys rather than a problem with the browser extensions, since my browser extension hasn't updated since I first downloaded it.

  • How to make "start" and "replay" buttons.

    I've just started learning Flash, and at university we're being taught Action Script 2.0.
    However, I've just done my entire animation in 3.0 without realising it.
    Now, I need to make a button on the first frame saying "play animation", and another at the end saying "replay animation".
    I can't figure out how to do this in 3.0. The version I learnt in 2.0 doesn't work, and every internet tutorial I've looked at includes at least 20 lines of something that (to me, as a beginner) looks like indecipherable gibberish.
    In 2.0, I was taught to use: on(release) {gotoAndPlay('animstart')};
    ...or similar.
    What can I use in 3.0? Does it really have to be 20 lines long? I just want to make it go to the next frame, that's all - I've already done the graphics.
    I'd appreciate your help so much - I have to present my animation in just two days' time!

    What other code have you used in the file that prohibits you from making this an AS2 file?

  • Adding update and delete buttons to a  Report from SQL Query

    There is an option when creating a QBE to add update and delete
    links which i find quite useful, but this option doesn't seem to
    be possible on a Report from SQL Query. Do i need to do
    something special to add them? is the option located in a
    different place?

    Hi,
    You can only add Update ,Delete in QBE Reports,
    there is no option in Portal which can be used to
    have these buttons in the Reports from Query Wizard or
    Report from SQL Query.
    Thanks
    Vineet

  • I wanted to update my ipod since the new version was out so i did so and then it suddenly stopped updating and when i clicked the play/pause and restart button, a blue screen appeared. what should i do?

    my ipod wont work at all..... the screen is blue!

    Try:
    - iOS: Not responding or does not turn on
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Pause and Play Toggling Button

    I have created a Pause and Play button that toggles between states.  It controls a Timeline with synced Sound.  When I use it the sound and animation go out of sync.  Can anyone help me with this or perhaps have better code I could swap out to make this work?
    Below is what I am currently using:
    On the first frame of an Action Script layer put this AS:
    playBtn.onRelease = function() {
    ns.pause(false);
    playBtn._visible = false;
    pauseBtn._visible = true;
    pauseBtn.onRelease = function() {
    ns.pause(true);
    playBtn._visible = true;
    pauseBtn._visible = false;
    Lable a Pause button Graphic "pauseBtn"
    put this AS on the button:
    on (release) {
                gotoAndPlay(_currentframe+1);
    Lable a Play button Graphic "playBtn"
    put this AS on the button:
    on (release) {
                stop();
    Put the Pause and Play buttons directly over each other on 2 layers for the duration of the timeline.
    Pause Button on top. (unless you have a STOP on the first line then maybe the Play button will start it (I didn't Try this)

    you have, what appears to be, conflicting code.  and you appear to be using a netstream instance.  so:
    1.  remove all code attached to objects.  copy and paste the only code you have affecting your pause/play button.
    2.  what is ns?

  • Pause and Stop implementation in streaming audio

    Hi,
    I am building a program that transmits audio over a TCP connection(using ServerSocket and Socket classes). My problem is that I am not being able to correctly implement the 'Pause' and 'Stop' option. Let's go into more details:
    When the "Play" button is clicked, following line is invoked:
       Play(){
         dataOut.write(fileToPlay.getBytes());
         // write the name of file requested to dataOut, and dataOut is the TCP socket's OutputStream
         //initilized as dataOut = dataSocket.getOutputStream
         controlOut.write( PLAY_REQUESTED_FILE);
         //an int argument, server interprets this and reads the dataOut
         //and sends the audio bytes after encoding
         Player P = new Palyer (dataIn, controlIn);
         PlayerThread pt = new Thread(p);
         pt.start();
    }                    the Player class's run method is:
    public void run() {
            stopReq = false;
         //here the line object is opened and started.
         int nBytesRead = 0;
         new Thread(stat).start(); //this thread gives continuos statistics of bandwidth used
         while (nBytesRead != -1) {
               nBytesRead = dataIn.read(buf);
               //some decoding of buf goes on here
                line.write(decoded, 0, decoded.length);
    }          The server works in a very similar fashion:
         when the PLAY_REQUESTED_FILE command is recieved, if invokes this play method:
              File f = getFileName(dataIn); // this gets the file name from input stream of the sockt
         Streamer s = new Streamer(f, dataOut);
         StreamerThread st = new Thread(s);
         st.start();
              the Streamer class's run method is:
              while (fis.available() != 0 ) {
              fis.read(dataBuffer);
              //fis is the stream to read the File object passed to constructor
              //some compression happens here and then,
              dataOut.write(dataBuffer);
              please help me implement the stop and pause options(the client GUI has the pause and stop buttons in place).
         as always, help is greatly appreciated,
         thanks in advance
         Ishwar

    thank you for your reply captfoss, i see that you're always the first one to reply, i am really grateful for that.
    yes, i have already written code for issuing the stop and pause command, but i don't know how exactly one should implement them. i mean, i sure there'll have to to be some sort of lock object on which notify( ) and wait( ) methods will have to called, but i am not being able to do that. . something similar (but not same) thing has been discussed here http://www.javalobby.org/java/forums/t18465.html at the end of the page, please help as i have tried everything i can and still it adamantly refuses to work..

  • Stop and play buttons...

    How would I go about adding stop and play buttons to a slideshow?
    stop1.addEventListener(MouseEvent.CLICK, stop1);
    play1.addEventListener(MouseEvent.CLICK, play1);
    function stop1(event:MouseEvent){
    if(this.currentFrame == 1)
    { gotoAndStop(this.totalFrames);
    function play1(event:MouseEvent){
    if(this.currentFrame == 1)
    { gotoAndStop(this.totalFrames);

    well idk if the code is even right i need help?  The way the slide show is working is i have it on the timeline....  With this code it doesnt play automatically and when i push play it goes through them in like 2 seconds and you can't see anything?
    stop1.addEventListener(MouseEvent.CLICK, stopSlide);
    play1.addEventListener(MouseEvent.CLICK, playSlide);
    function stopSlide(event:MouseEvent):void {
    stop();
    function playSlide(event:MouseEvent):void {
    play();

  • Back button & Replay button for Flash movie on website

    Three questions all related:
    1. I need to add a "Back"  and a "Replay" button to a Flash movie that plays full screen when the link is clicked on a website. I have created the two buttons and placed them on the stage. I've given them the names back_btn and play_btn. I've tried several scripts from postings on the Forum for the replay button but all of them come up with errors such as, "1119: Access of possibly undefined property onRelease through a reference with static type flash.display:SimpleButton" when I use this script:
    stop();
    play_btn.onRelease = function()
    play();
    I also tried this script:
    stop();
    play_btn.addEventListener(MouseEvent.CLICK, playMovie);
    function playMovie(event)
    play();
    It didn't report any errors, but it didn't work.
    2. I saw a posting that said one needs to name the movie clip and reference it in the script. Would this be the file name of the movie after it is exported? I am unclear on this.
    3. For the "Back" button, would I include the whole url to get the viewers back to the previous page or is there a shortcut way to get them back there?
    If you can help, please provide detailed script as I do not know Action script.
    Thank you,
    Marilyn

    Hi, Ned:
    I have a presentation completed that is already up  on a website and now I need the "Back" button and "Replay" button, so whether I'm ready or not, I have to find a solution. I know I'm missing some important step. I have Lynda.com and I can usually figure out what's wrong with the lessons on there, but this one has me stumped.
    I did try the code change you sent and I was unable to get the movie to replay. I'm attaching two screen shots so you'll see that I did have the button instance named properly and the Action Script correctly written. You can "Ctrl" "Scroll" to enlarge the images on your screen.
    Marilyn

  • At you tube display video window but did not appear play, pause and sound bottons

    at you tube display video window but did not appear play, pause and sound buttons, last night i watch the video at you tube perfectly.

    It looks like a driver related issue specifically the video card driver. I suggest that you scan your computer with RadarSync so that you will know which drivers need some updating. Once you some results, you can either Google the updates or go to the HP's support website to get the latest updates or you can use RadarSync to update automatically. I hope this helps! David

  • Remove Video Controls and add Replay button on page

    Hello,
    I am trying to create a page in Adobe Edge that loads a video without any controls (play, slider bar, volume, full screen) and then displays a replay button after the video finishes which will start it from the beginning.
    Currently I am able to load the video file and have it play to the end and stop, but I can't seem to get a replay button working.  I also can't find a way to disable controls on the video so they do not show.
    Here is the code I am using to load the video:
    // insert code to be run when the composition is fully loaded here
    $("#Stage").css("margin","auto")
    sym.stop();
    // original video play code starts here
    // create a text object called vid;
    var vid = $("<video width='980' height='300' controls='none'>" +
       "<source src='video.mp4' type='video/mp4' />" +
       "<source src='video.webm' type='video/webm' />" +
       "<source src='video.ogv' type='video/ogg' />" +
       "This browser is not compatible with HTML 5" +
    "</video>"
    sym.$("replay_btn").stop().animate({"size":"absolute", "top":"-265", "left":"7", "opacity":"1"}, 0);
    // stage symbol lookup, and append the above vid object to it;
    // in other words, get the div called 'vcontainer' and attach the video control to it;
    sym.$("vContainer").append(vid);
    // additional options for the video object
    vid.attr('autoplay', 'autoplay');
    vid.attr('preload','auto');
    vid.attr('controls', 'none');
    // End original code
    // this is the insert for the action after the video ends
    $(vid).bind("ended", function () {
    sym.$("vContainer").stop().animate({"size":"absolute", "left":"0", "opacity":"0"}, 0);
    sym.$("replay_btn").stop().animate({"size":"absolute", "top":"394", "left":"19", "opacity":"1"}, 0);
    $("#Stage").on('click','#replay_btn',function(){
    vid.pause();
    vid.currentTime = '0';
    vid.play();
    sym.$("vContainer").stop().animate({"size":"absolute", "top":"133", "left":"0", "opacity":"1"}, 0);
    vid.removeAttribute("controls");
    As you can see, I tried a few ways of disabling the controls, and I also tried adding the replay function to the button itself, but neither of those worked.  Any advice or information on controlling the video control display and replay function in Adobe Edge would be very helpful.
    Thanks!

    In case anyone is interested in the replay button, I was able to find code that worked:
    var myVideo = document.getElementById("activeVideo");
    myVideo.currentTime = 0;
    myVideo.play();
    This is executed when the replay button is clicked.  Just be sure to set the video in question's ID to "activeVideo".
    I am still unable to turn off the controls on the video.  It seems like some of the code I have tried should work, but I haven't had success yet.
    I've tried all of the following:
    var vid = $("<video width='980' height='300' controls='none'>"
    var vid = $("<video width='980' height='300' controls='0'>"
    var vid = $("<video width='980' height='300' controls=''>"
    vid.attr('controls', 'none');
    vid.attr('controls', '0');
    vid.attr('controls', '');
    But nothing has worked so far.  Any help would be much appreciated.
    Thanks!

  • In adobe reader app on iPad, I have a PDF document that added notes and comments to.  Once I left the document and returned to it, the notes and comments were gone.  Where are they?  I clicked "save" and "done" buttons after I entered text.

    In adobe reader app on iPad, I have a PDF document that added notes and comments to.  Once I left the document and returned to it, the notes and comments were gone.  Where are they?  I clicked "save" and "done" buttons after I entered text.

    The application auto-saves your input when you close the document.  If you left the document, as you state, the notes/comments should have been saved and should have been visible the next time you opened the document with the Mobile Reader (note that if you are opening the document with another app such as Apple's built in PDF Viewer, things like notes/comments may not be visible).  Also note that if you are doing an Open In... from another app (like Dropbox), the version of the document in Dropbox does not update; only the version of the document in the Mobile Reader is updated.
    Would it be possible to send a video of the problem you are encountering to [email protected] so that we can try to help?

Maybe you are looking for