Adding in more than one toggle button

Hi,
I am having problems when adding multiple toggles. I am unable to work out what its actually doing as occasionly when i click on toggle 2, its firing toggle 1 and the sometimes its doing it the other way around -clicking on toggle 1 will fire toggle 2.
Any help is much appreicated.
My code below:
//Adding flows to stage
var flow0:MovieClip = new mov_flow_0();
this.addChild(flow0);
flow0.y = 235.80;
flow0.x = 142.50;
var flow1:MovieClip = new mov_flow_1();
this.addChild(flow1);
flow1.y = 287;
flow1.x = 314.60;
//Stop Flows
stopFlow();
//Setting up buttons
var totalButtons:int = 2;
var buttonArray:Array = new Array();
setUp();
function setUp()
for (var i:int = 0; i<totalButtons; i++)
  var mc = root["toggleBtn_" + i];
  buttonArray[i] = mc;
  mc.buttonMode = true;
  mc.addEventListener(MouseEvent.CLICK, btnClicked);
  mc.btn.x = OFF_POSITION;
function btnClicked(e:MouseEvent):void
  var id = e.target;
var index:int = getIndex(id,buttonArray);
onState = !onState;
var mc = root["toggleBtn_" +index];
var flowToUse = root["flow" + index];
trace ("mc: " + mc.name);
trace ("flowToUse: " + flowToUse);
if(onState)
  //mc.btn.x = ON_POSITION;
  TweenMax.to(mc.btn, 0.5, {x:ON_POSITION});
  flowToUse.flow.startFlow();
else
  //mc.btn.x = OFF_POSITION;
  TweenMax.to(mc.btn, 0.5, {x:OFF_POSITION});
  flowToUse.flow.stopFlow();
// function to search an array to find a given entry
function getIndex(id_to_find:Object,array_to_search:Array)
for (var i:int = 0; i<array_to_search.length;i++)
  if (id_to_find == array_to_search[i])
   return i;
   break;
function stopFlow()
flow0.flow.stopFlow();
flow1.flow.stopFlow();

Try this:
import flash.display.MovieClip;
import flash.events.MouseEvent;
//Adding flows to stage
var flow0:MovieClip = new mov_flow_0();
this.addChild(flow0);
flow0.y = 235.80;
flow0.x = 142.50;
var flow1:MovieClip = new mov_flow_1();
this.addChild(flow1);
flow1.y = 287;
flow1.x = 314.60;
//Stop Flows
stopFlow();
//Setting up buttons
var totalButtons:int = 2;
setUp();
function setUp():void
          for (var i:int = 0; i < totalButtons; i++)
                    var mc:MovieClip = root["toggleBtn_" + i];
                    mc.buttonMode = true;
                    mc.addEventListener(MouseEvent.CLICK, btnClicked);
                    mc.btn.x = OFF_POSITION;
                    mc.onState = false;
function btnClicked(e:MouseEvent):void
          var mc:MovieClip = MovieClip(e.currentTarget);
          var flowToUse:MovieClip = MovieClip(root["flow" + String(mc.name).match(/\d+/)[0]]);
          if (mc.onState)
                    TweenMax.to(mc.btn, 0.5, {x: ON_POSITION});
                    flowToUse.flow.startFlow();
          else
                    TweenMax.to(mc.btn, 0.5, {x: OFF_POSITION});
                    flowToUse.flow.stopFlow();
          mc.onState != mc.onState;
function stopFlow():void
          flow0.flow.stopFlow();
          flow1.flow.stopFlow();

