Can't get ONE button to work....why?

I am loading 4 external SWF's inside a Master Movie file. I've got 3 of the 4 working. The last one is giving be fits and I can't see the problem. I am housing the external SWF's inside a manually created container (AS2). This last button is being a rebel and it's driving me nuts.
I've checked and double-checked to ensure the instance name matches the button name in the code....as well as the name of the external swf. It's all correct, to me. The .swf is in the same folder as the .fla, by the way.
Sure could use some fresh eyes that might be able to figure what's going on.
AS2 code:
stop ();
jukebtn.onPress = function ()
    _root.createEmptyMovieClip ("container",1);
    loadMovie ("jukebox.swf", "container");
    container._xscale = 80;
    container._yscale = 73;
    container._x = 362;
    container._y = 152;
sshowbtn.onPress = function ()
    _root.createEmptyMovieClip ("container",1);
    loadMovie ("sshow.swf", "container");
    container._xscale = 66.5;
    container._yscale = 65;
    container._x = 359    ;
    container._y = 155;
gamebtn.onPress = function ()
    _root.createEmptyMovieClip ("container",1);
    loadMovie ("drag_drop.swf", "container");
    container._xscale = 56;
    container._yscale = 58;
    container._x = 400;
    container._y = 163;
dynambtn.onPress = function ()         //problem button
    _root.createEmptyMovieClip ("container",1);
    loadMovie ("dynam.swf", "container");
    container._xscale = 50;
    container._yscale = 50;
    container._x = 350;
    container._y = 130;

either your button reference or swf reference is incorrect.
use the following and click each of your 4 buttons:
stop ();
_root.createEmptyMovieClip ("container",1);
jukebtn.onPress = function ()
trace(this);
    container.loadMovie ("jukebox.swf");
    container._xscale = 80;
    container._yscale = 73;
    container._x = 362;
    container._y = 152;
sshowbtn.onPress = function ()
trace(this);
    container.loadMovie ("sshow.swf");
    container._xscale = 66.5;
    container._yscale = 65;
    container._x = 359    ;
    container._y = 155;
gamebtn.onPress = function ()
trace(this);
    container.loadMovie ("drag_drop.swf");
    container._xscale = 56;
    container._yscale = 58;
    container._x = 400;
    container._y = 163;
dynambtn.onPress = function ()         //problem button
trace(this);
    container.loadMovie ("dynam.swf");
    container._xscale = 50;
    container._yscale = 50;
    container._x = 350;
    container._y = 130;

