JFrames and Java3D simple problem

Hi ive created a program using jframes in Java and im wanting to move it over to java 3d but im having problems. Ive litterally just looked at java 3d so my knowledge is limited. All i want is to set up my canvas so that i have a Jframe panel on the right and a 3d ball on the left. Here's my failed attempt......
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.image.*;//imports image functions
import javax.media.j3d.*;
import javax.vecmath.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.awt.*;
public class Prog extends JFrame
    private Canvas3D canvas;
    private SimpleUniverse universe = new SimpleUniverse();  // Create the universe      
    private BranchGroup group = new BranchGroup(); // Create a structure to contain objects
    private Bounds bounds;
    public Prog()
        super("Program");
        GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
        canvas = new Canvas3D(config);
        //getContentPane().setLayout( new BorderLayout( ) );
        //getContentPane().add(canvas, "Center");
        Container c = getContentPane();
        setSize(600,400);
        c.setLayout(new BorderLayout( ));
        JPanel leftPanel = new JPanel( );
        leftPanel.setBackground(Color.BLACK);
        c.add(leftPanel, BorderLayout.CENTER);
        c.setLayout(new BorderLayout( ));
        JPanel rightPanel = new JPanel( );
        rightPanel.setBackground(Color.GRAY);
        c.add(rightPanel, BorderLayout.EAST);
        JButton goButton = new JButton("  Go  ");
        goButton.setBackground(Color.RED);
        rightPanel.add(goButton);
     Light();//Creates A Light Source
       // Create a ball and add it to the group of objects
       Sphere sphere = new Sphere(0.5f);
       group.addChild(sphere);
       // look towards the ball
       universe.getViewingPlatform().setNominalViewingTransform();
       // add the group of objects to the Universe
       universe.addBranchGraph(group);
    public void Light()
        // Create a white light that shines for 100m from the origin
        Color3f light1Color = new Color3f(1.8f, 1.8f, 1.8f);
       BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
        Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);
       DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
        light1.setInfluencingBounds(bounds);
       group.addChild(light1);
    public static void main(String[] args)
       Prog frame = new Prog();
     frame.setVisible(true);
}It Compiles but the 3d ball and the Jframe gui are in different windows but i want them in the same window but i duno how ?

Hi tesla66 I'm sorry if I didn't correct your code, but drop some new code trying to solve the problem. I've used the cube instead the sphere because it's easier to see is rotating but just change "new ColorCube(0.4f)" with " new Sphere( 0.4f )". I wrote even some coments tought they're helpful. Tell me if I solved the problem
import java.awt.*;
import javax.swing.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.*;
public class JFrameAndCanvas3D extends JFrame
     private Canvas3D canvas3D;
     public static void main(String[] args)
        new JFrameAndCanvas3D();
     public JFrameAndCanvas3D()
          initialize();
    public BranchGroup createSceneGraph()
        BranchGroup objRoot = new BranchGroup(); //root
        // Creates a bounds for lights and interpolator
        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);
        //Ambient light
        Color3f ambientColour = new Color3f(0.2f, 0.2f, 0.2f);
        AmbientLight ambientLight = new AmbientLight(ambientColour);
        ambientLight.setInfluencingBounds(bounds);
        objRoot.addChild(ambientLight);
        ///Creates a group for transforms
        TransformGroup objMove = new TransformGroup();
        //You must set the capability bit to allow to write transform on the object
        objMove.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        //Adds a color cube
        objMove.addChild(new ColorCube(0.4));
        //Creates a timer
        Alpha rotationAlpha = new Alpha(-1, //-1 = infinite loop
                                        4000 // rotation time in ms
        //creates a transform 3D based on Y axis roation
        Transform3D t3d = new Transform3D();
        t3d.rotY(Math.PI/2);
        //Creates an rotation interpolator with an alpha and a TransformGroup
        RotationInterpolator rotator = new RotationInterpolator(rotationAlpha, objMove);
        rotator.setTransformAxis(t3d);//setta l'asse di rotazione
        //sets a bounding region. withouth this scheduling bounds the interpolator won't work
        rotator.setSchedulingBounds(bounds);
        //add the interpolator to the group
        objMove.addChild(rotator);
        //Adding the group to the root
        objRoot.addChild(objMove);
        objRoot.compile();//improve the performance
        return objRoot;
    public void initialize()
        setSize(800, 600);
        setLayout(new BorderLayout());
        GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();//default config
        canvas3D = new Canvas3D(config);
        canvas3D.setSize(400, 600);
        add(canvas3D, BorderLayout.WEST); //adding the canvas to the west side of the JFrame
        SimpleUniverse simpleU = new SimpleUniverse( canvas3D );
        JPanel controlPanel = new JPanel();
        controlPanel.setLayout(new BorderLayout());
        controlPanel.setSize(400, 600);
        JLabel label = new JLabel();
        label.setText("I'm the control Panel");
        controlPanel.add(label, BorderLayout.CENTER);
        add(controlPanel, BorderLayout.EAST);
        //Positioning the view
        TransformGroup viewingPlatformGroup = simpleU.getViewingPlatform().getViewPlatformTransform();
        Transform3D t3d = new Transform3D();
        t3d.setTranslation(new Vector3f(0, 0, 3)); //moving back from the cube--> +z
        viewingPlatformGroup.setTransform(t3d);
        canvas3D.getView().setBackClipDistance(300.0d); //sets the visible distance
        canvas3D.getView().setFrontClipDistance(0.1d);
        canvas3D.getView().setMinimumFrameCycleTime(20); //minimum time refresh
        canvas3D.getView().setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY); //rendering order
        BranchGroup scene = createSceneGraph();
        simpleU.addBranchGraph(scene);
        setVisible(true);
}-->Davil