Similar Messages

  • How can I add more than one submit button in a jsp without use of javascrip

    I want to add more than one submit button in a jsp without use of javascript

    you can do add multiple submit button with this way
    <input type="submit" value="Previous" />
    <input type="submit" value="Next" />
    <input type="submit" value="Finish" />

  • Short dump ( PNP LDB )More than one radio button is active

    Hello Guys!!!
          I am working on HR report and I’m using <b>PNP LDB</b> . on output when I select “Current month” and select “personal area” single values and hit  execute button . Its giving me short dump “<b>More than one radio button is active </b> “. Why is that any body can help me ?
    Cheers
    Usman

    Also check on AT SELECTION-SCREEN OUTPUT. You`re not selecting any of them too...
    Checkout this code ..
    I declare PNP in attributes and AT SELECTION-SCREEN OUTPUT.
      PNPTIMR5 = ' '.
      PNPTIMR3 = 'X'. ( Just comment it or give error message )
    its giving short dump ,if I try to do the same thing you describe in your post !
    Hope this’ll help you
    Thanks
    Saquib

  • Can you have more than one submit button on a form?

    I'd like to divide a form so that there are two sections, each with their own submit buttons.  Is it possible to have more than one and if so, how do you "create" a button?

    Hi,
    You could try Redirect URL under Options tab. The way is you create two forms instead of two sections. Let's say form A and form B, then set form A's Redirect URL to form B.
    After submit form A, it will jump to form B after seconds, which you can also set in Redirect URL option.
    Let me know if this can help you.
    Thanks,
    Pengpeng

  • Adding Artwork (More Than One Song At A Time)

    I'm adding artwork to the songs that iTunes couldn't find automatically. Is there a way to add the artwork to more than one song at a time? It would be way easier if I could just add the artwork to an album all at once. I tried listing the songs in "Album List" order and dragging the .jpg into the blank artwork icon, but it didn't take.
    Please tell me that there's a way to do this; it's a hassle having to add artwork one song at a time!
    Thanks,
    -Adam

    At the Artwork box at lower left, click the text above the box so it shows "Selected Item".
    Select all the songs for one album then drag the artwork to the artwork window or Copy/Paste it into the Artwork box.

  • Does I photo duplicate images when added to more than one album?

    I am trying to eliminate duplicates in IPhoto.  Is each image duplicated if addes to more than one album?

    There are no duplicates in iPhoto unless you import multiple copies of a photo
    Albums do not exist with photos in them. Pacing a photo in an album simply makes an entry in the iPhoto database and takes no space
    LN

  • One menu with more than one overlay buttons. Is that posible?

    Hello, (I posted this yesterday but as a part of a created and solved question that is the reason I decided to create my own's)
    I have a menu and I want to link it to a two different tracks so I use two buttons. The problems is that I only can link one overlay button to the menu so what can I do with the second button if I want it to work exactly as the first button -the one that is overlayed to the menu-?
    Thank you and I expect that I have been clear enough

    Yes you should put all of your buttons onto a single overlay file. See this tutorial on how to do that;
    http://www.kenstone.net/fcphomepage/alex_all_menusdir/chapter1.html
    Please skip over the part on Layered Menus and go directly to the part on Simple Highlights.

  • URGENT! Help with creating more than one linked button

    Hi!
    Could someone help a newbie with trying to figure out this.
    I work in Flash CS3, AS3.
    I've created a button that links to another webpage by using this code (the code is added to a separate layer):
    import flash.events.MouseEvent;
    steud.addEventListener(MouseEvent.CLICK, onMouseClick);
    function onMouseClick(e:MouseEvent):void
      var request:URLRequest = new URLRequest("http://www.xx.html");
      navigateToURL(request, "_blank");
    It works just fine, but the problem is that I want to add more buttons (and links) to it, and thats where I get stuck. When I try just adding a new layer and adding the code there, everything stops working. I've also tried copy/pasting the code beneath the first one, with no results.
    Does anyone know?
    /J

    I will try
    I've modified this tutorial http://www.tutcity.com/view/create-a-sliding-content-with-back-and-forward-navigation.2394 7.html and the intent is to make a sliding menue that contains images of plants that link to the url of the plant. I've got buttons (with a mouse over effect that shows the name of the plant), and in AS2 I could use GetURL to link an invisible button to the URL, but to create the sliding effect, I had to use AS3. I've understood that GetURL doesn't work in AS3.
    In scene 1 I have three layers; content, arrows and actions.
    The actionscript looks like this:
    // File downloaded from www.riacodes.com
    import com.greensock.*;
    var arrayX :Array = [0,-800,-1600,-2400,-3200,-4000,-4800];
    var currentIndex : Number = 0;
    left_mc.addEventListener(MouseEvent.CLICK,navigate);
    right_mc.addEventListener(MouseEvent.CLICK,navigate);
    left_mc.buttonMode = true;
    right_mc.buttonMode = true;
    checkArrows();
    function navigate(e:MouseEvent):void{
    if(e.currentTarget == left_mc) currentIndex --;
    else currentIndex ++;
    checkArrows();
    TweenLite.to(content_mc,.5 ,{x:arrayX[currentIndex]});
    function checkArrows():void{
    if(currentIndex == 0) left_mc.visible = false;
    else if (currentIndex == arrayX.length - 1) right_mc.visible = false;
    else{
    left_mc.visible = true;
    right_mc.visible= true;
    On the content layer I have the backgroundimages that slides as a movieclip.
    If I doubleclick on the movieclip I have two layers, one with the bakground images and the invisible buttons, and one layer where I've put the script:
    import flash.events.MouseEvent;
    JC.addEventListener(MouseEvent.CLICK, onMouseClick);
    function onMouseClick(e:MouseEvent):void
      var request:URLRequest = new URLRequest("http://www.blomsterbolaget.se/vaxtsidor/Dracaena_fragrans_JC.html");
      navigateToURL(request, "_blank");
    JC is the instance name of one of my buttons. So far everything works, but I want to add linking to another button, and I'm not sure how to do this correctly. When I've created the invisible buttons, I've drawn a square, converted it to a button, named it, and named the instance name. Changed the Alpha to 0. I've also added an On mouse over effect, but I don't think that has anything to do with this.
    Hope you can help med!
    /J

  • How do I create more than one navigation button in Adobe Fireworks CS6?

    Hi guys, 
    Apologies if this comes across as very stupid question. I am a complete beginner with Adobe Fireworks and I'm in the process of creating my first website and I have got to the stage where I want to create navigation buttons and the book I have recommends using Adobe Fireworks so I have downloaded. My problem I have encountered is after I have created my first two state button what is the next step to create another two state button which has the identical size and colour of the previous two state button?
    Here is a brief rundown of the steps I have done to do the first two state button:
    1) Edit-Insert-New Button
    2) Chose the rectangle and then specified the width and height of the button and chose my stroke and fill colour
    3) Centred the button and used the text tool to put the button as a 'Home' button for my website. I then went on Window and Align in order to centre the text on the button
    4) I went on Select-Select All and then went on Windows-States to open the states panel. I right clicked on state 1 which is Up and clicked on copy to states. I then selected the next state radio button and clicked OK.
    5) I selected State 2 and slightly modified it by changing the colour of the text.
    6) I then clicked the back button to return to the main window.
    After this what step should I take to create my another button which has the same size, colour and text style as I have created for the first button? I tried just repeating these steps again but when I do step 1 it creates a new fireworks document which means I have to create the buttons size, colour, text style from scratch.
    Your help would be greatly appreciated guys and once again I do apologise if this comes across as a silly question.
    PS Please could you let me know if the steps I have taken to create the 1st two state button are correct

    Initially you need to configure via the provider's own web based control panel multiple e-mail accounts. If they don't have one, work it out with their customer support to have three distinct mail accounts. Then you can setup multiple logins by adding new accounts to mail. Since mail checks all accounts per Mac OS X user account simultaneously, it probably is best to use different usernames on the same internet provider. If you don't want mail to show all the information from all three mail accounts simultaneously, configure Apple menu -> System Preferences -> Accounts to have multiple users on your computer, and configure each of the internet service provider accounts for each separaet user on Mac OS X.
    Message was edited by: a brody

  • How to handle more than one submit buttons on servlets

    Hi:
    anyone know how to handle the multiplet submit button on servlet,
    such as next, previous, add and so on.
    Thank you

    Don't worry about because only the button that is clicked will get submitted. In the servlet you just test for the existance of a parameter:
    if (request.getParamter("SubmitButton1") != null) { ..... }
    if (request.getParamter("SubmitButton2") != null) { ..... }
    Save the following HTML code, open in IE and click on the buttons to see what will get sent to the servlet:
    <html><head></head><body>
    <form method="GET">
       <input type=text name=text1>
       <input type=submit name="Submit1" value="Me">
       <input type=submit name="Submit2" value="you">
    </form>
    </body></html>

  • ITunes 8.1 Can't Seem to do More Than One Thing at a Time

    I upgraded to 8.1 and now, rather than a "faster" iTunes experience as was advertised on Apple's website, iTunes can't seem to do more than one thing at a time without locking up the application completely. For instance, when trying to download podcasts if I choose to hit more than one "Get" button at a time iTunes will freeze up until the first podcast has completely downloaded. During this time I cannot access any other screen in iTunes at all.
    This freezing of iTunes also occurred while I was trying to sync my iPhone 3G. I received the Calendar sync error that a few other people have mentioned on the forum and wanted to turn off Calendar sync (since I don't use it and don't understand why iTunes turned it on by default, apparently, after the upgrade) but I had to wait for my iPhone 3G to completely sync before I could gain access to any of the tabs in the iPhone sync window.
    So, basically it seems like the new version of iTunes (8.1) really doesn't like to be bothered while it is trying to copy data from one place to another.
    Any ideas?

    I'm using Vista Ultimate 64-bit and iTunes 8.1 installed OK, but required a restart of the entire OS after upgrading. It takes forever to launch, clicking on certain items (like applications) causes itunes to freeze for about 15-30 seconds before it continues (this is actually something that's been there since the introduction of the app store), I've had to switch my library view to LIST and avoid any sort of album art. Using album art to view my library causes iTunes to be extremely, obnoxiously unresponsive.
    The best part - plugging in my iPhone to sync it... iTunes simply sits there dumbly - doesn't even recognize that I've plugged my iPhone in. So now I can't even sync. QUALITY product, quality. So the app I'm FORCED to use to manage my phone doesn't even work after upgrading. Outstanding.
    I'm terrified of uninstalling and reinstalling... the last time I did that with iTunes it jacked my library up... it "lost" all of my music... basically it disassociated all of the music (even the stuff purchased through the itunes store) with the index file so I had to re-import EVERY song and delete the duplicate entry.
    I searched a ton of forums looking for any clues as to how I could improve performance... All I run into is apple fan boys flaming any and all forums to the point of PC *****, no Apple *****, and so forth. Extremely unhelpful.
    The fact is this - if I wasn't forced to use iTunes to manage my non-jailbroken iPhone 3G, then I'd dump it completely. It is a horrible app. Why punish the customers that haven't gone the route of "jail breaking" their iPhones?
    One individual on one of the forums suggested that blue screens, and all the other random errors, including slow performance were due to a lack of RAM. I have 4GB of RAM on my machine I can run a virtual Fedora core 9 machine and a virtual WinXP machine on my Vista x64 box and still not have any performance issues with those two virtuals in the background sucking up system resources, yet with nothing open and less than 50% of my 4GB of RAM in use iTunes performance is abysmal. I have not run into any other application on my Vista machine that performs as badly as iTunes.
    And Apple is touting a "64-bit" version of iTunes - it isn't. The applications the 64-bit installer installs are all 32-bit.
    So, I'm searching as the two of you are for an answer to horrible performance of iTunes.
    Even exiting out of iTunes takes a day and a half... "saving itunes library".... And my "library" isn't that big.

  • Select more than one photo for an mms upload

    I am trying to send more than one photo (by mms) to [email protected]  It will only let me select one at a time to upload.  I know how to select more than one (capital button), but it does not work.  any body know how to select more than one photo to upload at a time?
    thanks!
    Solved!
    Go to Solution.

    Sending more than one file is easy to do but I am not sure how facebook works with this, you would have to try
    Click the picture you want to send in the MMS and select the contact, when it loads up and you have selected send as MMS the cursor should be at the top right next to the image file name - simply hit the menu button and select attach picture and browse to the next picture you want to send and once you have done that you should see 2 pictures in the MMS window ready to send - trackball or menu button to send from there
    Good luck
    LuKiN

  • HT204411 i am trying to purchase many songs at one time. i have added all songs to wish list , now to purchase it will only let me  do one at a time  please advise how i can purchase more than one at a time

    i am trying to purchase many songs at one time. i have added all songs to wish list , now to purchase it will only let me  do one at a time  please advise how i can purchase more than one at a time

    There used to be a 'buy all' button on the wish list screen but for some reason that has been removed from the current version of iTunes so you will need to buy each item individually. You can try leaving feedback for Apple and maybe it'll be added back in a future update : http://www.apple.com/feedback/itunesapp.html

  • Adding more than one song to a slide show in Elements 11

    Most of my slideshows are longer than one song and I get tired of it just repeating. Can I have more than one song in a slide show and how do I do this?

    I like to use different songs for different parts of slide shows and also to edit out some of the extra verses in some of the songs I use, so what I do is to use Wavepad (free download) to edit the desired songs. I save each one in a separate file (adding a descriptor such as "short" to the original title). Then, I open a new file in Wavepad, save it as the name of the slide show (such as Graduation Medley), then copy & paste each song from its respective file, in the correct sequence I want them to play into the new file. Be sure to save at the end, in between, all the time.
    I go back to iTunes and import the new file into the Library. Then I go back to iPhoto, select the relevant slide show, click on the Music button and select that file for my music for the slide show. I then go to the Settings and click the button that says "Fit photos to music".
    You can also create a playlist from the edited files and add the playlist as specified in the other posts.
    When previewing the slide show, if the music for the 2nd section starts too soon or too late, I adjust the time for a couple of beginning section's slides, add an extra one in, or maybe even reedit the music.
    Hope this helps.

  • How to add more than one button control on import of skin?

    I am importing a skin from photoshop that I customized and exported.  For my particular project I need more than one button type with different sizes, dimensions, colors, etc.  In example the buttons for the navigation are going to be different than buttons to print, or email, and buttons that are bigger for the main custom component also need to be different.  I tried changing the naming convensions in the .PSD file but I can't get it to export more than one button type.  Is there a way to do this? 
    Thanks,
    Ryan

    hi,
    even i am searching for some thing similar.
    i want to have 3 calendars in one page.
    getting same message calendar already exists on page 2. You can only add one calander per page. Select a different page.
    pls help.

Maybe you are looking for

  • Link Question

    I have to switch class handouts I prepared with FrameMaker 7.1 for paper distribution to a pdf that can be used in laboratory classes on a computer network. I want to include links that will open in new windows to display figures or diagrams. I think

  • Errors after EJP Deployment on OAS 4.0.8.2

    Hi, I have successfully deployed EJB on OAS 4.0.8.2. However, when I tried to test it, it fails with the following error.. =========================================void oracle.jbo.jbotester.MainFrame.main(java.lang.String[]) java.rmi.ServerException:

  • How to calculate SNR and BER using USRP 2920 with LFTX and LFRX daugher boards.

    I have few questions regarding SNR and BER measurement: I am using two USRP 2920 with daughter boards LFTX and LFRX. One is completely Tx and anothe one is completely Rx. I have following few questions: Q1: How to control/change Energy per bit (Eb) i

  • Learn SAP Human Resource Management Module

    Hello, I am new on this website. I would like to know which are the methods to learn or to be trained to use SAP/HR (Human resources).I contacted SAP company in France where I live and the fees are about 17000 euros, they are crazy, i thought it was

  • Whenever the flash goes off on my camera it turns my screen and the picture blue. How do I fix that?

    Whenever the flash goes off on my camera it turns my screen and the picture blue. How do I fix that?