Buttons having shape of Sector

I want to draw three Buttons of Sector shape and arrange them in form of a circle.
Sector angle must be 120 degree for all the three Buttons.Please help!

...hm, okay, i put something together... keep in mind it's pretty late... and maybe i should have let that last bottle of wine be, but anyway, perhaps this will help:
public class TestFrame extends JFrame {
    private JPanel _cPane;
    private Ellipse2D _oval=new Ellipse2D.Double(40,40,100,100);
    int[] xs={90,90,133,140,140};
    int[] ys={40,90,115,115,40};
    private Area _sector1=new Area(new Polygon(new int[]{90,90,133,140,140}, new int[]{40,90,115,115,40}, 5));
    private Area _sector2=new Area(new Polygon(new int[]{90,90,47,40,40}, new int[]{40,90,115,115,40}, 5));
    private Area _sector3=new Area(new Polygon(new int[]{40,47,90,133,140}, new int[]{140,115,90,115,140}, 5));
    private int _inside=0;
    public static void main(String[] args) {
        new TestFrame();
    public TestFrame() {
        super();
        init();
        initFrame();
    private void init() {
        Area rhs = new Area(_oval);
        _sector1.intersect(rhs);
        _sector2.intersect(rhs);
        _sector3.intersect(rhs);
        _cPane=new JPanel(){
            public void paint(Graphics g) {
                super.paint(g);
                Graphics2D g2=(Graphics2D)g;
                g2.setColor(Color.RED);
                g2.fill(_oval);
                g2.setColor(Color.BLUE);
                g2.draw(_sector1);
                g2.draw(_sector2);
                g2.draw(_sector3);
                g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.5f));
                g2.setColor(Color.yellow);
                if (_inside==1)
                    g2.fill(_sector1);
                else if (_inside==2)
                    g2.fill(_sector2);
                else if (_inside==3)
                    g2.fill(_sector3);
        _cPane.addMouseMotionListener(new MouseMotionAdapter(){
            public void mouseMoved(MouseEvent e) {
                Point point = e.getPoint();
                if (_sector1.contains(point))
                    _inside=1;
                else if (_sector2.contains(point))
                    _inside=2;
                else if (_sector3.contains(point))
                    _inside=3;
                else _inside=0;
                repaint();
    private void initFrame() {
        setSize(200, 200);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - getWidth()) / 2, (screenSize.height - getHeight()) / 2);
        setContentPane(_cPane);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}It's not as bad as it seem, although i hardcoded the coordinates (you should not, but as i said, it's pretty late already). The example above will highlight a sector as soon as you move your mouse above it - i guess you won't have trouble handling a click accordingly, i just thought this would be a bit more visible.

Similar Messages

  • IPhone 5 on off button having problem

    my iPhone 5 on off button having problem which sometimes i have to press several times, and sometimes i have to press it hard. Did anyone having the same problem here? beacause i just use for 5 months

    Take a Visit to an Apple Store or AASP (Authorized Apple Service Provider) and have the Device evaluated...
    Be sure to make an appointment first...

  • Volume buttons having problems now

    I have a macbook which has been bootcamped to have Vista on it, right?
    So I was fooling around with buttons trying to figure out what the right click function was.
    I googled it, and got a few different things, so i tried them all.
    And a few of the ideas had to do with pushing F10 - F12, which are the volume buttons on a macbook.
    Now, everytime I touch one of the volume buttons, it does not go up one by one with the little white square. Instead, it goes up a bunch of squares, and half of them are like grey or black, and the white one goes to a different spot each time. It's really bothersome, so please help me if you can..

    The photos showing the incorrect orientation after being transferred to your computer is not an iOS problem. This is a Windoze problem. The photo viewing app included with Windoze ignores or doesn't recognize the photo orientation data included with the photo's EXIF data with iOS devices.
    Try using a photo viewing app by a 3rd party that doesn't ignore this.

  • Is there any way to make toolbar buttons in Firefox 8 look as they did in Firefox 7, with each toolbar button having a "frame" around the icon and text?

    Just like to know if this is something I can adjust in about:config or if this UI setting is gone for good.

    You used the data.  Verizon can not see what it was sued for.  However your phone can see whats apps used the data.  go to settings-data usage- there will be a place that says data usage cycle.  line the dates up with your cycle.  then there will be a bar graph below that   extend bother white bars one all the way to the left and one all the way to the right.  after those are extended below that will be a list of apps,  there should be one that used over 2 gb and that will show you what app used that data in her purse

  • Shape button not working in preview made

    Hi
    I am working on captivate 8 responsive project. I have created button using shape.
    But when I publish for preview mode in Mozilla latest browser and  found that all slide content disappear.
    Also checked with sample responsive project in captivate 8. I found same issue.
    Please help me in it.
    Thanks and Regards,
    Manish

    Smart Shape buttons do not work in Firefox i'm afraid, it will leave the whole slide blank. We've had a good look at trying to find a fix/hack but unfortunately it looks like something Adobe and/or Mozilla need to sort out.

  • Set a tooltip for a shape, not a button

    Hi everybody,
    Hope you are all ok wherever you are :)
    I have this little problem guys; I want to set a tooltip button in my application but the problem is that i'm not using buttons but shapes instead, in which shapes i've added mouse click handle code.
    I need when the mouse goes over these shapes-buttons i have, some tooltip text to be displayed. I've tried to create a rectangle and display the small text i want into that rectangle and then call repaint for restoring the program to the previous state before the tooltip display, but unfortunately it is too slow.
    Can you please help me out of that? Can you give a way of setting tooltips for shapes instead of buttons?
    Any help would be appreciated.
    Thanks,
    -John

    Your trying to set a tooltip for a given area on some JComponent defined by a Shape which holds the points that make up the border of the Shape, like GeneralPath or something like that? Is that what you mean? I'm not sure but I think you can use Shape.contains(Point2D ...) without actually have drawn the Shape, so that you can test where the mouse is on your JComponent, then check contains to see if a tooltip needs to be displayed. You'll have to write your own tooltip frame that's not dependent on a JComponent, but thats fairly straightforward. Don't know if this is any help to you, but its a possibility.
    Tom
    ioannisc: the OP talks about the use of Shape's, where did subclasses of JComponent come into it?!

  • Rotate dragged shape on button click

    Hi guys,
    I need help here. I want to do a drawing application where user can resize and rotate a shape. I have created a shape which I can drag around but how to make it rotate upon clicking on button?? Let say when I select the shape and click on 'rotate' button my shape will be rotate by 90 degree. After that the rotated shape can still be drag. Any help would be appreciated.

    Hi Darryl.Burke,
    Thanks for your reply, yes I use AffineTransform methods to rotate the shape. Is there any different with other rotation method?? Ok when I use setToRotation, the shape indeed rotate to the correct position but when I click the shape return back to its original and other weird things happen. Below is the code. Can you please point out the part that I done it wrong please. Thanks.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.util.Vector;
    import javax.swing.border.CompoundBorder;
    import java.io.*;
    public class RotateShape
         private static void createAndShowGUI() {
            //Create and set up the window.
           JFrame.setDefaultLookAndFeelDecorated(true);      
           Viewer frame = new Viewer();
           frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           frame.setVisible(true);
        public static void main(String[] args)
             javax.swing.SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                   createAndShowGUI();
    class Viewer extends JFrame implements ActionListener
         JMenuBar menuBar;
         drawRect buildDesign;
        public Viewer()
           Toolkit kit = Toolkit.getDefaultToolkit();
            Dimension screenSize = kit.getScreenSize();
            int screenHeight = screenSize.height;
            int screenWidth = screenSize.width;
            // center frame in screen
              setSize(700, 600);
              setLocation(screenWidth / 4, screenHeight / 4);
              setResizable(false);
            buildDesign = new drawRect();
            buildDesign.setBorder(BorderFactory.createEmptyBorder(0, 2, 3, 3));
            JTabbedPane tabbed = new JTabbedPane();
            tabbed.addTab("Design", buildDesign);
            //tabbed.addTab("Viewer", buildViewer());
            tabbed.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6),
                                                tabbed.getBorder()));
            //------------------------End of Tabbed Pane----------------------------------------------------//
          JPanel pane = new JPanel();
          Button rectButton = new Button("Rect");
          rectButton.addActionListener(this);
          pane.add(rectButton);
          Button deleteButton = new Button("Delete");
          deleteButton.addActionListener(this);
          pane.add(deleteButton);
          Button rotateButton = new Button("Rotate");
          rotateButton.addActionListener(this);
          pane.add(rotateButton);
          JScrollPane scroller = new JScrollPane(pane);
          scroller.setOpaque(false);
          scroller.getViewport().setOpaque(false);
          scroller.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6),
                                                  scroller.getBorder()));
               //------------------------End of Build Item list----------------------------------------------//
          JPanel content = new JPanel(new BorderLayout());
          content.setOpaque(false);
          content.add(tabbed, BorderLayout.CENTER);
          content.add(scroller, BorderLayout.WEST);
          add (content, BorderLayout.CENTER);
          //------------------------End of add content----------------------------------------------//
              public void actionPerformed(ActionEvent evt) {
               // Respond to a command from one of the window's menu.
          String command = evt.getActionCommand();
          if (command.equals("Rect"))
             buildDesign.addShape(new RectShape());
          else if (command.equals("Delete"))
             buildDesign.delete();
          else if (command.equals("Rotate"))
             buildDesign.rotate();
    class drawRect extends JPanel implements ActionListener, MouseListener, MouseMotionListener
             Image offScreenCanvas = null;   // off-screen image used for double buffering
                 Graphics offScreenGraphics;     // graphics context for drawing to offScreenCanvas
                 Vector shapes = new Vector();   // holds a list of the shapes that are displayed on the canvas
                 Color currentColor = Color.black; // current color; when a shape is created, this is its color
                 float alpha;
            drawRect() {
            // Constructor: set background color to white set up listeners to respond to mouse actions
          setBackground(Color.white);
          addMouseListener(this);
          addMouseMotionListener(this);
       synchronized public void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D) g;
            // In the paint method, everything is drawn to an off-screen canvas, and then
            // that canvas is copied onto the screen.
          g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
          g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
          makeOffScreenCanvas();
          g2.drawImage(offScreenCanvas,0,0,this); 
          AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OUT,alpha);
              g2.setComposite(composite);
          g2.setColor(Color.GRAY);
          drawGrid(g, 20); 
       public void update(Graphics g) {
            // Update method is called when canvas is to be redrawn.
            // Just call the paint method.
          super.paintComponent(g);
       void makeOffScreenCanvas() {
             // Erase the off-screen canvas and redraw all the shapes in the list.
             // (First, if canvas has not yet been created, then create it.)
          if (offScreenCanvas == null) {
             offScreenCanvas = createImage(getSize().width,getSize().height);
             offScreenGraphics = offScreenCanvas.getGraphics();
          offScreenGraphics.setColor(getBackground());
          offScreenGraphics.fillRect(0,0,getSize().width,getSize().height);
          int top = shapes.size();
          for (int i = 0; i < top; i++) {
             Shape s = (Shape)shapes.elementAt(i);
             s.draw(offScreenGraphics);
            private void drawGrid(Graphics g, int gridSpace) {
          Insets insets = getInsets();
          int firstX = insets.left;
          int firstY = insets.top;
          int lastX = getWidth() - insets.right;
          int lastY = getHeight() - insets.bottom;
          //Draw vertical lines.
          int x = firstX;
          while (x < lastX) {
            g.drawLine(x, firstY, x, lastY);
            x += gridSpace;
          //Draw horizontal lines.
          int y = firstY;
          while (y < lastY) {
            g.drawLine(firstX, y, lastX, y);
            y += gridSpace;
        public void actionPerformed(ActionEvent evt)
         synchronized void addShape(Shape shape) {
              // Add the shape to the canvas, and set its size/position and color.
              // The shape is added at the top-left corner, with size 50-by-30.
              // Then redraw the canvas to show the newly added shape.
          shape.setColor(Color.red);
          shape.setColor(currentColor);
           shape.reshape(3,3,70,10);
          shapes.addElement(shape);
          repaint();
         void clear() {
             // remove all shapes
           shapes.setSize(0);
           repaint();
        void delete() {
             // remove selected shapes
                  shapes.removeElement(selectedShape);
                   repaint();
       void rotate() {     
                     //shapes.addElement(selectedShape);
                  selectedShape.setToRotate(true);
                  //shapes.removeElement(selectedShape);
                   repaint();
       Shape selectedShape = null;
       Shape shapeBeingDragged = null;  // This is null unless a shape is being dragged.
                                        // A non-null value is used as a signal that dragging
                                        // is in progress, as well as indicating which shape
                                        // is being dragged.
       int prevDragX;  // During dragging, these record the x and y coordinates of the
       int prevDragY;  //    previous position of the mouse.
        Shape clickedShape(int x, int y) {
             // Find the frontmost shape at coordinates (x,y); return null if there is none.
          for ( int i = shapes.size() - 1; i >= 0; i-- ) {  // check shapes from front to back
             Shape s = (Shape)shapes.elementAt(i);
             if (s.containsPoint(x,y))
                  s.tickSelected(true);
                  selectedShape = s;
                return s;
                else
                s.tickSelected(false);
                repaint();
          return null;
       synchronized public void mousePressed(MouseEvent evt) {
             // User has pressed the mouse.  Find the shape that the user has clicked on, if
             // any.  If there is a shape at the position when the mouse was clicked, then
             // start dragging it.  If the user was holding down the shift key, then bring
             // the dragged shape to the front, in front of all the other shapes.
          int x = evt.getX();  // x-coordinate of point where mouse was clicked
          int y = evt.getY();  // y-coordinate of point                                  
             shapeBeingDragged = clickedShape(x,y);
             if (shapeBeingDragged != null) {
                prevDragX = x;
                prevDragY = y;
                if (evt.isShiftDown()) {                 // Bring the shape to the front by moving it to
                   shapes.removeElement(shapeBeingDragged);  //       the end of the list of shapes.
                   shapes.addElement(shapeBeingDragged);
                   repaint();  // repaint canvas to show shape in front of other shapes
       synchronized public void mouseDragged(MouseEvent evt) {
              // User has moved the mouse.  Move the dragged shape by the same amount.
          int x = evt.getX();
          int y = evt.getY();
          if (shapeBeingDragged != null) {
             shapeBeingDragged.moveBy(x - prevDragX, y - prevDragY);
             prevDragX = x;
             prevDragY = y;
             repaint();      // redraw canvas to show shape in new position
       synchronized public void mouseReleased(MouseEvent evt) {
              // User has released the mouse.  Move the dragged shape, then set
              // shapeBeingDragged to null to indicate that dragging is over.
              // If the shape lies completely outside the canvas, remove it
              // from the list of shapes (since there is no way to ever move
              // it back onscreen).
          int x = evt.getX();
          int y = evt.getY();
          if (shapeBeingDragged != null) {
             shapeBeingDragged.moveBy(x - prevDragX, y - prevDragY);
             if ( shapeBeingDragged.left >= getSize().width || shapeBeingDragged.top >= getSize().height ||
                     shapeBeingDragged.left + shapeBeingDragged.width < 0 ||
                     shapeBeingDragged.top + shapeBeingDragged.height < 0 ) {  // shape is off-screen
                shapes.removeElement(shapeBeingDragged);  // remove shape from list of shapes
             shapeBeingDragged = null;
             repaint();
       public void mouseEntered(MouseEvent evt) { }   // Other methods required for MouseListener and
       public void mouseExited(MouseEvent evt) { }    //              MouseMotionListener interfaces.
       public void mouseMoved(MouseEvent evt) { }
       public void mouseClicked(MouseEvent evt) { }
       abstract class Shape implements Serializable{
          // A class representing shapes that can be displayed on a ShapeCanvas.
          // The subclasses of this class represent particular types of shapes.
          // When a shape is first constucted, it has height and width zero
          // and a default color of white.
       int left, top;      // Position of top left corner of rectangle that bounds this shape.
       int width, height;  // Size of the bounding rectangle.
       Color color = Color.white;  // Color of this shape.
       boolean isSelected;
       boolean isRotate;
       AffineTransform t;
       AffineTransform origTransform;
       void reshape(int left, int top, int width, int height) {
             // Set the position and size of this shape.
          this.left = left;
          this.top = top;
          this.width = width;
          this.height = height;
       void moveTo(int x, int y) {
              // Move upper left corner to the point (x,y)
          this.left = x;
          this.top = y;
       void moveBy(int dx, int dy) {
              // Move the shape by dx pixels horizontally and dy pixels veritcally
              // (by changing the position of the top-left corner of the shape).
          left += dx;
          top += dy;
       void setColor(Color color) {
              // Set the color of this shape
          this.color = color;
       void tickSelected (boolean draw) {
                 // If true, a red outline is drawn around this shape.
             isSelected = draw;
       void setToRotate (boolean draw) {
                 // If true, the shape will rotate 90 deg
             isRotate = draw;
       boolean containsPoint(int x, int y) {
             // Check whether the shape contains the point (x,y).
             // By default, this just checks whether (x,y) is inside the
             // rectangle that bounds the shape.  This method should be
             // overridden by a subclass if the default behaviour is not
             // appropriate for the subclass.
          if (x >= left && x < left+width && y >= top && y < top+height)
             return true;
          else
                      return false;
       abstract void draw(Graphics g); 
             // Draw the shape in the graphics context g.
             // This must be overriden in any concrete subclass.
         }  // end of class Shape
    class RectShape extends Shape {
          // This class represents rectangle shapes.
       void draw(Graphics g) {
            Graphics2D g2 = (Graphics2D) g;
            Rectangle2D wall = new Rectangle2D.Double(left,top,width,height);
            Rectangle2D border = new Rectangle2D.Double(left-2,top-2,width+3,height+3);
            origTransform = g2.getTransform();
            if ((isRotate) && (isSelected))
                   t = new AffineTransform();
                      t.setToRotation ((Math.toRadians (90)),(left+width/2) , (top+height/2) );
                      g2.transform(t);
                      g2.setColor(color);
                   g2.fill(wall);
                   g2.setColor(Color.red);
                    g2.draw(border);
                    g2.setTransform( origTransform );
                    return;
            else
                 g2.setColor(color);
              g2.fill(wall);
            if ((isSelected)&& !(isRotate))
                         g2.setColor(Color.red);
                         g2.draw(border);
                              else
                                   g2.setColor(Color.black);
                                   g2.draw(wall);
    }

  • How to retrive value of a Button that is assigned in the Button Dynamically

    Hi All,
    I am searching the user from LDAP on the basis of the first name ( eg. abc ) Entered of the user to be searched and on the click of the Search Button I have displayed the First_Name, Last_Name, & other Info also, & One Button Having the value as the "uid" for all the users having the First Name as ( abc ) in the Form inside a Table using a loop for loop. Now if there are 10 user having the First_name as abc then there are 10 Buttons which has been displayed Now I want that If I click on the Button corresponding to the 3rd User then his all the details which was displayed on the previous page will be passed in the different editable text fields.
    The major problen which I am facing in this is that as I am generating all these buttons dynamically & all the buttons have same name but all the buttons have the diffrent values, I am able the generate Different names to all the buttons dynamicall & pass their reference dynamically to the Workflow in a transiction condition dynamically.

    if you want some default value in LOV. you go to edit list of value wizard-> UI hint->include no selection Item checkbox -checked.use labeled item first of list- and beside that put the label. but when you try to get value, it will show null.but you can manipulate in ur java , if it default value

  • XML scrolling thumbnail, image loader, & Buttons [halfway works]

    Intro:
    I started a flash-based website a few years ago. Back in 2006 I was able to get a xml scrolling thumbnail, image loader to work without a glitch.
    For numerous reasons I had to put the project on hold until now. [one was that my 30 day trial of flash expired and only recently was I able to purchase the Adobe Web Suite CS4 as well as a new computer which could run the apps.]
    Last Friday saw a bump in the road in the development of my site as two, rather straightforward task, turned into something short of a nightmare as I have been unable to get past these two, seemingly, relatively simple task.
    I have posted in 4 other flash forums the issues, in detail, that I am facing - and have quite a bit of interest/views in the topic as the numbers suggest - yet no response/answer as of yet. [Which confirms other messages I have seen which seem to state that working with buttons has become increasingly difficult with the newer version of flash - something Im a bit surprised with actually from Adobe. - I would have thought there would be a palette where you could set parameters...]
    Screenshot of Site/Timeline:
    Before getting into the two questions I have, I would like to post an image of the site as it looks whenever an swf file is saved out, as well as a piece of the timeline in the back for reference.
    Issue #1
    As of now when the swf file is saved out you get exactly what you see above:
    a: A scrolling thumbnail
    b: ...which loads a large image when clicked on it - PEFECT...
    BUT...
    1a: I need for the buttons to load in this action, not for it to just load on its own.
    [i.e., the silk_paintings gallery is what is open, so I need the "silk_paintings" button to call up this action]
    note: Initially I had attacked this problem by taking out the actions layer you see above and applying it directly to the individual buttons with some crude MouseEvent Listener/Handerls... that did not work - at all.
    Im sure it may be "easier" to make an array out of it, but with my coding level it may be "easier" to apply it to the buttons.
    1b: How I currently see it, I would take the xml-list and duplicate it for the number of galleries I have.
    [I would then re-name the xml-list to reflect the name of the galleries they are to represent, i.e. "silk_paintings"]
    [also, I would have to rename the folders to "thumbnails1,2,3, etc., & "images 1,2,3, etc"
    From there I would duplicate the actions and paste it into the buttons, changing the xml-list name to that of "silk_paintings", etc., as well as write in the MouseEvent listener Handler to make it work. [ah, ha, but what is that magic phrase, I have tried to implement various code from other tutorials, and all in vein.]
    Issue #2
    At this point I would be tickled pink just to get this to basic function to work.
    However, once the buttons are working and calling up the xml, etc., then I need the buttons to stay on the semi-transparent blue color it is whenever in the 'hit' state. [note: NOT pictured above.]
    With the way the buttons are currently set up, and with wanting to use scripting to get them to interact with the thumbnail gallery, it will have to be some miraculous code to tell that button what color to stay as whenever its clicked, and of course it going back to white when another button is clicked.
    Conclusion:
    Since this is an Adobe Forum I would like to make a few additional statements in hopes that the developers, etc. may take heed.
    Adobes products are not cheap, and when I went to purchase the websuite I went in as a designer needing a program as not to need to program.
    I understand the flexibility that coding gives, but something as simple as linking buttons should not be in the realms of rocket science. [yes, for many its not...but my brain just does not operate that route despite all the tutorials thrown at me.]
    Again, it would seem that there would be a button panel where you could drag options like scrolling thumbnail slider, loader, and then parameters would come up. [much like Apples iWeb. - but before the argument of one being pro and the other for non-pros, I see it differently. Software should not be the limiting factor in how flexible you can design, or rather ones lack of programming shouldnt be. With all the talented, and I say this in all humility and honesty, programmers working for Adobe, Im sure something could be programmed like what Im asking for.]
    note: Director is a good example, back in 1997 I knew nothing of multimedia and in one week I had assembled a portfolio, clicking buttons, speech, movies, and all. - and no, I dont have the money to buy more software!
    At this moment I am at the mercy of someone who reads code like its a nighttime tale they are telling their kids, and who can see the exact issue I have and can share the appropriate, correct code. [as I have noticed, it has to be on target - naturally - but this target changes with just a slight change in the design.]
    Thank you,
    peace
    Dalen
    p.s.
    The actionscript: [note: This is only the current working/good code that Im trying to get the buttons to call up.]
    stop();
    fscommand("allowscale", false);//keep SWF display at 100%
    var x:XML = new XML ();//Define XML Object
    x.ignoreWhite = true;
    var fullURL:Array = new Array;//Array of full size image urls
    var thumbURL:Array = new Array;//Array of thumbnail urls
    var thumbX:Number = 25;//Initial offset of _x for first thumbnail
    x.onLoad = function(){ //Function runs after XML is loaded
        var photos:Array = this.firstChild.childNodes;//Defines variable for length of XML file
         for (i=0;i<photos.length;i++) {//For loop to step through all entry lines of XML file
              fullURL.push(photos[i].attributes.urls);//Each loop, adds URL for full sized image to Array fullURL
              thumbURL.push(photos[i].attributes.thumbs);//Each loop, adds URL for thumbnails to Array thumbURL
              trace(i+". Full Image = "+fullURL[i]+"  Thumb Image = "+thumbURL[i]);         
              var t = panel.attachMovie("b","b"+i,i);//Each loop, Define local variable 't' as a new instance of 'b' movie clip, given unique instance name of 'b' plus the index number of the For loop
              t.img.loadMovie(thumbURL[i]);// Each loop, load thumbnail image from XML data into variable movie clip
              t._y = 0;//Set Y coordinate of variable movie clip
              t._x = thumbX;//Set X coordinate of variable movie clip based on variable thumbX
              t.numb = i;//Set sub-variable 'numb' inside variable t to hold index number
              t._alpha = 75;//Set the Alpha value of the variable movie clip to 75% - for onRollOver highlight action
              thumbX += 55;//Increment thumbX value so next thumbnail is placed 125 pixels to the right of the one before
              t.onRollOver = function () {//define onRollOver event of the variable movie clip
                   this._alpha = 100;//Set thumbnail alpha to 100% for highlight
              t.onRollOut = function () {//define onRollOut event of the variable movie clip
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onPress = function () {//define onPress event of the variable movie clip
                   this._rotation += 3;//rotates thumbnail 3 degrees to indicate it's been pressed
                   this._x += 3;//Offset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y -= 3;//Offset Y coordinate by 3 pixels to keep clip centered during rotation
              t.onReleaseOutside = function () {//define onRelease event of the variable movie clip
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during rotation
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onRelease  = function () {//define onRelease function to load full sized image
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during
                   this._alpha = 75;//Reset thumbnail alpha to 75%
                   holder.loadMovie(fullURL[this.numb]);//Load full sized image into holder clip based on sub-variable t.numb, referenced by 'this'
         holder.loadMovie(fullURL[0]);//Initially load first full size image into holder clip
    x.load ("silk_paintings.xml");// path to XML file
    panel.onRollOver = panelOver;
    function panelOver() {
         this.onEnterFrame = scrollPanel;
         delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
         if (_xmouse<b.xMin||_xmouse>b.xMax||_ymouse<b.yMin||_ymouse>b.yMax) {
         this.onRollOver = panelOver;
         delete this.onEnterFrame;
         if (panel._x >= 740) {
         panel._x = 740;
    if(panel._x <= (thumbX-10))  {
              panel._x = (thumbX-10)
         var xdist = _xmouse - 830;
         panel._x += -xdist / 7;
    The xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <slideshow>
    <photo thumbs="thumbnails/i_brown_fairy.jpg"  urls="images/brown_fairy.jpg"  />
    <photo thumbs="thumbnails/i_blonde_fairy.jpg"  urls="images/blonde_fairy.jpg"  />
    <photo thumbs="thumbnails/i_flower_fairy.jpg"  urls="images/flower_fairy.jpg"  />
    <photo thumbs="thumbnails/i_red_fairy.jpg"  urls="images/red-fairy.jpg"  />
    </slideshow>
    Attached is a link to the file I made named "index".
    https://rcpt.yousendit.com/706233226/5e7b4fe0973dacf090b5cbae32c47398
    I would have liked to have included the following files but was limited due to "you-send-it" not uploading folders.  Files not included: [but functioning] : xml list - images [folder] - thumbnails [folder]
    Again, Thank you
    Dalen

    The issues with the buttons calling up the scrolling thumbnail panel have been resolved, as well as keeping the buttons in their hit state once clicked, thanks to Rob.
    Those that have been following this thread, or stumble upon it in their searches later, may appreciate to see the final solution to this particular issue.
    [Hopefully I will be able to update this thread with a url in the future to show the site in operation, which may help somebody with their project in the future if its set up similarly.]
    Alas, it would be nice if future versions of flash had a more direct, flexible, user friendly method for creating navigation.
    [We may see development beyond the flash ads which everyone seems to loathe... and more creativity with flash in terms of games, web interactivity, &  animation.
    Below are 2 sets of code:
    a] the first is located within the first frame of the first button, and has some extra variables in it that the additional buttons call upon...
    b] the second is the code applied to every other button.
    stop();
    fscommand("allowscale", false);//keep SWF display at 100%
    var x:XML = new XML();//Define XML Object
    x.ignoreWhite = true;
    var fullURL:Array = new Array();//Array of full size image urls
    var thumbURL:Array = new Array();//Array of thumbnail urls
    //  .......  CHANGE
    var thumbX:Number;// = 25;//Initial offset of _x for first thumbnail
    // make an array of all of the instance names of each button object...
    // only do this once
    var buttonsList:Array = new Array(shadesOfGrey, silkPaintings);
    shadesOfGrey.isLatched = false;
    // the rollover function... repeat for each button
    shadesOfGrey.onRollOver = shadesOfGrey.onDragOver=function ():Void {
         if (!this.isLatched) {
              this.gotoAndStop(2);
    // the rolloff function... repeat for each button
    shadesOfGrey.onRollOut = shadesOfGrey.onDragOut=shadesOfGrey.onReleaseOutside=function ():Void {
         if (!this.isLatched) {
              this.gotoAndStop(1);
    // the mouse press function... repeat for each button
    shadesOfGrey.onPress = function():Void  {
         resetAllButtons();
         this.isLatched = true;
         this.gotoAndStop(3);
    shadesOfGrey.onRelease = function():Void  {
         x.load("shadesOfGrey.xml");// path to XML file
         thumbX = 25;
    function resetAllButtons():Void {
         for (b in buttonsList) {
              buttonsList[b].isLatched = false;
              buttonsList[b].gotoAndStop(1);
    x.onLoad = function() {//Function runs after XML is loaded
         //  resets the position of the panel on each new load
         panel._x = 740;
         //  .......  CHANGE  removes the existing movieclips from the panel before any new load...
         for (c in panel) {
              if (typeof (panel[c]) == "movieclip") {
                   removeMovieClip(panel[c]);
         var photos:Array = this.firstChild.childNodes;//Defines variable for length of XML file
         for (i=0; i<photos.length; i++) {//For loop to step through all entry lines of XML file
              fullURL.push(photos[i].attributes.urls);//Each loop, adds URL for full sized image to Array fullURL
              thumbURL.push(photos[i].attributes.thumbs);//Each loop, adds URL for thumbnails to Array thumbURL
              //trace(i+". Full Image = "+fullURL[i]+"  Thumb Image = "+thumbURL[i]);
              var t = panel.attachMovie("b", "b"+i, i);//Each loop, Define local variable 't' as a new instance of 'b' movie clip, given unique instance name of 'b' plus the index number of the For loop
              t.img.loadMovie(thumbURL[i]);// Each loop, load thumbnail image from XML data into variable movie clip
              t._y = 0;//Set Y coordinate of variable movie clip
              t._x = thumbX;//Set X coordinate of variable movie clip based on variable thumbX
              t.numb = i;//Set sub-variable 'numb' inside variable t to hold index number
              t._alpha = 75;//Set the Alpha value of the variable movie clip to 75% - for onRollOver highlight action
              thumbX += 55;//Increment thumbX value so next thumbnail is placed 125 pixels to the right of the one before
              t.onRollOver = function() {//define onRollOver event of the variable movie clip
                   this._alpha = 100;//Set thumbnail alpha to 100% for highlight
              t.onRollOut = function() {//define onRollOut event of the variable movie clip
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onPress = function() {//define onPress event of the variable movie clip
                   this._rotation += 3;//rotates thumbnail 3 degrees to indicate it's been pressed
                   this._x += 3;//Offset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y -= 3;//Offset Y coordinate by 3 pixels to keep clip centered during rotation
              t.onReleaseOutside = function() {//define onRelease event of the variable movie clip
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during rotation
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onRelease = function() {//define onRelease function to load full sized image
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during
                   this._alpha = 75;//Reset thumbnail alpha to 75%
                   holder.loadMovie(fullURL[this.numb]);//Load full sized image into holder clip based on sub-variable t.numb, referenced by 'this'
         holder.loadMovie(fullURL[0]);//Initially load first full size image into holder clip
    // this one function scrolls the panel for all of the buttons, it gets the
    // size of the panel when the images are loaded by any given button...
    stroke.onEnterFrame = function() {
         if (this.hitTest(_xmouse, _ymouse, false)) {
              if (panel._x>=740) {
                   panel._x = 740;
              if (panel._x<=740-panel._width+mask._width) {
                   panel._x = 740-panel._width+mask._width;
              if ((panel._x<=740) && (panel._x>=740-panel._width+mask._width)) {
                   var xdist = _xmouse-830;
                   panel._x += -xdist/7;
    Of note is the change to how the movie clips are measured... this change in and of itself has really helped to make the thumbnail panels operation more efficient.
    Below is the script for each additional button: [Having issues with the forums not letting me post additional code, so I will put the remaining code in a reply below.]
    cont.

  • How do I stop button controls responding to both mouse down and mouse up?

    Hi,
    On my front panel I have several buttons which are all set to 'Switch Until Release' type. I've come across the problem where they sometimes stick on even when the mouse has been released (see earlier posting) and this has been confimed by NI as a LV bug.
    To get round this I manually write FALSE to the button controls once my LV prog has read them but I now find that some of the buttons having been cleared go true again on the release of the mouse button as though the mouse release can also set them true.
    Is there any way I can stop them responding to the mouse release?
    Thanks,
    Dave.

    Dave123 wrote:
    I'd like to use latch when released buttons but I'm using local variables of the buttons so I can read the current values of them in different parts of the program.
    So to simulate latch when released I've written my program to set to FALSE the state of the button once it has read that it has been pressed.
    This sounds like a very bad idea if other parts of the code need to react on the state of a pseudo-latch action boolean. There is simply no guarantee that other parts of the code even see the transition due to possible race conditions. What if the boolean gets reset before the other code can read it? What if the other code reads the true multiple times because it loops faster than 200ms?
    How many other places do you possibly need to read it? Maybe you can use latch action combined with an event structure to cause parallel code to react to the value change? (see attached example, LabVIEW 7.0). Maybe you should rethink your code, there might be better alternatives.
    Dave123 wrote:
    Keep the toggle button held down for a second or two, release it and you should see the button goes true again (and is promptly cleared in the case). Why does a mouse button release set the button to true?
    Easy! In this case, you should use "switch when pressed" as mechanical action. You use switch until released, which confuses LabVIEW.
    Switch when released does two things: (1) It switches to true as long as you keep the button pressed. (2) When you release the button, it switches to off. Now, if your code inverts the switch via a local variable while it is still pressed, the release tries to invert the current state and turns it off-to-on again by mistake.
    This might be a slight flaw (bug) in the LabVIEW code. Releasing the button should force a FALSE to the button, not an iversion of the current state.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ButtonForceClearExampleMOD.vi ‏26 KB

  • How do I rotate a button?

    For the life of me, I can't figure out how to rotate a simple button. I can rotate a drop zone, but not a button.

    Hi Aubrey
    Welcome to the forum
    Unfortunately you can't rotate DVDSPs inbuild buttons as they are prelinked to a rectangular button highlight due to the limitations of highlight boundaries in the DVD spec. You'll notice if you convert your rotated drop zone to a button it re-orientates itself.
    You can create angled buttons in PS or comped into motion video, just be sure to leave enought room around them at accommodate the rectangular button highlight shape.
    Cheers
    B

  • Paypal Buttons Malfunctioning

    I have set up a trial site using Muse that has Paypal Buy Now buttons to sell a product.
    I want to sell the product in different countries and so I have created different web pages for each country. On each of these pages is a Paypal Buy Now button with the relevant country setting and currency. (The code for each button having been individually generated on the Paypal site). So far so good.
    So I inserted the different bits of html code from Paypal into the different country pages. I previewed in Muse and all looked good. Then I published to a trial site on BC.
    Now when I visit the trial site, all the Paypal Buy Now buttons lead to a single checkout page that shows the same currency and the same country setting regardless of the button I used to get there.
    All the buttons started out a different bits of html code so I'm not sure how come they're all generating identical checkout pages now.
    Is this a Muse problem ? A Paypal problem ? Or is it me that's I malfunctioning ?
    Any ideas or insights most welcome! Thanks!

    Hi
    Just to isolate the issue, can you try to use paypal button from widgets section , setup different currency and then check if that works.
    This would isolate if there is any problem with the generated code which you are using.
    Also the seller account should be set to accept the currency selected, which is done from Paypal end.
    Thanks,
    Sanjit

  • Audio feedback on quiz buttons

    Is there any way to add audio feedback to an automatically generated quiz button when it has been clicked e,g the submit button, undo button etc?
    I have put audio feedback on smart shape buttons via advanced actions but an advanced action cannot be assigned to the above buttons.
    Failing that is there a way to make a smart shape button into a submit button?
    Many thanks

    The embedded objects in quiz slides, those who have no separate timelines, are different from normal interactive objects. There is no real difference between normal buttons and shape buttons as you seem to tell at all, just between embedded buttons that have specific functionality and the normal buttons. There is no way to replace a quiz button by a shape button at this moment, but that wouldn't change the way they act.
    If you want audio, you can attach it to the feedback captions (Success, Failure) or put them in actions that are triggered by the Submit button: the Success and Last Attempt actions. More details:
    Question Question Slides in Captivate - Captivate blog
    Question Question Slides - Part 2 - Captivate blog

  • HT5624 I just updated the software on my iPad and now can't get all the open files to close as I used to in older version. When I double-click the round button, the open programs show up, but I can't hold down to have the "x" appear to close them. Help.

    I just downloaded the updated software and now can't shut down open programs like I used to by holding downthe round button, having them appear at the bottom of the screen, holding them down for the "x" to appear and then closing them by clicking "x". I can get the program icons to appear, but don't know how to shut them off now.

    Swipe up or drag up on the app window to close the app.

  • Inserting an image into a smart shape

    I have a glossary widget in my course and I have a toggle button I am using for the learner to access the glossary.
    For now I just have a smart shape as a place holder but I'd like to use an existing image I have for the glossary button.
    When I insert a button I can't get it to play for 'rest of project'.
    Any suggestions?
    I am using Captivate 8.
    Thanks.

    Maybe this can help you: Turn an Image into a Button - Captivate blog
    Only shape buttons can be timed for the rest of the project, or you can put them on a master slide. Maybe that is even a better solution for a glossary widget. As  for toggle buttons:
    Toggle Shape buttons - Captivate 6 - Captivate blog

Maybe you are looking for

  • "Document name is invalid.  The index.xml file is missing

    I have OSX Yosemite 10.10 and am having a problem just today in Numbers.  A file that I have saved to my desktop and opened daily to input data since the first of November won't open.  It gives me a message that the file is invalid, the "index.xml fi

  • Why doesn't my flash drive work in the usb port

    Does anyone else have the problem where the usb port is not reading my flash drive?

  • ALV toolbar excel icon using REUSE_ALV_GRID_DISPLAY

    Hi! I’ve created an ALV with using REUSE_ALV_GRID_DISPLAY. In ALV out put on toolbar I’ve excel, sort default icons.  If I sort my ALV on some column and press excel icon one row has got deleted and some column I don’t get data in rows (where my rows

  • Foreign currency revaluation posting.

    Hi Friends, I have processed Foreign currency revaluation through F.05 and got a report onscreen showing without errors. When i am looking in SM35 for batchinput monitoring error log and looking for G/L codes the postings work for G/L codes only but

  • How do I modify a specific component within a active internalframe?

    I need to change an icon (toggle like) on a button within an internal frame when it is pressed.. I know what the active frame is. How do I address the specific component (wiithin a deskpane within a internalframe)? Thank you in advance, BAJH