Similar Messages

  • [Haskell]How to read in haskell and solve simple problems

    Hello,
    I'm an experienced C/C++ programmer and I would like to use Haskell to solve some problems.
    But it is hard to me to write a simple way to read input from a file and analyze it, so I ask you how to do this. I didn't find how to do this around google or this forum, that's why I came to here.
    Suppose we are given this problem:
    "We're analyzing numbers and we want to know which numbers are even. The input consists on a number, N, and then N lines which contain a single integer. You are to say what numbers are even."
    INPUT EXAMPLE:
    3
    1234
    5555555
    123044390581349287182
    OUTPUT EXAMPLE:
    yes
    no
    yes
    I wrote the module that returns a string depending on if the number is even or not... But I would like to know how to repeat that function for N numbers. I don't want a superoptimized way or a strange way, I just want a simple and readable one...
    In C++ i would do:
    for (int i = 0; i < cases; i++)
    cin >> number;
    cout << analyze(number) << endl; // analyze returns a string
    Can you iluminate with your knowledge, archers?
    Thank you.

    Well, you said that the first line has the number N, followed by N lines. Given your description the program would always test the whole file.
    If you have a file with X lines and you'd only like to test N <= X  lines, this should do it:
    module Main where
    import System.IO
    import Control.Applicative
    main = do
    let test x = if even (read x) then "yes" else "no"
    withFile "test" ReadMode $ \handle -> do
    nlines <- read <$> hGetLine handle
    content <- hGetContents handle
    mapM_ ( putStrLn . test )
    . take nlines
    . lines
    $ content

  • Problem with JFrame and JPanel

    Okay, well I'm busy doing a lodge management program for a project and I have programmed this JFrame
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class FinalTest extends JFrame
         public JPanel contentPane;
         public JImagePanel imgPanel;
         private JLabel[] cottageIcon;
         private boolean keepMoving;
         private int selectedCottage;
         public FinalTest()
              super();
              initializeComponent();
              addActionListeners();
              this.setVisible(true);
         private void initializeComponent()
              contentPane = (JPanel)getContentPane();
              contentPane.setLayout(null);
              imgPanel = new JImagePanel("back.png");
               imgPanel.setLayout(null);
              imgPanel.setBackground(new Color(1, 0, 0));
                   addComponent(contentPane, imgPanel, 10,10,imgPanel.getImageWidth(),imgPanel.getImageHeight());
              cottageIcon = new JLabel[6];
              keepMoving = true;
              selectedCottage = 0;
              cottageIcon[0] =  new JLabel();
              //This component will never be added or shown, but needs to be there to cover for no cottage selected
              for(int a = 1; a < cottageIcon.length; a++)
                   cottageIcon[a] = new JLabel("C" + (a));
                   cottageIcon[a].setBackground(new Color(255, 0, 0));
                    cottageIcon[a].setHorizontalAlignment(SwingConstants.CENTER);
                    cottageIcon[a].setHorizontalTextPosition(SwingConstants.LEADING);
                    cottageIcon[a].setForeground(new Color(255, 255, 255));
                    cottageIcon[a].setOpaque(true);
                    addComponent(imgPanel,cottageIcon[a],12,(a-1)*35 + 12,30,30);
                this.setTitle("Cottage Chooser");
                this.setLocationRelativeTo(null);
              this.setSize(new Dimension(540, 430));
         private void addActionListeners()
              imgPanel.addMouseListener(new MouseAdapter()
                   public void mousePressed(MouseEvent e)
                        imgPanel_mousePressed(e);
                   public void mouseReleased(MouseEvent e)
                        imgPanel_mouseReleased(e);
                   public void mouseEntered(MouseEvent e)
                        imgPanel_mouseEntered(e);
              imgPanel.addMouseMotionListener(new MouseMotionAdapter()
                   public void mouseDragged(MouseEvent e)
                        imgPanel_mouseDragged(e);
         private void addComponent(Container container,Component c,int x,int y,int width,int height)
              c.setBounds(x,y,width,height);
              container.add(c);
         private void imgPanel_mousePressed(MouseEvent e)
              for(int a = 1; a < cottageIcon.length; a++)
                   if(withinBounds(e.getX(),e.getY(),cottageIcon[a].getBounds()))
                        System.out.println("B" + withinBounds(e.getX(),e.getY(),cottageIcon[a].getBounds()));
                        selectedCottage = a;
                        keepMoving = true;
         private void imgPanel_mouseReleased(MouseEvent e)
              System.out.println("called");
              selectedCottage = 0;
              keepMoving = false;
         private void imgPanel_mouseDragged(MouseEvent e)
               System.out.println("XXX" + Math.random() * 100);
              if(keepMoving)
                   int x = e.getX();
                    int y = e.getY();
                    if(selectedCottage!= 0)
                         cottageIcon[selectedCottage].setBounds(x-(30/2),y-(30/2),30,30);
                    if(!legalBounds(imgPanel,cottageIcon[selectedCottage]))
                        keepMoving = false;
                        cottageIcon[selectedCottage].setBounds(imgPanel.getWidth()/2,imgPanel.getHeight()/2,30,30);
              System.out.println(cottageIcon[selectedCottage].getBounds());
         private void imgPanel_mouseEntered(MouseEvent e)
               System.out.println("entered");
         private void but1_actionPerformed(ActionEvent e)
              String input = JOptionPane.showInputDialog(null,"Enter selected cottage");
              selectedCottage = Integer.parseInt(input) - 1;
         public boolean legalBounds(Component containerComponent, Component subComponent)
              int contWidth = containerComponent.getWidth();
              int contHeight = containerComponent.getHeight();
              int subComponentX = subComponent.getX();
              int subComponentY = subComponent.getY();
              int subComponentWidth = subComponent.getWidth();
              int subComponentHeight = subComponent.getHeight();
              if((subComponentX < 0) || (subComponentY < 0) || (subComponentX > contWidth) || (subComponentY > contHeight))
                   return false;
              return true;
         public boolean withinBounds(int mouseX, int mouseY, Rectangle componentRectangle)
              int componentX = (int)componentRectangle.getX();
              int componentY = (int)componentRectangle.getY();
              int componentHeight = (int)componentRectangle.getHeight();
              int componentWidth = (int)componentRectangle.getWidth();
              if((mouseX >= componentX) && (mouseX <= (componentX + componentWidth)) && (mouseY >= componentY) && (mouseY <= (componentY + componentWidth)))
                   return true;
              return false;
         public static void main(String[] args)
              JFrame.setDefaultLookAndFeelDecorated(true);
              //JDialog.setDefaultLookAndFeelDecorated(true);
              try
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              catch (Exception ex)
                   System.out.println("Failed loading L&F: ");
                   System.out.println(ex);
              FinalTest ft = new FinalTest();
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class JImagePanel extends JPanel
      private Image image;
      public JImagePanel(String imgFileName)
           image = new ImageIcon(imgFileName).getImage();
        setLayout(null);
      public void paintComponent(Graphics g)
        g.drawImage(image, 0, 0, null);
      public Dimension getImageSize()
                Dimension size = new Dimension(image.getWidth(null), image.getHeight(null));
             return size;
      public int getImageWidth()
                int width = image.getWidth(null);
                return width;
      public int getImageHeight()
              int height = image.getHeight(null);
              return height;
    }Now the problem I'm having is changing that class to a JFrame, it seems simple but I keep having problems like when it runs from another JFrame nothing pops up. I can do it like this:
    FinalTest ft = new FinalTest();
    ft.setVisible(false);
    JPanel example = ft.contentPanehowever I will probably be marked down on this for bad code. I'm not asking for the work to be done for me, but I'm really stuck on this and just need some pointers so I can carry on with the project. Thanks,
    Steve

    CeciNEstPasUnProgrammeur wrote:
    I'd actually consider your GUI being a JPanel instead of a JFrame quite good design - makes it easy to put the stuff into an applet when necessary...
    Anyway, you should set setVisible() to true to make it appear, not to false. Otherwise, I don't seem to understand your problem.That is actually my problem. I am trying to convert this JFrame to a JPanel

  • Please a simple problem but I don't know how to solve it. After installing 16 gb of ram all is good but when I turn on the computer it is a window signaling that all is correct. How is possible to delete once and for all that window? Thank you

    Please a simple problem but I don't know how to solve it. After installing 16 gb of ram all is good but when I turn on the computer it is a window signaling that all is correct. How is possible to delete once and for all that window? Thank you

    Well then maybe you could take a screenshot because the appearance of such a window is news to me.
    Also post your OS X version and what model Mac you have. The more detail, the better. Thanks.
    To take a screenshot hold ⌘ Shift 4 to create a selection crosshair. Click and hold while you drag the crosshair over the area you wish to capture and then release the mouse or trackpad. You will hear a "camera shutter" sound. This will deposit a screenshot on your Desktop.
    If you can't find it on your Desktop look in your Documents or Downloads folder.
    When you post your response, click the "camera" icon above the text field:
    This will display a dialog box which enables you to choose the screenshot file (remember it's on your Desktop) and click the Insert Image button.
    ⌘ Shift 4 and then pressing the space bar captures the frontmost window.
    ⌘ Shift 3 captures the entire screen.
    Drag the screenshot to the Trash after you post your reply.

  • I tell her that I'm developing a flash content with as2 and I have a very simple problem, I hope you

    Hello, how are you?
    I tell her that I'm developing a flash content with as2 and I have a very simple problem, I hope you can help me
    I happened to create a movie clip and inside to create a scroll that is two isntancias,
    I mean:
    in the first frame create a button in the 6 to 5 buttons and an action to melleve the sixth frame and another to return. (Elemental truth)
    Now I have a problem. In creating a movie clip instance name to each button and in the average place the next fram as2,
    boton.onRollOver name = function () {
           gotoAndStop ("Scene 1", "eqtiqueta");
    because what I want is that from inside the movie clip, go to the scene proncipal to a frame that is three in the label name.
    however, does not work.
    appreciate your cooperation.
    Escuchar
    Leer fonéticamente
    Diccionario - Ver diccionario detallado

    Hello, I think you need to start a discussion on the Action Script forum. This is the Flash Player forum, the browser plugin.
    Thanks,
    eidnolb

  • Java3d gaming problem *HELP*

    Hi all,
    I am a student completing my dissertation and need some help urgently.
    I have a game that has a main JPanel added to a JFrame and want to add another JPanel to the JFrame which I have done successful.
    The problem is the new JPanel, which is to load an object file, displays nothing.
    Can anyone give me pointers as what i need to do - do i need to have a canvas3d, or transformgroup or something?
    The idea i had in mind was to have this second Jpanel display the life of the user and link to the main JPanel so that if the user got hurt this secondpanel would update to show this.
    Thanks in advance,
    Catheren

    Catheren,
    This was taken from one of the Java 3D examples taken from the SDK. It is used to load an *.obj file. It uses the Canvas3D class.
    *     @(#)ObjLoad.java 1.22 02/10/21 13:46:12
    * Copyright (c) 1996-2002 Sun Microsystems, Inc. All Rights Reserved.
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    * - Redistributions of source code must retain the above copyright
    *   notice, this list of conditions and the following disclaimer.
    * - Redistribution in binary form must reproduce the above copyright
    *   notice, this list of conditions and the following disclaimer in
    *   the documentation and/or other materials provided with the
    *   distribution.
    * Neither the name of Sun Microsystems, Inc. or the names of
    * contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    * This software is provided "AS IS," without a warranty of any
    * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
    * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
    * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
    * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
    * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
    * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
    * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
    * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
    * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
    * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
    * You acknowledge that Software is not designed,licensed or intended
    * for use in the design, construction, operation or maintenance of
    * any nuclear facility.
    import com.sun.j3d.loaders.objectfile.ObjectFile;
    import com.sun.j3d.loaders.ParsingErrorException;
    import com.sun.j3d.loaders.IncorrectFormatException;
    import com.sun.j3d.loaders.Scene;
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import java.io.*;
    import com.sun.j3d.utils.behaviors.vp.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    public class ObjLoad extends Applet {
        private boolean spin = false;
        private boolean noTriangulate = false;
        private boolean noStripify = false;
        private double creaseAngle = 60.0;
        private URL filename = null;
        private SimpleUniverse u;
        private BoundingSphere bounds;
        public BranchGroup createSceneGraph() {
         // Create the root of the branch graph
         BranchGroup objRoot = new BranchGroup();
            // Create a Transformgroup to scale all objects so they
            // appear in the scene.
            TransformGroup objScale = new TransformGroup();
            Transform3D t3d = new Transform3D();
            t3d.setScale(0.7);
            objScale.setTransform(t3d);
            objRoot.addChild(objScale);
         // Create the transform group node and initialize it to the
         // identity.  Enable the TRANSFORM_WRITE capability so that
         // our behavior code can modify it at runtime.  Add it to the
         // root of the subgraph.
         TransformGroup objTrans = new TransformGroup();
         objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
         objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
         objScale.addChild(objTrans);
         int flags = ObjectFile.RESIZE;
         if (!noTriangulate) flags |= ObjectFile.TRIANGULATE;
         if (!noStripify) flags |= ObjectFile.STRIPIFY;
         ObjectFile f = new ObjectFile(flags,
           (float)(creaseAngle * Math.PI / 180.0));
         Scene s = null;
         try {
           s = f.load(filename);
         catch (FileNotFoundException e) {
           System.err.println(e);
           System.exit(1);
         catch (ParsingErrorException e) {
           System.err.println(e);
           System.exit(1);
         catch (IncorrectFormatException e) {
           System.err.println(e);
           System.exit(1);
         objTrans.addChild(s.getSceneGroup());
         bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
            if (spin) {
           Transform3D yAxis = new Transform3D();
           Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,
                               0, 0,
                               4000, 0, 0,
                               0, 0, 0);
           RotationInterpolator rotator =
               new RotationInterpolator(rotationAlpha, objTrans, yAxis,
                               0.0f, (float) Math.PI*2.0f);
           rotator.setSchedulingBounds(bounds);
           objTrans.addChild(rotator);
            // Set up the background
            Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);
            Background bgNode = new Background(bgColor);
            bgNode.setApplicationBounds(bounds);
            objRoot.addChild(bgNode);
         return objRoot;
        private void usage()
          System.out.println(
         "Usage: java ObjLoad [-s] [-n] [-t] [-c degrees] <.obj file>");
          System.out.println("  -s Spin (no user interaction)");
          System.out.println("  -n No triangulation");
          System.out.println("  -t No stripification");
          System.out.println(
         "  -c Set crease angle for normal generation (default is 60 without");
          System.out.println(
         "     smoothing group info, otherwise 180 within smoothing groups)");
          System.exit(0);
        } // End of usage
        public void init() {
         if (filename == null) {
                // Applet
                try {
                    URL path = getCodeBase();
                    filename = new URL(path.toString() + "./galleon.obj");
                catch (MalformedURLException e) {
               System.err.println(e);
               System.exit(1);
         setLayout(new BorderLayout());
            GraphicsConfiguration config =
               SimpleUniverse.getPreferredConfiguration();
            Canvas3D c = new Canvas3D(config);
         add("Center", c);
         // Create a simple scene and attach it to the virtual universe
         BranchGroup scene = createSceneGraph();
         u = new SimpleUniverse(c);
         // add mouse behaviors to the ViewingPlatform
         ViewingPlatform viewingPlatform = u.getViewingPlatform();
         PlatformGeometry pg = new PlatformGeometry();
         // Set up the ambient light
         Color3f ambientColor = new Color3f(0.1f, 0.1f, 0.1f);
         AmbientLight ambientLightNode = new AmbientLight(ambientColor);
         ambientLightNode.setInfluencingBounds(bounds);
         pg.addChild(ambientLightNode);
         // Set up the directional lights
         Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f);
         Vector3f light1Direction  = new Vector3f(1.0f, 1.0f, 1.0f);
         Color3f light2Color = new Color3f(1.0f, 1.0f, 1.0f);
         Vector3f light2Direction  = new Vector3f(-1.0f, -1.0f, -1.0f);
         DirectionalLight light1
             = new DirectionalLight(light1Color, light1Direction);
         light1.setInfluencingBounds(bounds);
         pg.addChild(light1);
         DirectionalLight light2
             = new DirectionalLight(light2Color, light2Direction);
         light2.setInfluencingBounds(bounds);
         pg.addChild(light2);
         viewingPlatform.setPlatformGeometry( pg );
         // This will move the ViewPlatform back a bit so the
         // objects in the scene can be viewed.
         viewingPlatform.setNominalViewingTransform();
         if (!spin) {
                OrbitBehavior orbit = new OrbitBehavior(c,
                                      OrbitBehavior.REVERSE_ALL);
                BoundingSphere bounds =
                    new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);
                orbit.setSchedulingBounds(bounds);
                viewingPlatform.setViewPlatformBehavior(orbit);        
         u.addBranchGraph(scene);
        // Caled if running as a program
        public ObjLoad(String[] args) {
          if (args.length != 0) {
         for (int i = 0 ; i < args.length ; i++) {
           if (args.startsWith("-")) {
         if (args[i].equals("-s")) {
         spin = true;
         } else if (args[i].equals("-n")) {
         noTriangulate = true;
         } else if (args[i].equals("-t")) {
         noStripify = true;
         } else if (args[i].equals("-c")) {
         if (i < args.length - 1) {
              creaseAngle = (new Double(args[++i])).doubleValue();
         } else usage();
         } else {
         usage();
         } else {
         try {
         if ((args[i].indexOf("file:") == 0) ||
              (args[i].indexOf("http") == 0)) {
              filename = new URL(args[i]);
         else if (args[i].charAt(0) != '/') {
              filename = new URL("file:./" + args[i]);
         else {
              filename = new URL("file:" + args[i]);
         catch (MalformedURLException e) {
         System.err.println(e);
         System.exit(1);
    // Running as an applet
    public ObjLoad() {
    public void destroy() {
         u.cleanup();
    // The following allows ObjLoad to be run as an application
    // as well as an applet
    public static void main(String[] args) {
    new MainFrame(new ObjLoad(args), 700, 700);

  • A720 and windows 8 problems

    Im trying to setup the a720  with windows 8 and have this problems: When power off the computer have all time this BSOD : SESSION_HAS_VALID_POOL_ON_EXIT Touchscreen not work.
    If I run the windows 8 install, just for test, the touch is working, the problem is after install.
    External hard disk not working when connect to any USB port, and unplug result in a system freeze.
    Here my mini dump for error SESSION_HAS_VALID_POOL_ON_EXIT, I have the i5 model too and this not happen on that model:
    Crash Dump Analysis provided by OSR Open Systems Resources, Inc. (http://www.osr.com) Online Crash Dump Analysis Service See http://www.osronline.com for more information Windows 8 Kernel Version 9200 MP (8 procs) Free x64 Product: WinNt, suite: TerminalServer SingleUserTS Built by: 9200.16384.amd64fre.win8_rtm.120725-1247 Machine Name: Kernel base = 0xfffff800`60081000 PsLoadedModuleList = 0xfffff800`6034ba60 Debug session time: Wed Nov 28 17:08:03.203 2012 (UTC - 5:00) System Uptime: 0 days 0:00:13.897 ******************************************************************************* *                                                                             * *                        Bugcheck Analysis                                    * *                                                                             * *******************************************************************************
    SESSION_HAS_VALID_POOL_ON_EXIT (ab) Caused by a session driver not freeing its pool allocations prior to a session unload.  This indicates a bug in win32k.sys, atmfd.dll, rdpdd.dll or a video driver. Arguments: Arg1: 0000000000000001, session ID Arg2: 00000000000000f0, number of paged pool bytes that are leaking Arg3: 0000000000000000, number of nonpaged pool bytes that are leaking Arg4: 0000000000000001, total number of paged and nonpaged allocations that are leaking. nonpaged allocations are in the upper half of this word, paged allocations are in the lower half of this word.
    Debugging Details: ------------------
    TRIAGER: Could not open triage file : e:\dump_analysis\program\triage\modclass.ini, error 2
    CUSTOMER_CRASH_COUNT:  1
    DEFAULT_BUCKET_ID:  WIN8_DRIVER_FAULT
    BUGCHECK_STR:  0xAB
    PROCESS_NAME:  csrss.exe
    CURRENT_IRQL:  0
    LAST_CONTROL_TRANSFER:  from fffff80060680506 to fffff800600fc040
    STACK_TEXT:  fffff880`05d059b8 fffff800`60680506 : 00000000`000000ab 00000000`00000001 00000000`000000f0 00000000`00000000 : nt!KeBugCheckEx fffff880`05d059c0 fffff800`603e8bb5 : fffff880`04983b40 00000000`00000000 fffff880`04983000 ffffffff`ffffffe6 : nt! ?? ::NNGAKEGL::`string'+0x36216 fffff880`05d05a10 fffff800`604a48b6 : 00000000`00000372 fffff880`04983000 fffffa80`090203c0 fffffa80`08fc4540 : nt!MiDereferenceSessionFinal+0xf1 fffff880`05d05a80 fffff800`604abe68 : fffff8a0`00142b00 00000000`00000000 00000000`00000001 00000000`00000001 : nt!MmCleanProcessAddressSpace+0x2be fffff880`05d05af0 fffff800`604ac55e : fffffa80`00000000 00000002`00000001 00000000`00000000 fffff8a0`00d0b8f0 : nt!PspExitThread+0x668 fffff880`05d05c10 fffff800`600e1dd6 : fffff800`60377180 00000000`00000080 fffffa80`090203c0 fffffa80`08fc4540 : nt!PspTerminateThreadByPointer+0x4e fffff880`05d05c60 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : nt!KiStartSystemThread+0x16
    STACK_COMMAND:  kb
    FOLLOWUP_IP: nt! ?? ::NNGAKEGL::`string'+36216 fffff800`60680506 cc              int     3
    SYMBOL_STACK_INDEX:  1
    SYMBOL_NAME:  nt! ?? ::NNGAKEGL::`string'+36216
    FOLLOWUP_NAME:  MachineOwner
    MODULE_NAME: nt
    IMAGE_NAME:  ntkrnlmp.exe
    DEBUG_FLR_IMAGE_TIMESTAMP:  5010ac4b
    FAILURE_BUCKET_ID:  X64_0xAB_nt!_??_::NNGAKEGL::_string_+36216
    BUCKET_ID:  X64_0xAB_nt!_??_::NNGAKEGL::_string_+36216
    Followup: MachineOwner ---------

    Ok, the problem is generated by NVIDIA VIDEO DRIVER!
    Honesty I cant understand why LENOVO not choose for this machines a ivibridge CPU with HD4000 VIDEO, performance is similar, and Intel VIDEOS GPU, have 0 troubles, ATI AND NVIDIA always are very problematic.
    Anyway the solution is simple:
    1 Turn OFF windows update, or change to selective install.
    This prevent win update install NVIDIA driver in automatic way.
    2 Uninstall NVIDIA driver sand NVIDIA related stuff.
    3 Restart the machine, NOT POWER OFF, just restart.
    4 Now go to SYSTEM PROPERTIES > HARDWARE > DEVICE MANAGER
    INSIDE DISPLAY ADPATER NOW SELECT DISABLE THE DEFAULT VGA DRIVER, NOR UNINSTALL CHOOSE DISABLE!
    NOW RESTART.
    After restart now touchscreen work correctly, and next time you power off the machine, not have that ugly error all time.
    This not is a final solution is just a workaround until LENOVO/NVIDIA provide a final fix for this.

  • Animated gif and page refresh problem

    Animated gif and page refresh problem
    Hi There,
    I'm trying to build a simple "Please wait......" screen using jsp and javascript.
    So far all is going well except that my animatate gif keeps refreshing everything the page is refresh.
    Is there a way the i can prevent the body of the page from refreshing?
    below is my sample code:
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <jsp:useBean id="StatusBean" class="com1.CandidateRelease" scope="session"/>
    <html>
    <script LANGUAGE="JavaScript">
    function refresh()
    <% if (StatusBean.isRunning()) { %>     
         //setTimeout("refresh()", 1000);
         setTimeout("location='status.jsf'", 1000);
    <% }else{%>
         window.location= "busStopAdmin.jsf";
    <%} %>
    </script>
    <head>
         <script LANGUAGE="JavaScript">     
              refresh();
         </script>     
    </head>
    <body>
         <img id="myImage" src="../img/ojp_wait.gif" alt="" width="151" height="36">
    </body>
    </html>

    Animated gif and page refresh problem
    Hi There,
    I'm trying to build a simple "Please wait......" screen using jsp and javascript.
    So far all is going well except that my animatate gif keeps refreshing everything the page is refresh.
    Is there a way the i can prevent the body of the page from refreshing?
    below is my sample code:
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <jsp:useBean id="StatusBean" class="com1.CandidateRelease" scope="session"/>
    <html>
    <script LANGUAGE="JavaScript">
    function refresh()
    <% if (StatusBean.isRunning()) { %>     
         //setTimeout("refresh()", 1000);
         setTimeout("location='status.jsf'", 1000);
    <% }else{%>
         window.location= "busStopAdmin.jsf";
    <%} %>
    </script>
    <head>
         <script LANGUAGE="JavaScript">     
              refresh();
         </script>     
    </head>
    <body>
         <img id="myImage" src="../img/ojp_wait.gif" alt="" width="151" height="36">
    </body>
    </html>

  • Hello  Simple problem - don,t know how to solve it.  With Premiere CC when I try to do a selection (click... drag... release the click) very often it stop way before the end of the move I'm swinging the Magic Mouse. I taught that the mouse clicking was de

    Hello
    Simple problem - don,t know how to solve it.
    With Premiere CC when I try to do a selection (click... drag... release the click) very often it stop way before the end of the move I'm swinging the Magic Mouse. I taught that the mouse clicking was defective and went to get a new Magic Mouse after lots of frustration. Today, I have an edit to do it it does the SAME thing !!
    I was like ????#$%?&*(???
    Opened all the lights and taught I've trow the new mouse to the garbage and was using the defective mouse again... no !! - ??
    Actually, the bran new mouse is doing the same thing. What I understand after investigating on the motion and watching carefully my fingers !! -  is that when I click I have to keep my finger at the EXACT same place on the mouse... drag and release and it's fine. If I click by pushing on the mouse and my finder is moving of a 1/32th of a millimeter, it will release and my selection will be to redo. You can understand my frustration ! - 75$ later... same problem, but I know that if I click with about 5 pounds of pressure and trying to pass my finger through the plastic of the mouse, it you stay steady and make it !
    The problem is that scrolling is enable while clicking and it bugs.
    How to disable it ??
    Simple question - can't find the answer !

    Helllooo !?
    sorry but the Magic Mouse is just useless with the new Adobe Premiere CC and since I'm not the only one but can't find answer this is really disappointing. This mouse is just fantastic and now I have to swap from a USB mouse to the Magic Mouse every times I do some editing. My USB mouse if hurting my hand somehow and I want to got back to the Magic Mouse asap. Please - for sure there is a simple solution !
    Thanks !!

  • Very Simple Problem-- Need help in method selection process

    Hello,
    It's difficult to explain the background of the program I am making-- but I am stuck at a very simple problem, that I can only solve with a very long block of if statements:
    I have 3 possible numbers-- 1, 2, or 3.
    Imagine two numbers are already taken-- say 1 and 2. I want a variable to set itself to the number that's not taken (3).
    So, again: If two numbers were taken say 2 or 3-- I want the variable to be sent to the other one that isn't taken-- 1.
    Thank you for your help,
    Evan.

    Actually, I'll just tell you the context of the program-- here is what I have so far:
    This program is meant to simulate Monty Hall Problem:
    http://en.wikipedia.org/wiki/Monty_Hall_problem
    The program sets up an array of three possible values. Each one of those values represents a door with either a goat or a car behind it. It then randomly sets one of those values to 1 (in order to represent a car as per the Monty Hall problem), and 0's represent goats.
    The user, which is simulated by the program (does not involve actual interaction), chooses a door initially.
    The game show hosts then reveals a door that is not the users initial choice, but IS a goat ( an array value of 0).
    For example if the array was [0][0][1]
    The user could pick door one (array position 0). Which is a goat.
    The game show host then reveals a goat that is not the users choice-- which would be array position 1.
    After the game show host reveals the goat-- I want the user to always switch his decision to the only other remaining door that was not his first choice.
    Then I wanted the computer to test to see if his final choice is the one with a car. And to tally up the amount of times he got it right.
    --Sorry that was long winded:
    import TerminalIO.*;//imports TerminalIO package for system.out.println
    import java.util.*;//import java.util for random
    public class Monty_Problem
         int doors[]= {0,0,0};
         Random rand= new Random();
         double wins,totals=0;
         public void carAssignment()
              int car_door= rand.nextInt(3);
              doors[car_door]=1;
         public int judgesChoice(int judgeDoor, int initialChoice)
              if(judgeDoor != initialChoice && doors[judgeDoor]!=1)
                   return judgeDoor;
              else
                   return judgesChoice(rand.nextInt(3), initialChoice); //infinite loop right here that I cannot remedy.  I want the program to have the judge pick a location that is not occupied by a  '1' and is not the user's choice. 
         public void gamePlaySwitches()
              int initialChoice= rand.nextInt(3);
              int judgeDoor = 0;
              int secondChoice= 0;
              judgeDoor= judgesChoice(rand.nextInt(3), initialChoice);
              //This part is meant to have the user switch choices from his initial choice
                   // to the only other choice that hasn't been revealed by the judge. 
              while(secondChoice == initialChoice || secondChoice== judgeDoor)
                   secondChoice++;
              if(doors[secondChoice]==1)
                   wins++;
                   totals++;
              else
                   totals++;          
         public static void main(String [] args)//creates the main menu
              Monty_Problem a= new Monty_Problem();
              int games=0;
              while(games!=100)
                        a.carAssignment();
                        a.gamePlaySwitches();
                        games++;
              System.out.println(a.wins/a.totals);
    }Edited by: EvanD on Jan 11, 2008 4:17 PM

  • A Simple problem I`m sure BUT ITS DRIViNG ME CRAAAZY!

    Hello,
    I hope someone can help.
    I published a site with the first podcst episode using iweb.It went through onto iTunes bo problem so all`s good... so today I put together the 2nd episode, submit it to itunes as before...up comes the `..please provide the link to the podcast RSS feed ...' etc
    Podcast Feed URL:http://rss.mac.com/jubemeg/iWeb/Bandwagon/podcast/rss.xml is the address I`m given as with the first episode, I press continue and ....Unfortunatly THE FEED HAS ALREADY BEEN SUBMITTED.Course it has! Help!
    I have looked through the tech specs and I cant make head nor tail of it can someone help me in real basic layman language!
    Thank you,
    Jules

    Jules, it's a simple problem with a simple fix. (and it drove me nuts too)
    Publish to .Mac (or your server if it's different)... then PING itunes to let them know to go look for new content on your server (or .Mac). You PING iTunes by cutting and pasting the url addy below into safari and clicking return. You'll get an error message, don't worry, it's supposed to happen. About an hour later, maybe a bit longer, your new episode will be available.
    DONT submit your podcast by selecting the "SUBMIT PODCAST TO ITUNES" menu selection again. That command is for your first submission, not your subsequent ones. Think of your podcast as a book. And each episode is a chapter. When you ping iTunes, they go get the whereabouts of the new chapter and make it available for the world to come and read, hear, or watch.
    the PING url is...
    https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=INSERTYOURFE EDIDHERE
    Your feed ID number is in your original email from the itunes folks when they sent you your acceptance email and said that your podcast was now up and running on the ITMS.
    Hope this helps.
    Jim
    20" Imac 1ghz (lmpstd), Mini, G4 Dual 1.8(upgraded), G4 400, Powerbook,12", eMac   Mac OS X (10.4.4)  

  • A simple problem in j2sdk

    I am in a great problem with a very simple problem. I am new to J2EE. I had installed j2sdk1.4.0_03 / tomcat 4.1 in windows 2000. my problem is that the servlets are not being compiled. The error is " package javax.servlet is not found". error are also there in all the classes of this packege like in HttpServletResponse, HttpServletRequest etc.
    The classpath are correct. One of my friend is working with the same version and with the same classpath but in Windows XP..
    can anyone tell me why this is happening. and how to overcome this. PLEASE...............

    Add the jar that contains the javax.servlet package to your javac classpath using the -classpath option. Not sure why your CLASSPATH isn't working maybe youi have some invalid characters or directories with spaces that aren't quoted etc... I believe the servlet APIs are in servlet-api.jar, or at least they are in 5.0. Also please searxh the forums in the future this is a pretty typical question and has been answered numerous times.

  • A simple problem to solve... I hope.

    $A simple problem to solve... I hope. Hi Guys,
    This is my first post on this forum, and I'm hoping that the problem I'm encountering at the moment is down to my own stupidity rather than technical issues.
    Firstly, I should mention that I have used my X-fi sound blaster xtreme audio card for months now in my old PC which was running XP 32 bit with no problems whatsoever. In the last day I've built a new PC which has the following specs:
    Intel I7 860
    tb HDD
    4gb Ram
    Windows 7 Ultimate 64
    Nvidia GTX280
    Sound was very quiet and of a fairly poor quality to begin with, and I soon realised that I hadn't installed any drivers for the soundcard, so I went ahead and did so. Following this, I enter a **bleep**storm of illogical proportions which to me makes absolutely no sense.
    I get no sound from my speakers or headphones whatsoever. I have a pair of M-Audio AV-40 monitors at the moment, and no matter what I try, I can't get sound to work. When I go to the mixer, it seems odd to me
    http://yfrog.com/7fxfiproblemj
    I thought that there would be options for Line Outs etc, but I may be wrong.
    I've run the diagnostic tests and everything comes back absolutely fine.
    The weirdest thing however is the fact that when I test the speaker configuration, it responds to nothing except from the 7. surround sound, and my speakers react to the bottom left and bottom right speakers. I've tried installing, re-installing drivers no end. Looked for fixes and checked google as well and found nothing that matches the description of my problem.
    Am I missing out on something really obvious here? Or is there a more technical underlying factor ?behind this issue.
    Any help is hugely appreciated, thanks?

    Thanks for all of you help, but I still don't think the problem's solved.
    Here's the problem explained more thouroloy. I have a java program that uses lots of jar files. That means that to run my program, I need to have the CLASSPATH set to pick up all of these jar files. I'd also like to be able to give someone a copy of this program on a cd and have them immediately run it without having to assume anything about their configuration (except that they have java installed).
    So what I did was create a batch file that (at least temporarily) sets up the CLASSPATH to meet my needs. It then calls "java myProgram <all the other parms...>".
    Things run fine, except that the command window that gets opened up stays around while Swing program runs, and doesn't close until I close the Swing program. I'd like that that didn't happen.
    -- echo off
    Not going to do anything to help. It will stop the batch commands from echoing, but that's about it.
    -- javaw
    I tried this and it also doesn't work. It seems that neither java nor javaw return until after the program that it is running actually end.
    -- Executable jar
    Sounds promising, but will it work? How do I make sure the CLASSPATH is properly set before running this?
    Thanks again for all of your hlep.
    Sander Smith

  • Enlarge JFrame and its components properties  proportionally

    Hi,
    We have a simple JFrame � Container - uses Flow Layout and has got Buttons, Text Fields� All of them are using Java�s default fonts, sizes..�
    And we want to increase or enlarge all of the JFrame and its sub components properties proportionally (especially Font�.) like in for example MS-Word.
    In the Ms-Word, there is ZOOM option in the Standard tool bar menu. If you set zoom to 150%, the font is automatically increases. And if you set it to 100% the font sets back to normal. And if the window is not enough to fit, it adds the scroll bars.
    For example, if we increase the Labels Font, the height of that component also should increase proportionally. So the Frame also should increase.
    How could we achieve this sort of functionality ( i.e. Proportionally increasing the component�s properties ) in Swing?
    I believe it is hard to set/adjust the all of the Frame�s components properties (I.e. Height, Font�) proportionally by using the Component listeners.
    (Another example, you might have noticed that the Frame�s Font, hight,width �sizes are proportionally bigger in Systems screen�s 800 by 600 pixels mode compare with 1024 by 768 pixels mode. May be this is windows feature. But we are looking at achieving the same sort of feature)
    Any help or thoughts would be appreciated.
    Thanks in advance.
    Vally.

    Here is a working sample:
    package ui_graphics;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.LayoutManager;
    import java.util.Arrays;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JSpinner;
    import javax.swing.SpinnerListModel;
    import javax.swing.SpinnerModel;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class ZoomableFrameTest {
       private ZoomablePanel zoomPanel;
       private JLabel label;
       public ZoomableFrameTest() {
          label = new JLabel("Essai pour le zoom");
          label.setBounds(0,0,200,16);
          zoomPanel = new ZoomablePanel();
          zoomPanel.add(label);
          JFrame frame= new JFrame("Zoom test");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.getContentPane().add(getZoomSpinner(), BorderLayout.NORTH);
          frame.getContentPane().add(zoomPanel, BorderLayout.CENTER);
          frame.pack();
          frame.setVisible(true);
       public static void main(String[] args) {
          new ZoomableFrameTest();
       public JSpinner getZoomSpinner() {
          String[] zoomValues = { "50", "100", "150" };
          SpinnerModel model = new SpinnerListModel(Arrays.asList(zoomValues));
          final JSpinner spZoom = new JSpinner(model);
          Dimension dim = new Dimension(60, 22);
          spZoom.setMinimumSize(dim);
          spZoom.setPreferredSize(dim);
          spZoom.setMaximumSize(dim);
          spZoom.setFocusable(false);
          spZoom.addChangeListener(new ChangeListener() {
             public void stateChanged(ChangeEvent e) {
                // R�cup�re le facteur d'�chelle
                int factor = Integer.parseInt((String)spZoom.getValue());
                setScaleFactor(factor);
          spZoom.setValue("100");
          return spZoom;
       private void setScaleFactor(int factor) {
          zoomPanel.setZoomFactor(factor);
    class ZoomablePanel extends JPanel {
       private int zoomFactor;
       public ZoomablePanel() {
          super(null);
       public void setZoomFactor(int factor) {
          this.zoomFactor = factor;
          if (this.isShowing()) this.repaint();
       public void paint(Graphics g) {
          super.paintComponent(g);
          double d = zoomFactor / 100d;
          Graphics2D g2 =(Graphics2D)g;
          g2.scale(d, d);
          super.paint(g2);
    }

  • SetInterval and XML Load Problem

    Hello,
    I 'm having the simple problem of making sure the XML is
    loaded before beginning the Interval sequence. Therefore it is
    missing some of the XML data when loading. See example:
    http://alt.coxnewsweb.com/statesman/img/advertising/_jacob/Site1/products.html
    I tried a success boolean with the XML onLoad Handler, but my
    setInterval stopped working. I could easily just not know how to
    properly implement XML onLoad.
    Can someone help me out with properly loading the XML
    document before the setInterval is initiated.
    Thank You - Jacob
    Here is the Working Code of the example given...
    //New XML Object
    var mydata:XML = new XML();
    //ignores formatting of XML files tabs, returns, ect.
    mydata.ignoreWhite = true;
    //Setup onLoad Function
    mydata.onLoad = loadXML;
    //Loads actual XML Data File
    mydata.load("data.xml");
    //setInerval Vars
    var intervalId:Number;
    var count:Number = 1;
    var maxCount:Number = 20;
    var duration:Number = 100;
    //Thumbnail Position Vars
    var originalx:Number = 20;
    var originaly:Number = 55;
    currentx = originalx;
    currenty = originaly;
    var i:Number = 0;
    //Create Thumbnails Interval
    function thumbInterval():Void {
    //trace(i);
    //Controls # of Thumbnails per line
    if ((i % 5 == 0) && (i > 0)) {
    currenty += 125;
    currentx=originalx;
    //Attatch Library MC
    _root.attachMovie("thumbnailMC", "thumbnailMC" + i, 1000 +
    i);
    //Load Image, text, and position
    _root["thumbnailMC" + i].thumbnailname =
    mydata.firstChild.childNodes
    .childNodes[0].firstChild.nodeValue;
    _root["thumbnailMC" + i].textbox.productdescr =
    mydata.firstChild.childNodes.childNodes[1].firstChild.nodeValue;
    _root["thumbnailMC" + i]._x = currentx;
    _root["thumbnailMC" + i]._y = currenty;
    currentx += 130;
    i++
    if(count >= maxCount) {
    clearInterval(intervalId);
    count++;
    intervalId = setInterval(this, "thumbInterval",
    duration);

    Please use the attach code option to post your code. bracket
    i bracket is seen as italic by this forum.
    And where is the loadXML function?
    The xml is loaded when the onLoad event gets fired. Your
    loadXML() is the place where you want to call a function that
    initiates the interval.

Maybe you are looking for