Next/Back Action script help to stop and start

When I "removeEventListener" for img10, my last image going forward, Next no longer goes forward for 1-9 after going back. I've tried some conditional statements but I'm new to this and nothing is working. I also thought I could do what I did to stop the forward movement to the back movement, stopping at img1, but that didn't work. I'll leave the code that didn't work here with // before.
I'm also wondering if there's an easy way to have the transition of the photos dissolve from one to the next without setting up as parent-child. I've set it up with a UILoader.
Site is live (with these issues and others!) at : http://emilysperphoto.com/
next_btn.addEventListener(MouseEvent.CLICK, nextImage);
//variable is a container that holds some value...
var imageNumber:uint = 1;
function checkNumber():void
    //If the image number is = 10, then do something...
    if (imageNumber==10)
next_btn.removeEventListener(MouseEvent.CLICK, nextImage);
//else if (imageNumber<10)
//next_btn.addEventListener(MouseEvent.CLICK, nextImage);
function nextImage(evtObj:MouseEvent): void{
    //Add a number to the current value+1
    imageNumber++;
    largeImageLoader.source = "images/recent/rcnt0"+imageNumber+".jpg";
    checkNumber();
back_btn.addEventListener(MouseEvent.CLICK, backImage);
    //If the image number is = 1, then do something...
    //if (imageNumber==1)
    //back_btn.removeEventListener(MouseEvent.CLICK, backImage);
function backImage(evtObj:MouseEvent): void{
    //Subract 1 from the current value
    imageNumber--;
    largeImageLoader.source = "images/recent/rcnt0"+imageNumber+".jpg";
    //checkNumber();

Try this code (I did not check it functionality but the idea is there):
next_btn.addEventListener(MouseEvent.CLICK, nextImage);
//variable is a container that holds some value...
var imageNumber:uint = 1;
// parametarize number of images
var numImages:int = 10;
function addListeners():void {
     next_btn.addEventListener(MouseEvent.CLICK, nextImage);
     back_btn.addEventListener(MouseEvent.CLICK, nextImage);
function checkNumber():void
     // if imageNumber equals number of images
     // disable next click
     if (imageNumber == numImages) {
          next_btn.removeEventListener(MouseEvent.CLICK, nextImage);
     else if (imageNumber == 1) {
          // if number of images equals 1
          // disable previous button
          back_btn.removeEventListener(MouseEvent.CLICK, nextImage);         
     else {
          addListeners();
function nextImage(evtObj:MouseEvent):void
     imageNumber = evtObj.currentTarget == next_btn ? imageNumber + 1 : imageNumber - 1;
     // first check number
     checkNumber();
     // now load corresponding image
     largeImageLoader.source = "images/recent/rcnt0" + imageNumber + ".jpg";

Similar Messages

  • Scripts to notify stop and start of services

    dear all,
                 i m looking for a script to send me a mail whenever oracle apps service is shutdown and start.your help will be appreciated thanks in advance.
    os:rhel6
    ebs :12.1.3
    db:11.2.0.3

    The full order list can be found at :- http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_install/ch05s02.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Tools and Script for stopping and starting SAP instances in the landscape

    Hi All,
    All our SAP system are on Windows 2003 and very few on Windows 2000.
    Is there any possiblity for having a script which will stop and start SAP on all the instances in the Landscape from a central system?
    Lets say we have some 200 SAP instances and we need to down all the instances for Windows patching.
    In this case, we need to manually take remote desktop to stop and start all the instances one by one.
    Also, do we have any 3rd party automated tools for this purpose?
    Regards,
    Siva.

    Hi Siva,
    You can configure ACC for your system landscape.
    http://help.sap.com/saphelp_nwmobile71/helpdata/en/83/43cd574af1489aadd4d71b2f47b77d/content.htm
    Thanks
    Atul

  • The video action stop and starts momentarily at random

    hi-
    dell xps 8500 running windows 8.1. Purchased march 2013. 8 gb ram 1 tera bit hd. Amd radeon video card 1 gb ram, video card was tested by dell twice. Refreshed the whole computer, reinstall everything fresh. All drivers Bios updated. Playing a game: zuma revenge, the action stops and starts randomly. This is the reason why i went thru a complete refresh. Problem still exists. help please.
    Phil

    Hello,
    Potentially unsafe versions of the Java plugin are "Click to Play" blocked, meaning that you have to click to activate Java for each site. See the [[How to enable Java if it's been blocked]] article for more information.
    '''Note:''' To make sure that your Java plugin is working, you can visit the test pages listed in the article, [[Use the Java plugin to view interactive content on websites]]. If an "Activate Java" message box appears, click inside the box to activate the Java plugin.
    When you see the "Activate Java" message box, simply click it to load the Java content normally.
    <br><br>
    [[Image:Fx24-JavaActivate]]
    If there is no visible area to activate Java content in the page, click the red plugin icon in the address bar. In the message panel that opens, choose "Allow Now" to enable Java content temporarily.
    <br><br>
    [[Image:Fx24-JavaAllowNow]]
    <br><br>
    The next time you visit the site or any other that uses Java you will see this message again.
    If you want to always activate Java for a particular site, you can use the "Allow and Remember" option shown above.
    After activating Java, you may also see a "Security Warning" dialog box, asking you to confirm that you want to run Java. This warning comes from Java itself, not from Firefox.
    Does this solve your problem? Let us know.

  • Script to stop and start Business Object and its components

    Hi Guru
    I have installed Business Objects and few of its componenents.
    Please assist where I can find a proper script to do a clean stop and start of its services.
    My server is Windows 2008 SP2.
    Target services to have a scripts are;
    1. MySQL server 5.1.
    2. Apache Tomcat 5.5.20.
    3. BW Publisher Service 12.
    4. Server Intelegence Agent.
    Appreciate some assistance here. Thanks!
    -Ace-

    All of those components are available as Windows services. You can use the relevant
    net stop
    commands to stop them.
    Regards,
    Stratos

  • HT203177 I had to get a new hard drive in my 27 in IMac. I used time machine to get everything back on my computer. I just turn on time machine and its says it's preparing over 800,000 items to back-up, it never back-up, it stop and starts the process ove

    I had to get a new hard drive in my 27 in IMac. I used time machine to get everything back on my computer. I just turn on time machine and its says it's preparing over 800,000 items to back-up, it never back-up, it stop and starts the process over again.

    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then repair the backup/TM drive.

  • Script to Stop and Start Oracle Meter Data Management

    Hi,
    This is my first post in Oracle forums so if i open this in the wrong thread please forgive me.
    I tried to create a windows batch script to stop and start Oracle Meter Data Management but i can´t.
    @echo off
    D:\spl\MDMDEV\bin\splenviron.cmd -e MDMDEV
    D:\spl\MDMDEV\bin\spl.cmd stop
    D:\spl\MDMDEV\bin\splenviron.cmd -e MDMDEV
    D:\spl\MDMDEV\bin\spl.cmd stop
    The batch exits in the first command and i can´t understand why.
    Another thing is if i use spl.cmd stop command it doesn´t do nothing, is this normal?
    Thanks in advanced for all replies.
    Best Regards.
    Nuno

    I had to put a call command in mine. I think it is because you are trying to run a .cmd file within your bat file. You're actually changing shells. Thats why you need the call.
    call d:\spl\mdmdev\bin\splenviron.cmd -e mdmdev
    call d:\spl\mdmdev\bin\spl.cmd start
    I actually set mine up to use variables so all I had to change from script to script was the environment...
    <snip>
    SET SPLENV=MDMDEV
    SET INSTALLDRIVE=D:
    SET INSTALLDIR=SPL
    SET BINDIR=%INSTALLDRIVE%\%INSTALLDIR%\%SPLENV%\bin
    %INSTALLDRIVE%
    cd %BINDIR%
    REM Set envornment
    call %BINDIR%\splenviron.cmd -e %SPLENV%
    REM Wait a few seconds for environment to setup
    ping localhost -n 5 > nul
    REM Start SPL Web
    call %BINDIR%\spl.cmd start
    </snip>
    I was unable to find a way to get this to run as a service. Have you?
    I'm currently running these scripts in the startup/shutdown script section of the local machine policy (gpedit.msc).

  • While playing videos on itunes, audio and video will stop and start. It just started doing this recently and it does it with all my itunes videos..help!!

    While playing videos on itunes, the audio and video will stop and start several times during playback. This just started recently and it does it on all my videos. Help!!

    Try to download the application VLC.
    It is a media player that should be able to play any audio or video file you may have. If your videos play flawlessly using that application, then the issue is with iTunes and Quicktime, as they are both essentially similar software types when it comes to playing media.
    In that case you may need to install a plug-in file called Perian, in order for the videos to play correctly within iTunes or at least Quicktime...

  • HT2729 I bought a TV episode from iTunes (I have version 10 installed), but when I try to play it on my laptop, it keeps stopping and starting, with the voices out of sync with the action.  The action is stop/start as well.  What settings can I change to

    I bought a TV episode from iTunes (I have version 10 installed), but when I try to play it on my laptop, it keeps stopping and starting, with the voices out of sync with the action.  The action is stop/start as well., and occasionally it skips 5 or 10 seconds altogether, making it impossible to watch.  What settings can I change to fix the problem.

    Repair your QuickTime.
    Control Panel > Programs n Features > highlight QuickTime and click CHANGE then REPAIR.

  • How may I automatically stop and start Mail services at a set time please

    Hi folks. I was wondering if anyone could tell me how to automatically stop and start Mail services (or any other services) at a set time please in Leopard Server? Is there a script someone has created which might help?
    Cheers, David ( a realy newbie when it comes to administering OS X server)

    launchd works through a series of XML documents that define tasks to run, either at launch, on a time schedule, in response to network events, etc.
    So you'll need to create two .plists - one to start the mail server and one to stop it. They should be saved in /Library/LaunchDaemons. I'd suggest something like:
    /Library/LaunchDaemons/local.postfix.stop.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple
    .com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>local.postfix.stop</string>
      <key>ProgramArguments</key>
      <array>
        <string>/usr/sbin/serveradmin</string>
        <string>stop</string>
        <string>mail</string>
      </array>
      <key>StartCalendarInterval</key>
      <dict>
        <key>Hour</key>
        <integer>1</integer>
        <key>Minute</key>
        <integer>00</integer>
      </dict>
    </dict>
    </plist>
    and /Library/LaunchDaemons/local.postfix.start.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple
    .com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>local.postfix.start</string>
      <key>ProgramArguments</key>
      <array>
        <string>/usr/sbin/serveradmin</string>
        <string>start</string>
        <string>mail</string>
      </array>
      <key>StartCalendarInterval</key>
      <dict>
        <key>Hour</key>
        <integer>4</integer>
        <key>Minute</key>
        <integer>00</integer>
      </dict>
    </dict>
    </plist>
    You'll need to either use launchctl load /Library/LaunchDaemons/local.postfix.stop (or start) to load the tasks, or reboot your server.
    I'm curious, though, as to why you want to do this. Mail is typically one of the services that people want to run 24/7 so they don't miss out on any emails (even though SMTP can tolerate this). Why do you want to shut yours down?

  • DVD will not stop and start in a Menue Mode

    Hello I am using DVD Studio Pro 4 for a school project and i am looking for some help with this problem.
    The DVD i have created plays and stops when i am watching one of my video tracks, i just can not start the DVD when i am previewing in any menue after i stop it.
    I have created my DVD with 16 menus and 2 video tracks. It burns and plays back fine but i can not stop and start the DVD when i am in a menu mode. The DVD will stop and play when i stop the DVD playing video from one of my video tracks but when i am in menu i push stop on my DVD controller and the DVD will not start back up. The DVD will look like it wants to play but it will not play. I have to open the DVD player tray open in order for it to start the DVD again.
    The DVD is a NTSC, SD, single layered 2.9GB
    Any help would be much appreciated, Thanks.
    Mike
    PowerBook G4 15 1.25 ghz   Mac OS X (10.3.9)  

    If only five months old it is still under warranty. Take it back.

  • How to stop and start MDBs to listen for JMS messages

    Hello! This might be more of an architecture question rather than a technical questing, but I post it here, in the lack of a better place...
    For several years I have been using Webster and Webster MQ to send messages back and forth to clients. The architecture for the middleware platform has been designed around the functionality of ListenerPorts. Listenerports is a Webster functionality that let you "stop" and start to listen to JMS messages for a given MDB either by admin console, or by JMX.
    The arhitecture we used was something like this :
    1.Client sends a persistent message to a queue. (order)
    2. An MDB pics up the order message, calls a SessionBean that "fronts" the IIOP back end system.
    This is quite "out of the box" architecture, but we used the Listenerports to solve a stability problem for our back end system.
    The backEnd system was quite unstable, so the EJB threw an exception (typically because of timeout or connection refused) back to the MDB.
    The Listenerport was "defined" to handle 3 errors before stopping, so the MDB resent the message twice before the listenerport automatically stopped. The nice thing about this feature was that the client could continue to send orders, and was not bothered when the back end system was down.
    When the backEnd system was up and running, we could start the listenerport and it was all back to normal state. We even had a start script that checked the state of the listenerport every 30 minute, and started it automatically if it was stopped, making the admin task of starting the MDB unnecessary..
    Now.. Why am I telling this story..
    I would like to know how this could be done using "clean" J2EE technologies..That is..Not using any technology that is not portable..
    I`m playing with glassfish at home, and it struck me that there is nothing in the J2EE spec that defines the functionality described above ? Am i missing something ?
    I Do not want to stop My application because the back end system is down? That is the only way (i know of) that i can "stop" to listen for messages..
    I can put all the messages on an error queue when the backbend system is down, but that would lead to more code just to handle the error messages. Maybe the easiest way to solve this is to "move" (programmatically) all messages from the error queue over to the "standard" queue every XX minute, but somehow that sounds "wrong"
    Can anyone give me some advice to how this problem situation should be solved ? I`m interested in the solution both from an architectural perspective and from a more technical perspective..
    Best regards
    Hans-Jacob Melby

    Breakpoints, whether normal or conditional, are just meant for debugging of your code.  I had the sense from your question that the pausing you want to do is a part of normal operation of your code.  I would NOT recommend using a breakpoint for that situation.  It would bring up the block diagram showing the breakpoint when it occurs.  A user besides the programmer would not know what to do in that case.
     Yes, both the inner and outer loops would have shift registers.
    Putting a case structure with a small while loop inside the "Pausing Case" is doable.  It just depends on what you are doing or waiting for while the program operation is "paused".

  • Firefox4 on ubuntu, after awhile when I click on bookmarks and then move the cursor down to a bookmark, the list of bookmarks disappears. A stop and start of firefox4 fixes the problem but what is the long term fix?

    I upgraded to 4 and I noticed that after 4 has been up for an hour or so I click on the bookmarks. I see my list of bookmarks below but when I move the cursor down to select one, the list disappears.
    The only way I have found to fix this is to stop and start 4. I can then move the cursor down to select a bookmark. This problem has not occurred in previous versions.
    ps.. no '''''delicious''''' installed

    No, I see the three areas at the bottom of the Bookmark area that you refer to, but that also highlights an issue.  When I want to save a story to my Reading List and click on Share then "Add to Reading List" then go back to look at what is stored in the Reading List, my recently-saved item is not there.
    I looked thru the History tab and the Reading List tab and have been in the Bookmark tab.  But even when I Save a Bookmark, that newly-saved Bookmark does not show up in the Bookmark area.
    But then again, the next day (and actually just in the last half-hour) all of the functionality came back.  When I look at the Bookmarks, suddenly, again, all of the Bookmarks that are on my Safari browser on my iMac are now there, and I can now Save a Bookmark.
    It keeps coming in and out and that is what is driving me a little nuts.
    Thanks.

  • Stop and start at same point?

    I want to be able to stop and start at one point in a song.
    As it is, when I press "play" from, for example, bar 3, then I hit stop at bar 6. I want to start again at bar 3, NOT bar 6. But for some reason Logic continues - like "scrolling" in ProTools.
    I do not want to use my mouse to click back bar 3.
    How do I stop / start at the same measure ?

    glankrudolph wrote:
    Here is what I need:
    Say I'm starting at measure 20. I place the playhead at measure 20. I press play and it plays for a few measures. I press stop, maybe at measure 24. Now, when I press play again, I want it to start at measure 20, like in ProTools.
    hi glank .. you need to get into the use of Markers. This will easily solve your issue:
    1 - Look up the Key Command for Create Marker at Playhead ( ie without Rounding)
    2 - Look up KC for "Go to Next Marker" & "Go to Previous Marker".
    3 - Place Playhead at measure 20. Press KC for "Create Marker without Rounding"
    4 - Play for a few measures and stop whenever you want to.
    5 - Now press the KC for "Go to previous marker" - with one stroke you are back at measure 20
    6 - Press Play
    If this is not quick and easy enough for you, I will eat my hat
    best
    m s

  • The sequence to stop and start xMII?

    Hi, good afternoon:
    Could anybody provide the sequence to stop and start xMII?
    Is it different from xMii11.* to xMii12.*?
    Thanks!

    Yes, the steps are same as what I suggested before.
    You can find plenty of material on SDN like blogs, articles, best practices and so on...
    The best place would be to start with is [MII WIKI|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=15601]
    Below are few other very useful links,
    [Blogs|Weblogs related to SAP xMII; ( you can also find many blogs under category Manufacturing, xapps, mii etc.. on SDN)
    [Best Practices Guide|MII 12.X Best Practice Guide is now available;
    And also can find loads of threads on MII 12.x, 11.x installations/configurations/troubleshooting simply use large search date range.
    Hope this helps!!
    Regards,
    Adarsh

Maybe you are looking for

  • My iMac Not Working With My HP Laserjet 1020 Printer

    Hello Everyone, Ok here is the problem my HP LaserJet 1020 has been working fine up until i upgraded to Snow Leopard i am currently running (10.6.2) and i have had heaps of issues with Snow Leopard i just don't know whats wrong with it i thought it w

  • ABAP program in BW

    I want to know whether this is possible at all: I need to write an ABAP program for a screen which has a transaction code. The user is given access to the tcode. In this screen the user is allowed to enter 1. file path (location of flat file in App.

  • Connect additional monitor as extended desktop

    Hi to all, it is possible attach another old PC flat VGA monitor to my iMac as extended desktop? I don't need mirroring. Thanks

  • AR Invoice + Payment won't allow negative

    When using AR Invoice + Payment the screen calls Payment Means (moneybag) when you save the Invoice. The Payment Means window is only configured for Incoming Payments, and rejects a negative (ie Outgoing) value. Some user companies have POS software

  • Setting alv layout  as defualt for all usres

    Hi, Is it possible to set the webdynpro alv layout set as default for all users. I need your input if this is possible in WD ABAP ALV setting. Thanks in advance ! Alok