How can I make Navivation buttons remain coded through different scenes?

Ladies and Gents,
I am working on a flash website for an artist with a lot of work. In order to maintain my timeline clean and organized I have created multiple scenes to display the artwork.
There is a home button and a a main navigation bar (present in every scene)
there is also a sub navigation bar that leads to the artwork.
The code is very simple and constant for all the buttons:
btnHome.addEventListener(MouseEvent.CLICK, home);
function home(evt:Event):void{
    gotoAndPlay(1, "Home");
This works only in the scene where I first placed the code (Scene "Art"). The rest of the scenes give me this error
ArgumentError: Error #2108: Scene Home was not found.
    at flash.display::MovieClip/gotoAndPlay()
    at Susan_Giles_MultipleScenes_Scene1999_fla::MainTimeline/home_1999()
I am very confused because flash can find the scene "Home" and the other 11 scenes from the scene ART, but it cannot locate them from any other scene.... what am I doing wrong?
I will appreciate all help.
Thanks in Advance.
J.

One way would be to make the movieclip clickable.  That would make it block the other objects behind it...
     mc.onRelease = function(){ }
     mc.useHandCursor = false; // to hide the hand cursor
Another way would be to disable the buttons while the movieclip is present...
     btn.enabled = false;
Another way would be to build conditional code into the button clicking code to not work if the movieclip is visible.
     btn.onRelease = function(){
          if(!mc._visible){
                // okay to do stuff

Similar Messages

  • How can you make one button preform different actions in Xcode?

    How can you make one button "preform a click" and "orderfront"? Is that possible? Because what I am doing is making a welcome window to my application for Mac OS X 10.6, and I have two buttons in that window, one says "Connect" which connects a a WebView to a url and the other button opens up the main window. So how can I a make a button do multiple things at once??

    Ah - If you are just using bindings between various objects from Interface Builder, you can reduce your application code a bit (sometimes quite a bit), but there is only so far you can go. Typically variables and routines are defined in your application that Interface Builder hooks into, so that your application code (usually Objective-C, but can be others) can use these variables and routines to determine what is happening in the user interface.
    I'm not sure how up-to-date the project code is (or what programming code you are familiar with), but you can take a look at Apple's Cocoa Application Tutorial to see what is (usually) involved in creating an application.

  • How can I make music (mp3) play automatically in one Scene (NO buttons)?

    How can I make an mp3 play automatically in one Scene (NO buttons)? I have been searching the net for answers for over 10 hours with no answer... My movie will not be for the web, it needs to be portable (CD or flash drive)...
    PLEASE HELP!!!!!!!
    thank you!

    You just need to look in Help for the Sound class and possibly SoundChannel... if you have an MP3 in your library - right click it, and go to properties. Set the sound to export for ActionScript - and give it a class name - mySound will work. Then you can make it play with something as simple as:
    var a:SoundChannel = new mySound().play();

  • How can I make a button that on press the object appears and on second press the object to disappear

    Hello,
    I'm quite new to flash programing, and I don't know how can I make a button that will make the object appear and disappear.Till now I have this code for the appear:
    on (press)
        _root.top1.gotoAndStop(2);
        _root.topp.gotoAndStop(2);
        _root.mm1.gotoAndStop(2);
              _root.m1.gotoAndStop(2);
    but from here I'm stuck.
    Thank you for your help

    What you can do is use the _visible property of the object to make it appear and disappear, or more correctly, use the opoosite of the _visible property.  You should not put code "on" objects, keep it in the timeline.
    If "object" is the instance name of the object you want to toggle, then in the timeline code you can use...
    object._visible = false;  // start with the object being invisible
    yourButtonName.onRelease = function(){
        object._visible = !object._visible;
    That one line in the function sets the object's _visible property to be the opposite of what it currently is.

  • How can I make my buttons be gone forever?

    Just starting out with Flash and have run into a problem. I have several scenes with buttons that can be pressed once and then they disappear using:
    myBtn1.onRelease = function(){ this._visible=false}
    But when I go back to the scene the buttons reappear. How can I make my buttons be gone forever?

    if you have more than 1 button that should be made not visible at any given time, you'll need to use an array to store those button references.  otherwise, you can use:
    var alreadyRemoved:Boolean;
    if(alreadyRemoved){
    myBtn1._visible=false;
    myBtn1.onRelease=function(){
    this._visible=false;
    alreadyRemoved=true;

  • How can I make a button "react"?

    This is probably a super silly question, but you know how it is, sometimes we sit on the answer and still can't find it... How can I make a button react to a click? I just want the simple effect of the button changing colors or looking like the user pushed it. Right now it's just the same old plain button, no matter if I click it or not, you can't really tell the difference. How can I give it the "pushing the button" effect? Thanks guys!

    You can choose image button and then choose from the available image buttons, or click on the folder icon when you select the image button and choose from the Gallery of Captivate 6.
    Few image buttons change color on hover or onclicked, these effects are predefined in them.
    Or you can edit that button on which you are working, from properties Panel.
    The Post and Cancel button on this thread seems like a transparent button in Captivate with different fill and stroke color, and transparency is also less, and with corner radius of 0.
    You will find these all optionns, when you will click on that button and then click on the properties panel.
    Thanks.

  • I need to play a song on a Keynote presentation, how do I do this ? I use to drag and drop the mp3 in Keynote but it stops playing when the slide move to the other one... how can I make the song keep playing through the whole presentation ? Thanks.

    I need to play a song in a row in a Keynote presentation, how do I do this ? I use to drag and drop the mp3 in Keynote but it stops playing when the slide move to the other one... how can I make the song keep playing through out the presentation ?
    Thanks.

    Drag the file into the audio window in the Document inspector...

  • How can I make the current row in a different color  in  ADF Table 10.1.3

    Hi all
    in JDeveloper 10.1.3 ADF Table ,
    How can I make the current row in a different color ?
    thanks

    And what exactly would "the component" be?
    I tried the af:outputText, but it just creates a <span> around the value of the cell, and if I try the af:column it just won't use it at all!
    Any suggestions?

  • How can I make an external link (to a different folder) from the main menu?

    How can I make an external link (to a different folder) from the main menu?

    If the folder is outside the Muse page, you will have to insert manual HTML to define a more complex URL like e.g. ../_stuff for going one level up and then into a folder called "_stuff" The deeper you are in the hierarchy, the more ../ you will have to add to climb up.
    Mylenium

  • How can i make save button of a pop up window inactive?

    Hi...
    When we open a document attached to an opportunity,
    a pop up opens up in new window with open,save and cancel buttons.
    The document is opened by creating a url....
    How can i make the save button inactive?
    Any helpful pointers would be rewarded...
    Thanks...

    Hi..
    This thread remains closed...

  • HT1349 we both have the same Iphone, how can we make sure that we both have different account on the same network?

    my partner and i have the same models of Iphone. how can we make sure that when she logs on to our home network, it recognises her phone and doesn't down load to my phone?

    Did you try to rename one of them? iTunes: How to rename your device
    iTunes remembers the settings for each phone when you sync, even if both phones are called "My iPhone".
    So make sure to set it up like you want to, after that iTunes will do the rest.

  • How can I make JSpinner value remain unchange

    Hi,
    I've posted this message on Programming forum before, and many friends recommend me better to post in Swing forum.
    I have a question on how to make the value remain unchange after some confirmations? In my program, I have to ask whether user want to change the value,
    if yes, something other settings will be reset.
    if no, I hope the vaule in Jspinner remains unchange.
    I tried to use the state stateChanged event to detect any value change. and set back the previousValue, however, it comes into the event many times...
    pbrockway2 has suggested me to add a flag inside stateChanged to prevent it comes into the event, however, this method not so work all times. And the value also will keep being increased or decreased.
    Can some of you give a hints, the code below :
           jSpinner_row.addChangeListener(new ChangeListener()
                public void stateChanged(ChangeEvent event)
                    if(CheckFlag)
                        int result = JOptionPane.showConfirmDialog(ParentFrame,
                                "Are you sure you want to row setting ?",
                                "Setup", JOptionPane.YES_NO_OPTION,
                                JOptionPane.QUESTION_MESSAGE);
                        if (result == JOptionPane.NO_OPTION)
                            CheckFlag = false;
                            jSpinner_row.setValue(jSpinner_row.getPreviousValue());
                            CheckFlag = true;
                            return;
                        else
                            // do reset of controls and re - construct panel
                            CheckFlag = true;
            });

    this might (?) be one way, but, as is, only works with SpinnerNumberModel
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      JSpinner spinner;
      final int MIN = 0, MAX = 100;
      public void buildGUI()
        JPanel p = new JPanel();
        spinner = new JSpinner(new SpinnerNumberModel(MIN,MIN,MAX,1));
        ((JSpinner.DefaultEditor)spinner.getEditor()).getTextField().setEditable(false);
        spinner.setUI(new ChangeVerifierUI());
        p.add(spinner);
        JFrame f = new JFrame();
        f.getContentPane().add(p);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      class ChangeVerifierUI extends javax.swing.plaf.basic.BasicSpinnerUI
        protected Component createNextButton()
          JButton nextButton = (JButton)super.createNextButton();
          nextButton.removeMouseListener(nextButton.getMouseListeners()[0]);
          nextButton.addMouseListener(new MouseAdapter(){
            public void mousePressed(MouseEvent me){
              if(((Integer)spinner.getValue()).intValue() < MAX) checkChange(+1);
          return nextButton;
        protected Component createPreviousButton()
          JButton previousButton = (JButton)super.createPreviousButton();
          previousButton.removeMouseListener(previousButton.getMouseListeners()[0]);
          previousButton.addMouseListener(new MouseAdapter(){
            public void mousePressed(MouseEvent me){
              if(((Integer)spinner.getValue()).intValue() > MIN) checkChange(-1);
          return previousButton;
      public void checkChange(int direction)
        int result = JOptionPane.showConfirmDialog(null,"Are you sure you want to row setting ?",
            "Setup", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
        if (result == JOptionPane.YES_OPTION) spinner.setValue(
          ((Integer)spinner.getValue()).intValue()+
          (((Number)((SpinnerNumberModel)spinner.getModel()).getStepSize()).intValue())*direction);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • How can i make a button link in flash??

    Hey Guys,
    Im pretty new to flash but really need your help and
    guidance. I have a nice video ive created, and i want to make the
    buttons link to certain pages on a website it will be displayed at.
    If you want to see the flash video in place on the website,
    visit www.loveandmarriagebridal.co.uk - i want to make the buttons
    to link to the following pages.
    button 1. www.loveandmarriagebridal.co.uk/index.php
    button 2. www.loveandmarriagebridal.co.uk/about_us.php
    button 3. www.loveandmarriagebridal.co.uk/
    button 4.
    http://loveandmarriagebridal.co.uk/account.php
    button 5.
    http://loveandmarriagebridal.co.uk/contact_us.php
    Could anybody please tell me exactly what i need to do in
    order to acheive that. I am using Flash CS3. Ive looked around the
    net for a solution, but i honestly have no idea what im searching
    for.
    Your help would be very much appreciated
    Thanks
    Andy

    See which form of ActionScript you used to make the site.
    Open the Actions panel and see whether you've chosen AS versions 1
    & 2, or AS 3. If you've picked the earlier versions, you can
    attach a link easily to each button by clicking on the button, and
    adding a little code in the Actions panel. Turn on ScriptAssist to
    make it easier. Click on "on" and choose "release" or "press" or
    both. Then scroll down the commands on the left and add getURL. You
    will then have a few lines that say something like, on(Release)
    getURL("putyourpageurlhere"). See bottom for exact syntax. That's
    all. The new .html or .php page will load when the button is
    clicked.
    If your buttons are not actually four-state buttons, but
    graphic or movie clip symbols, you will have do it a little
    differently. Instead of attaching the code to a button, you attach
    it to a keyframe. You give your symbol an instance name in the
    property panel, then in the Actions panel create a function that
    says essentially: when you click on this instance (onRelease)
    getURL.
    If you're using AS3, the concept is similar but the code is
    different. With a quick search you can find dozens of code examples
    that you can cut and paste.
    Here's that AS2 button code...

  • How can I make a button (click) animate an object

    Basically I want to make a button (nextscreen) which animates a rectangle (movie1) once it's clicked.
    So far it doesn't work, anything I try gives me errors
    for example I typed
    nextscreen.onPress();
    function fl_AnimateHorizontally_6(event:Event)
        Movie1.x += 10;
    But it gives me the error
    Scene 1, Layer 'Actions', Frame 1, Line 12
    1061: Call to a possibly undefined method onPress through a reference with static type flash.display:SimpleButton.
    Apparently once I select my button and hit f9, I'm supposed to see the symbol of the button at the bottom but I can't so all my script is on a seperate layer called Actions and is all over the place
    So I try to use code snippets and when I run my program with this code;
    nextscreen.addEventListener(Event.ENTER_FRAME, fl_AnimateHorizontally_7);
    function fl_AnimateHorizontally_7(event:Event)
        Movie1.x += 10;
    My object animates but without me clicking the button
    so what do I need to add so only when I click the object animates
    Regards

    If that's the case then you need to have clicking the button initiate a repeating function, which you can achieve using an ENTER_FRAME event listener.
    nextscreen.addEventListener(MouseEvent.CLICK, fl_AnimateHorizontally_7);
    function fl_AnimateHorizontally_7(event:MouseEvent)
         nextscreen.removeEventListener(MouseEvent.CLICK, fl_AnimateHorizontally_7);
         this.addEventListener(Event.ENTER_FRAME, moveHalfway);  
    function fl_AnimateHorizontally_7(event:Event)
         if(Movie1.x <stage.stageWidth/2){
                Movie1.x += 10;
          } else {
                this.removeEventListener(Event.ENTER_FRAME, moveHalfway);  

  • How can i make push button iconic

    plz tell how to make push button iconic in windows paltform.and where to store the .gif file what is the path

    Do not duplicate your posts

Maybe you are looking for

  • Migrating SAP Crystal Data from One BO BI 4 to another and on a different domain

    Thank you for reading this and thank you in advance. This is pretty new to me, I have installed Crystal Server several times before but never had to do much with it and the person that looked after it left a year ago. So I have been tasked to migrate

  • My ipod wont work

    ive tried everything it plays for like a few seconds then goes on to the next song and jut keeps skipping til it goes thru the whole playlist.. i tried reinstall reset setting it to factory reset, tried it on another computer when i hook it up to itu

  • XRPM error Message

    hi friends, we have installed xRPM 4.5 in our system and we have assigned the roles like Project managment , Portfolio Management, Design Collabration. Now when we click Portfolio Management tab  we are getting warnings like. *No portfolios exist No

  • Template problems with typename

    hi, I'm working using Sun Studio 11, here's a problem I just encountered. $ cat template.C template <class T> struct A { public: struct inside{ typedef T value_type; template <class T> class B { public: #ifdef USE_TYPENAME void f(typename A<T>::insid

  • Does the new iwork still support services/linkback?

    I updated to Mavericks and to the new iWork and it all appears to be there, but doesn't seem to work. Not sure if I'm doing something wrong or if it's not supported anymore. Thanks!