Change Rectangle size dynamically like MS Paint Application

Hi I am new to flash.  I want to create one rectangle by drage and drop. It should change the size dynamically. The application is just like Ms paint.  I need the action script. Please help me.
Thanks..

This forum is for Acrobat Scripting. Try a forum for Flash.

Similar Messages

  • Change image size dynamically in BIP report

    Can we change the size of image dynamically in bip report. If yes can I get some doccument or samples on it.
    Thanks
    Aj

    I am doing small POC
    I have a rtf template with three sample images on it with three different sizes for 1” by 1” , 3” by 3” and 5” by 5”.
    I have a standard size of 2” by 2” image in my server (Could change size in future depending on req)
    Now when I run the report the template should call the standard image from server and replace the sample images on the rtf and show the the standard image in three different sizes.
    Pls let me know if i am missing something

  • Change item size dynamically

    Hii All
    I need to change an item size dynamically. For eg. If i have an item size (width) 20 and i entered text of 100 alphabates then the size of item is increase dynamically along with text.
    I use set_item_property but it shows an error that *" Cannot resize item. Position of item places it off of canvas. "*
    Please Assist.
    Pradhyumn

    write both the actions at the same time
    if the canvas size is less then the field size plus the increament then increase the size of the canvas tooo...

  • Change Slideshow Size Dynamically

    Wanted to see if I can change the Slideshow size while it plays using:
    http://labs.adobe.com/technologies/spry/articles/element_selector/index.html
    The factory script shows an error; (I added div.content and then copied and changed the content class).
    <script src="includes/SpryDOMUtils.js" lang="javascript" type="text/javascript">
    <script lang="javascript" type="text/javascript">
    function myFunction(){
       Spry.$$("div.content").addClassName(".contentCopy");
    </script>
    I was trying to change the class: .content; width (smaller)
    Can this be done?

    Sorry, I led you up the garden path. The following will work
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <style>
    #test {
        height: 150px;
        background-color: grey;
        width: 860px;
    </style>
    <script src="Spry-UI-1.7/includes/SpryDOMUtils.js"></script>
    <script>
    function myResize() {
       Spry.$$("div#test").setStyle("width: 290px; background-color: blue");
    </script>
    <title>Untitled Document</title>
    </head>
    <body>
    <div id="test">
    <h1>This is my test</h1>
    </div>
    <button onClick="myResize()">Resize Test</button>
    </body>
    </html>
    Gramps

  • Change rectangle size animation

    Hi I've got this showRect method which draws a rectangle, but I need to animate the rectangle: make its heigth grow from zero to a fixed value.
    public void showRect(int x, int y,int rectWidth,int rectHeight)
    Graphics2D g = (Graphics2D) getBufferStrategy().getDrawGraphic();
    try
    if (g!=null)
    g.setPaint(Color.ORANGE;
    g.fill(new Rectangle2D.Double(x, y, rectWidth, rectHeight));
    finally
    g.dispose();
    To make the rectangle grow I did this:
    for(int i=0;i<500;i++){
    fs.showRect(800,100,300,i);
    fs.updateScreen();
    Thread.sleep(20);
    and it works fine but as the y axe grows to the bottom of the screen so does my rectangle and I need the rectangle to grow to the top of the screen and can't find how to make it grow in this other direction

    This code
    for(int i=0;i<500;i++){
        fs.showRect(800,100,300,i);will change the height of the rectangle from zero to 500. The top of the rectangle is determined by "y" which is not altered in your code. If you switch from Rectangle2D to Rectangle there is a "grow(int x, int y)" method available.

  • How to change window sizes dynamically in smartform

    Hi,
    Dear ABAP Experts,
            I need to show different materials current sales by comparing previous year’s sales (month wise) as a table and their difference in the form of chart( diagram). Can anyone share how to draw chats(rectangular boxes) in smartform.
        Please can any one tell me how to pass dynamic coordinates (left margin, width, upper margin and height) to create window. If I know this one I can solve my problem.
    Thanks in advance,
    Meeravali Shaik.

    hi Raju,
    You can do onething. Create a variable in global defination of charcter lenth 1.
    when you are selecting your address on the basis of address number. suppose we have two address add1 and add2.
    if you get add1 set this variable 'X'.
    otherwise set it 'Y'.
    Now create two text node.
    in one text node put your add1 and in other one put add2. in text node yyou will get tab conditions.
    Put the condition varible = 'X' for add1.
    and 'Y' for add2.
    so it will execute one the basis of that condition and print the one of the addresses u have.
    Hope this will help you out.
    Reward if useful.
    Regards,
    Azad.
    do remember to clear the variable after printing.

  • Can I change the size of the application stack icons?

    I have an application folder on the right-hand side of the dock, I set them to be opened as 'stack'.
    When I click the application folder on the dock, it will show me many icons of applications, those are huge.
    I'd like to shrink it a little bit, since I can browse more apps at a time, but how can I do?
    Thanks in advance!

    V.K. wrote:
    no, you can not change the sizes of icons you get when you click on a stack in the dock. there is no way around this. this question is asked pretty frequently though and it looks like a nice feature to have. you can leave apple feedback requesting it
    http://www.apple.com/feedback/macosx.html
    P.S. do note that there is a scroll bar on the right when you click on a stack and you can use that to scroll through the stack.
    Thank you V.K., I've sent them my feedback!

  • Dynamically change in size of the custom container using ALV GRID (OOPS)

    Hi Gurus!!!!
    I have an issue with the output of the report which is developed using ALV GRID (OOPS). I have used the custom container occupying full screen (Screen painter). When I execute the report using my PC the output displays report as expected in full screen. The problem is when we execute this report in 19 INCH monitor then there is always gap below the report.
    As per my understanding we should have a code to change the size of custom container dynamically.
    Please suggest some help on this.
    Thanks,
    Hemal Shah

    Hi,
    If you set the attributes, Resizing - Vertical and Horizontal for the customer container, than system will resize the size of the custome continer as per the resolution.
    Hope it helps,
    Sumana

  • Rectangle size changes from what I typed?

    I'm using Illustrator CS 5 on snow leopard, when I make a new path with the rectangle tool, choosing a size in the dialogue window, say 10"x10" when i look at the rectangles size in the transform window along the top of the screen it says my rectangle is 10.0139" x 10.0139", now if I type 10 by 10 into the field again it stays 10 x 10.  Why does it do this and how can I fix this?
    Thanks
    Marcus

    Merrill,
    To me it looks like Edit>Preferences>General>Use Preview Bounds being ticked.
    A integer inch rectangle is an integer pixel rectangle so there should be nothing to change.

  • How to change font-size of application menu

    I want to change font-size of application menu. How?

    Hi,
    To change the font size of the Application menu, you need to change main.css file.
    at 'body, td, input, select, textarea' class.
    For more detail about main.css, please refer Bookshelf
    Siebel Developer's Reference at [8 Cascading Style Sheets].
    Regards,
    Joseph Arul Dass

  • Is there a way to change the size of a sticky note attached to a page?  I would like to make the √ l

    Is there a way to change the size of a sticky note attached to a page?  I would like to make the √ larger.  

    Yes - click on the themes button in the  toolbar and select the new size and type - depending on your selection some text may not fit the new theme - usually everything is ok
    LN

  • All of my tools in PS 6 have a "cross" icon and I can't use them, like the clone tool.  I have reset all tools to no avail.  The bracket keys do not change the size.  Any help?

    All of my tools in PS 6 have a "cross" icon and I can't use them, like the clone tool.  I have reset all tools to no avail.  The bracket keys do not change the size.  Any help?

    Yep, I discovered that.  Thank you very much for the prompt and accurate reply.

  • Dynamically change stage size on runtime

    Hi everyone,
    I need to change the stage size dynamically.
    When i try to do this............
    size_mc.onRelease = function(){
        trace(Stage.height);
        Stage.height += 100;
        trace(Stage.height);
    it comes always the current stage size.
    Thanks in advance

    You cannot change the width and height properties of the Stage using code--it must be done in the editor.  The width and height values can represent different things depending on the value you set for the scale mode, but you cannot reassign them to different values dynamically.
    The solution just offered to you is under the same rules, the stageWidth and stageHeight values cannot be assigned using code, but that code is AS3 code so it will not fit in your AS2 design in any case.
    The same goes for the followup offered in AS2.  You will notice the stage size is not being changed... it cannot be.  This is just a full screen design solution, but is not a soltuion to changing the stage size.  The stage size can only be changed manually in the authoring environment.  I don't know that the offering is answering what you are really trying to do, but it is not answering the titled task of dynamically changing the stage size

  • Dynamically change the size of a text field.

    Is it possible to change the size of a text field depending on the amount of text in the field?
    Thanks,
    Chad

    You can find the answer from this post.
    jimmypham, ""Shrink to Fit" - Text Field capability?" #1, 18 Jul 2005 10:36 pm

  • Help needed in creating a simple paint application

    I want to create a simple paint application using swings in java, i am able to draw different shapes using mouse but the problem is when i select some other shape it simply replaces the already drawn object with the new one but i want the already drawn object also, like appending, what should be done for this, any logic missing here or i should use some other approach?
    Please help me
    package test;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class bmp extends JFrame implements MouseListener, MouseMotionListener,
              ActionListener {
         int w, h;
         int xstart, ystart, xend, yend;
         JButton elipse = new JButton("--Elipse--");
         JButton rect = new JButton  ("Rectangle");
         JPanel mainframe = new JPanel();
         JPanel buttons = new JPanel();
         String selected="no";
         public void init() {
              //super("Bitmap Functions");
              // display.setLayout(new FlowLayout());
              buttons.setLayout(new BoxLayout(buttons,BoxLayout.Y_AXIS));
              buttons.add(Box.createRigidArea(new Dimension(15,15)));
              buttons.add(elipse);
              buttons.add(Box.createRigidArea(new Dimension(0,15)));
              buttons.add(rect);
              Container contentpane = getContentPane();
              contentpane.add(buttons, BorderLayout.WEST);
              //getContentPane().add(display, BorderLayout.WEST);
              addMouseListener(this); // listens for own mouse and
              addMouseMotionListener(this); // mouse-motion events
              setSize(1152, 834);
              elipse.addActionListener(this);
              rect.addActionListener(this);
              setVisible(true);
         public void mousePressed(MouseEvent event) {
              xstart = event.getX();
              ystart = event.getY();
         public void mouseReleased(MouseEvent event) {
              xend = event.getX();
              yend = event.getY();
              repaint();
         public void mouseEntered(MouseEvent event) {
              //repaint();
         public void mouseExited(MouseEvent event) {
              //repaint();
         public void mouseDragged(MouseEvent event) {
              xend = event.getX();
              yend = event.getY();
              repaint();
         public void mouseMoved(MouseEvent event) {
              //repaint();
         public static void main(String args[]) {
              bmp application = new bmp();
              application.init();
              application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public void mouseClicked(MouseEvent arg0) {
         public void actionPerformed(ActionEvent event) {
              if (event.getSource() == elipse) {
                   selected = "elipse";
                   repaint();
              else if(event.getSource() == rect)
                   selected = "rectangle";
                   repaint();
         public void paint(Graphics g) {
              System.out.println(selected);
              super.paint(g); // clear the frame surface
              bmp b=new bmp();
              if (selected.equals("elipse"))
                   w = xend - xstart;
                   h = yend - ystart;
                   if (w < 0)
                        w = w * -1;
                   if (h < 0)
                        h = h * -1;
                   g.drawOval(xstart, ystart, w, h);
              if (selected.equals("rectangle"))
                   w = xend - xstart;
              h = yend - ystart;
              if (w < 0)
                   w = w * -1;
              if (h < 0)
                   h = h * -1;
              g.drawRect(xstart, ystart, w, h);
    }

    bvivek wrote:
    ..With this code, when i draw an elipse or line the image doesnt start from the point where i click the mouse. It added the MouseListener to the wrong thing.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    public class test_bmp extends JPanel implements MouseListener,MouseMotionListener,ActionListener
           static BufferedImage image;
           Color color;
           Point start=new Point();
           Point end =new Point();
           JButton elipse=new JButton("Elipse");
           JButton rectangle=new JButton("Rectangle");
           JButton line=new JButton("Line");
           String selected;
           public test_bmp()
                   color = Color.black;
                   setBorder(BorderFactory.createLineBorder(Color.black));
           public void paintComponent(Graphics g)
                   //super.paintComponent(g);
                   g.drawImage(image, 0, 0, this);
                   Graphics2D g2 = (Graphics2D)g;
                   g2.setPaint(Color.black);
           if(selected=="elipse")
                   g2.drawOval(start.x, start.y, (end.x-start.x),(end.y-start.y));
                   System.out.println("paintComponent() "+start.getX()+","+start.getY()+","+(end.getX()-start.getX())+","+(end.getY()-start.getY()));
                   System.out.println("Start : "+start.x+","+start.y);
                   System.out.println("End   : "+end.x+","+end.y);
           if(selected=="line")
                   g2.drawLine(start.x,start.y,end.x,end.y);
           //Draw on Buffered image
           public void draw()
           Graphics2D g2 = image.createGraphics();
           g2.setPaint(color);
                   System.out.println("draw");
           if(selected=="line")
                   g2.drawLine(start.x, start.y, end.x, end.y);
           if(selected=="elipse")
                   g2.drawOval(start.x, start.y, (end.x-start.x),(end.y-start.y));
                   System.out.println("draw() "+start.getX()+","+start.getY()+","+(end.getX()-start.getX())+","+(end.getY()-start.getY()));
                   System.out.println("Start : "+start.x+","+start.y);
                   System.out.println("End   : "+end.x+","+end.y);
           repaint();
           g2.dispose();
           public JPanel addButtons()
                   JPanel buttonpanel=new JPanel();
                   buttonpanel.setBackground(color.lightGray);
                   buttonpanel.setLayout(new BoxLayout(buttonpanel,BoxLayout.Y_AXIS));
                   elipse.addActionListener(this);
                   rectangle.addActionListener(this);
                   line.addActionListener(this);
                   buttonpanel.add(elipse);
                   buttonpanel.add(Box.createRigidArea(new Dimension(15,15)));
                   buttonpanel.add(rectangle);
                   buttonpanel.add(Box.createRigidArea(new Dimension(15,15)));
                   buttonpanel.add(line);
                   return buttonpanel;
           public static void main(String args[])
                    test_bmp application=new test_bmp();
                    //Main window
                    JFrame frame=new JFrame("Whiteboard");
                    frame.setLayout(new BorderLayout());
                    frame.add(application.addButtons(),BorderLayout.WEST);
                    frame.add(application);
                    application.addMouseListener(application);
                    application.addMouseMotionListener(application);
                    //size of the window
                    frame.setSize(600,400);
                    frame.setLocation(0,0);
                    frame.setVisible(true);
                    int w = frame.getWidth();
                int h = frame.getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(Color.white);
                g2.fillRect(0,0,w,h);
                g2.dispose();
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           @Override
           public void mouseClicked(MouseEvent arg0) {
                   // TODO Auto-generated method stub
           @Override
           public void mouseEntered(MouseEvent arg0) {
                   // TODO Auto-generated method stub
           @Override
           public void mouseExited(MouseEvent arg0) {
                   // TODO Auto-generated method stub
           @Override
           public void mousePressed(MouseEvent event)
                   start = event.getPoint();
           @Override
           public void mouseReleased(MouseEvent event)
                   end = event.getPoint();
                   draw();
           @Override
           public void mouseDragged(MouseEvent e)
                   end=e.getPoint();
                   repaint();
           @Override
           public void mouseMoved(MouseEvent arg0) {
                   // TODO Auto-generated method stub
           @Override
           public void actionPerformed(ActionEvent e)
                   if(e.getSource()==elipse)
                           selected="elipse";
                   if(e.getSource()==line)
                           selected="line";
                   draw();
    }

Maybe you are looking for