Similar Messages

  • I can't get my Button to work?

    Hello everyone,
    I been trying to get my Button working, but I don't understand what's wrong. I've tried a bunch of stuff, each with failure. Can any of you guys help me out here? I know that it's a little bit of a mess, but for some reason, it gives me a NullPointerException when I execute it. If I comment out 4 lines of code, about the getContentPane, it works without making a button. Problem is, I want to keep the Button in there. What should I do?
    Thanks
    import com.brackeen.javagamebook.graphics.ScreenManager;
    import com.brackeen.javagamebook.graphics.ScreenManager;
    import com.brackeen.javagamebook.sound.SoundManager;
    import com.brackeen.javagamebook.graphics.NullRepaintManager;
    import com.brackeen.javagamebook.input.*;
    import com.brackeen.javagamebook.input.GameAction;
    import com.brackeen.javagamebook.graphics.*;
    import com.brackeen.javagamebook.sound.*;
    import com.brackeen.javagamebook.test.GameCore;
    import java.util.List;
    import java.util.ArrayList;
    import javax.swing.border.Border;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.io.File;
    import java.awt.event.KeyListener;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.midi.Sequence;
    import java.applet.AudioClip;
    import javax.sound.midi.Sequencer;
    import java.awt.image.BufferStrategy;
    import java.awt.image.BufferedImage;
    import java.lang.reflect.InvocationTargetException;
    public class Graphic2 implements ActionListener
         public static void main(String[] args)
    new Graphic2().run();
    private JPanel startButtonSpace;
    private static final long DEMO_TIME = 30000;
    private static final String EXIT = "Exit";
    private ScreenManager screen;
    private ActionListener action;
    private Image Background, Title, Start;
    private boolean isRunning;
    private Sequence music;
    private SoundManager soundManager = new SoundManager(PLAYBACK_FORMAT);
    private MidiPlayer midiPlayer;
    private Sound titleMusic;
    //Uncompressed, 44100Hz, 16-bit, Sterio, Signed, Little-Endian
    private static final AudioFormat PLAYBACK_FORMAT =
    new AudioFormat(44100, 16, 2, true, false);
    protected InputManager inputManager;
    protected GameAction configAction;
    protected GameAction exit;
    private JButton startButton;
    private static final DisplayMode POSSIBLE_MODES[] = {
    new DisplayMode(1024, 768, 32, 0),
    new DisplayMode(1024, 768, 24, 0),
    new DisplayMode(1024, 768, 16, 0),
    new DisplayMode(800, 600, 32, 0),
    new DisplayMode(800, 600, 24, 0),
    new DisplayMode(800, 600, 16, 0)
    public void loadImages()
    // load images
    Background = loadImage("Title Screen.jpg");
    Title = loadImage("Title.gif");
    Start = loadImage("Start.gif");
    public Image loadImage(String fileName)
    return new ImageIcon(fileName).getImage();
    public void animationLoop()
    long startTime = System.currentTimeMillis();
    long currTime = startTime;
    while (isRunning)
    long elapsedTime = System.currentTimeMillis() - currTime;
    currTime += elapsedTime;
    // draw and update screen
    Graphics2D g = screen.getGraphics();
    draw(g);
    g.dispose();
    screen.update();
    // take a nap
    try
    Thread.sleep(20);
    catch (InterruptedException ex) { }
    public void initSounds()
    //midiPlayer = new MidiPlayer();
    titleMusic = soundManager.getSound("movie02.wav");
    //music = midiPlayer.getSequence("potc.mid");
    public void run()
         NullRepaintManager.install();
         isRunning = true;
         initSounds();
         NullRepaintManager.install();
         screen = new ScreenManager();
         JFrame frame = screen.getFullScreenWindow();
    // create buttons
    startButton = createButton("Start.gif");
    startButton.setLocation(460, 500);
    //frame.getContentPane().setLayout(new FlowLayout());
    //frame.getContentPane().add(startButton);
    try
    DisplayMode displayMode =
    screen.findFirstCompatibleMode(POSSIBLE_MODES);
    screen.setFullScreen(displayMode);
    loadImages();
    soundManager.play(titleMusic);
    //if (frame.getContentPane() instanceof JComponent)
         //((JComponent)frame.getContentPane()).setOpaque(false);
    animationLoop();
    finally
    screen.restoreScreen();
    soundManager.stop();
    frame.validate();
    Window window = screen.getFullScreenWindow();
         public void draw(Graphics2D g)
    // draw background
    g.drawImage(Background, 0, 0, null);
    // draw image
    g.drawImage(Title, 342, 244, null);
    //g.drawImage(Start, 460, 500, null);
    public void actionPerformed(ActionEvent e)
    Object src = e.getSource();
    if (src == startButton)
    exit.tap();
    public void checkSystemInput()
    if (exit.isPressed())
    stop();
    public void stop()
    isRunning = false;
    public void createGameActions()
    exit = new GameAction("exit",
    GameAction.DETECT_INITAL_PRESS_ONLY);
    inputManager.mapToKey(exit, KeyEvent.VK_ESCAPE);
    public JButton createButton(String name)
    // load the image
    String imagePath = name;
    ImageIcon iconRollover = new ImageIcon(imagePath);
    int w = iconRollover.getIconWidth();
    int h = iconRollover.getIconHeight();
    // get the cursor for this button
    Cursor cursor =
    Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
    // make translucent default image
    /*Image image = screen.createCompatibleImage(w, h);*/
    Graphics2D g = screen.getGraphics();
    /*g.drawImage(iconRollover.getImage(), 0, 0, null);*/
    // create the button
    JButton button = new JButton();
    button.addActionListener(this);
    button.setIgnoreRepaint(true);
    button.setFocusable(false);
    button.setBorder(null);
    button.setContentAreaFilled(false);
    button.setCursor(cursor);
    button.setIcon(iconRollover);
    button.setRolloverIcon(iconRollover);
    button.setPressedIcon(iconRollover);
    return button;
    }

    1) Swing related questions should be posted in the Swing forum
    2) Use the "code" formatting tags when posting code so the code is readable.
    3) Post [url http://www.physci.org/codes/sscce.jsp]Simple, Executable Sample that shows your problem. The code you posted uses non-standard API's so we can't execute your code to see the incorrect behaviour.
    4) Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/button.html]How to Use Buttons. Or maybe the section on "How to Use Layout Managers" will solve your problem. Either way read the tutorial.

  • Can't get the button to work

    I am new to java and have tried to write a simple program to thow dice but i cant make the button work. Could someone please help me?
    Here is the code for the prog.
    import java.awt.*;
    import java.util.Random;
    public class Dice extends java.applet.Applet {
    Font f = new Font("TimesRoman",Font.BOLD, 36);
    Image bilde1,bilde2,bilde3,bilde4,bilde5,bilde6;
    String note = "Throw the Dice!";
    Button throwing = new Button(note);
    public void init() {
         bilde1 = getImage(getCodeBase(),"Dice/Dice 1.jpg");
         bilde2 = getImage(getCodeBase(),"Dice/Dice 2.jpg");
         bilde3 = getImage(getCodeBase(),"Dice/Dice 3.jpg");
         bilde4 = getImage(getCodeBase(),"Dice/Dice 4.jpg");
         bilde5 = getImage(getCodeBase(),"Dice/Dice 5.jpg");
         bilde6 = getImage(getCodeBase(),"Dice/Dice 6.jpg");
         add(throwing);
    public void thro() {
         Random r1,r2,r3,r4,r5,r6;
         r1 = new Random();
         r2 = new Random();
         r3 = new Random();
         r4 = new Random();
         r5 = new Random();
         r6 = new Random();
    // Make random numbers between 1 and 6
         int number[] = {0,0,0,0,0,0,0,0,0,0};
         number[1] = (int)(r1.nextDouble()*6+1);
         number[2] = (int)(r2.nextDouble()*6+1);
         number[3] = (int)(r3.nextDouble()*6+1);
         number[4] = (int)(r4.nextDouble()*6+1);
         number[5] = (int)(r5.nextDouble()*6+1);
         number[6] = (int)(r6.nextDouble()*6+1);
         repaint();
    public void paint(Graphics screen) {
    /*     Random r1,r2,r3,r4,r5,r6;
              r1 = new Random();
              r2 = new Random();
              r3 = new Random();
              r4 = new Random();
              r5 = new Random();
              r6 = new Random();
         // Lager tilfeldige tall mellom 1 og 6
         int number[] = {0,0,0,0,0,0,0,0,0,0};
              number[1] = (int)(r1.nextDouble()*6+1);
              number[2] = (int)(r2.nextDouble()*6+1);
              number[3] = (int)(r3.nextDouble()*6+1);
              number[4] = (int)(r4.nextDouble()*6+1);
              number[5] = (int)(r5.nextDouble()*6+1);
              number[6] = (int)(r6.nextDouble()*6+1);
         // Display the images
    int number[] = {0,0,0,0,0,0,0,0,0,0}; //just to initialize the array
         for (int i=0;i<7;i++) {
              if (number==1)
                   screen.drawImage(bilde1,10+90*i,200,this);
              else
              if(number[i]==2)
                   screen.drawImage(bilde2,10+90*i,200,this);
              else
              if(number[i]==3)
                   screen.drawImage(bilde3,10+90*i,200,this);
              else
              if(number[i]==4)
                   screen.drawImage(bilde4,10+90*i,200,this);
              else
              if(number[i]==5)
                   screen.drawImage(bilde5,10+90*i,200,this);
              else
              if(number[i]==6)
                   screen.drawImage(bilde6,10+90*i,200,this);
    public boolean action(Event evt,Object arg) {
         if(evt.target instanceof Button) {
              thro();
              return true;
         else
              return false;

    Where to start?
    First off, there are two ways of displaying stuff in a frame, writing a paint method to draw what you want or adding children, like buttons to the frame. You've tried to do both.
    You'd be better of placing your drawn dice inside an internal componenent of some sort. If you insist on avoiding Swing components, for some reason, create a subclass of java.awt.Canvas to draw your dice. You can either create one canvas object to draw all your dice or, better, one for each dice. However you should consider switch to Swing graphics (javax.swing.*) and using a JLable to draw each dice as an ImageIcon.
    Then you add the six dice and the OK button to the frame and you don't need a paint method on the frame.
    To make a button do something you need to add an ActionListener to it. The ActionListener could be your applet object in this case. You need to declare it as "implements java.awt.event.ActionListener" and the action method has to look like:
    public actionPerformed(java.awt.even.ActionEvent evt) {
    ...roll the dice
    }

  • Can't get "Menu" button to work

    I have the 2nd gen, 4GB nano and the Menu button doesn't work. It is fully charged, I can play music, use all the other buttons, but cannot use the Menu button. Any ideas on what to do?

    I have same issue, except my MENU button doesnt work. All the other buttons work

  • How can I get one button to perform two functions?

    here's what I want:
    have one button with a + that opens a pop up using a MSO and then turn that button to a X to close the pop up changing states on the MSO

    1. Create a graphic with plus sign and make it a button
    2. Group it with an empty frame of desired size
    3. Create a graphic with x sign and make it a button
    4. Group it with a frame with a pop up
    5. Create an MSO of the two groups
    6. Assign "goto next state"  to each button

  • Can't get flash buttons to work...'Cannot find path' Flash MX 2004

    I am trying to get the flash buttons for my website to work, but every time I do the getURL thing it keeps saying 'Cannot find (directory)'. The website is offline and I'm using Macromedia Flash MX 2004, I also might be able to use Flash 8 but these are the only two versions I have access to.
    The action script for the button is:
    on(release){
    getURL("..\****\****\(Website directory)\(sub directory)\(Website page).html")
    I am making the website in Dreamweaver 8 and this is really holding me back as it's nearly finished but the buttons still don't work.
    Thanks in advance.

    Hi,
    Sorry I should have mentioned tha. The structure is as follows:
    Website name\
                         \Animations
                         \Audio
                         \Buttons
                         \Images
                         \Scripts
                         \Templates
                         \Videos
    The buttons are contained in the buttons folder and the page I want to link it to is in the templates folder. I have tried putting the button flash file in the website root directory and trying that but it didn't work.
    Hope this helps.
    Thanks in advance.

  • How can I get itunes buttons to work?

    None of the iTunes buttons work, such as "Music," "Albums," "iTunes Store." So, I can't access any of my music. Any suggestions would be appreciated.

    have you tried to troubleshoot the conection to the itunes store to see if it will work?
    maybe the login servers are down, might have to try later.

  • Can't get Default Button to work

    I can't seem to figure out why the default button isn't
    firing when I press Enter, any help is greatly appreciated:
    <mx:Panel id="pnlSignIn" width="217" height="131"
    layout="absolute" title="Please Sign In" color="#000000" x="378"
    y="205">
    <mx:Form defaultButton="{btnSignIn}" x="0" y="0">
    <mx:FormItem label="Pin:" fontWeight="bold">
    <mx:TextInput width="122" displayAsPassword="true"
    editable="true" enabled="true" id="txtPassword"/>
    </mx:FormItem>
    <mx:FormItem x="45" y="40">
    <mx:Button x="50.5" y="41" label="Continue"
    id="btnSignIn" buttonDown="srvSignIn.send();"/>
    </mx:FormItem>
    </mx:Form>
    </mx:Panel>

    You can tell your TextInput to react to the enter key:
    <mx:TextInput width="122" displayAsPassword="true"
    enter="srvSignIn.send();" editable="true" enabled="true"
    id="txtPassword"/>
    This will allow the user to either press enter after entering
    their password or clicking the Continue button.
    Vygo

  • Only one of my earbuds on my bose headphones works with my ipad, iphone and macbook- if I hold them there the right earbud will work, but for the life of me, I can't get them to both work. Why is this? And is Apple doing anything about this?

    Only one of my earbuds on my bose headphones works with my ipad, iphone and macbook- if I hold them there the right earbud will work, but for the life of me, I can't get them to both work. Why is this? And is Apple doing anything about this? While Apple's headphones have (finally) admittedly gotten better of late, I still prefer the much more comfortable headphones & sound quality that Bose makes and that I spent the money for.

    Bose Product Support

  • I can't get the volume to work when I watch a you tube video, there's no volume slide under the play button, and my volume control on my I pad won't do anything either, but the volume of all my alarms and sounds works perfect, what can I do??

    I can't get the volume to work when I watch a you tube video, there's no volume slide under the play button and my volume control on my I pad don't do anything to help, but yet my volume works perfect on everything else, what can I do???

    do u have your ipad doing airplay because that could happen

  • My iphone  3gs does not have a wifi button how can i get one

    as my tittle states i dont have a wifi button can i get one ?

    First things first: you bought this iPhone second-hand from someone you know. That person must have used his iTunes account to activate the phone. Have you tried connecting your iPhone to your computer (Mac or PC, doesn't matter) via USB and have it recognized by iTunes on your computer? If not, you'll have to activate the iPhone first. iTunes will do that for you, provided the former user has notified Apple he has sold his iPhone to you. Then, there's the question of your mobile phone provider: iPhones are network-locked. You can't buy an iPhone from someone who's, say, an Orange customer, then use it on another network than Orange's (in the US, of course, that point is moot). Only way to unlock your phone is to jailbreak it, but it's risky, and frankly, I don't think you'll find a lot of info on this forum on the subject... First off, check on which operator network you friend was.

  • If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

    If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

    If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

  • So annoyed with this new itunes, spent over 2 hrs to get one ringtone on iphone,why apple has to make it so complicated, on samsung just a push of button ringtone or music is on ur phone... i think its time to say good bye to ihpne... Not a user friendly.

    so annoyed with this new itunes, spent over 2 hrs to get one ringtone on iphone,why apple has to make it so complicated, on samsung just a push of button ringtone or music is on ur phone... i think its time to say good bye to iphone... Not a user friendly...
    Highly recommended for samsung galaxy S4....

    hi i had the same problem today when i updated my itunes to latest version. however, i have just found my songs in the 'itunes media' folder. this was accessed through 'my music'  then keep clicking through until you find itunes media and all my library songs were in there and i then just added these files to my library and all were restored however, i have lost all my playlists but at least my 700 songs are back. very dissapointed with apple that they have let this happen with their latest update, the previous version was miles better than this one . hope you find them. stevo

  • 4 domains names can only get one to work

    4 domains names only 1 working
    i can only get one to work and now its crossed with other domains
    example i have jcsrealty.com all ready working fine. i want to post customxcycles.com on a new site but it cross over on to jcsrealty.com. so when you go to jcsrealty.com it pulls up customxcycles.com
    and no jcsrealty
    please help
    thanks

    Welcome to the Apple Discussions. Are you publishing to a MobileMe account? Is each site in its own domain file? If yes to both and you're using the CNAME method of domain name forwarding for the first site you published the last published site by iWeb will be the one that gets open when you enter your domain name. All additional sites must use the simple domain name (URL) forwarding.
    There are a couple of ways to get around that:
    1 - use the simple domain name (URL) forwarding for every one of your sites. That means pointing each site to its respective address on your MMe account: http://web.me.com/YourMMe_Account_Name/SiteName/.
    2 - add a dummy site in each of the domain files as described by Wyodor in this post: Re: Is it possible to have multiple sites when using ur Domain name.
    OT

  • Can't get video chat to work outside of LAN...

    Hello,
    I can't get video chat to work.
    All computers, LAN and WAN are running the latest iChat under 10.4 (including latest updates).
    Within our LAN, via Bonjour, everything is fine.
    I'm now trying to set up an offsite Intel iMac (10.4) and I can't connect via video chat with them.
    I've had this problem in the past and eventually gave up (so much for "it just works" - I've spent the last 10+ years dealing with Macs and Mac-based networking, I can't imagine "my dad" figuring this all out). Trying again with fingers crossed...?
    If someone could help, it'd be much appreciated.
    Thanks,
    Kristin.
    The studio router/firewall is a SonicWall TZ 170 Standard.
    This router has a static IP.
    All suggested ports on the SonicWall are set up correctly to allow in/out from our LAN.
    All computers on the LAN have static IP addresses.
    Quicktime streaming settings set as suggested.
    OS X Firewall on all computers = OFF.
    No iChat add-ons on any computers.
    Internet connection speed = 7404 kb/s
    The offside router/firewall is a LinkSys WRT54G
    This router does not have a static IP.
    DMZ is ON and set to the only computer connected to it.
    Computer has a static IP address.
    Quicktime streaming settings set as suggested.
    OS X Firewall on all computers = OFF.
    No iChat add-ons on computer.
    Internet connection speed = 5116 kb/s
    If any more information is required to help you help me, just let me know!

    Does the TZ170 have UPnP or Port Triggering then ?
    I can not see that it does here
    Opening the ports in the manner listed on that link will only allow one computer (IP) to use the open ports.
    The Linksys is router and you have not mentioned what the modem is doing at that end.
    Why not use UPnP here ? The Linksys does it (on the Administration page)
    Most likely this needs the Respond to Anonymous Pings checked on the Security page.
    9:29 PM Thursday; January 17, 2008

Maybe you are looking for

  • External .swf not loading on HTML pages

    Good morning, I'm having trouble and I was hoping someone could shed some light on what I'm doing wrong. I have a main .swf file from which external .swf files are being loaded through the use of buttons. When I preview the animation, everything work

  • Sync outlook mail account from the infotab in Itunes

    Hi! I have selectet my outlook mailaccount from the infotab in Itunes, and expected it to appere in Mail on my Iphone. But even if it shows how many unread mails I have got, I can not find them. When I open Mail it is like I have no mailaccount ready

  • How do I trash movies from iTunes?

    Can anyone tell me how to trash .mov's, etc from my iTunes? I'm a Mac user. I trashed the files, but the movies are still in my iTunes (app)? FWIW, I cannot believe Apple has made this such a difficult task?

  • I purchased Adobe PhotoShop Elements

    I purchased Adobe PhotoShop Elements & Premiere Elements 12 ( Download) from Amazon and I was able to install PhotoShop but not Premiere. The error reads: Error reading initialization file!

  • Cannot connect to Itunes, check network settings or connection to the internet

    Why do I keep getting this error message when I am trying to update my iphone software through my pc.  I am using Windows 7.