Stroke with a constant width (using AffineTransform)

I need to have a java.awt.Stroke that has a line width (and preferably using BasicStroke, a dash array) which is independant of the current scale of the Graphics2D object i'm drawing to.
I.e. a scaling of 1000 in x and a stroke of width 2 drawn as 2 pixels on the screen. If i change the scale (using an AffineTransform) to 400 in x then i still want the line drawn to be 2 pixels wide on the screen.
I know i can give the stroke a width of 1 but i'd like to be able to change the width to other amounts.
One option would be to set the current transform on the Graphics2D object back to normal but when drawing the line i need (well, would prefer,) to still be able to specify the points in the correct scale.
I figured i need to subclass BasicStroke and overide the createStrokedShape() method but i don't really know what to overide it with.
I make the affineTransform object so i can easily pass it in as a parameter somewhere.
help apreciated.
Andy.

This may not help you, but I avoid changing the scale of the AffineTransform associated with the Graphics object passed to paint* methods. It screws up strokes, as you mentioned, and it also dooesn't interact well with fonts (use the Font methods named deriveFont to rescale fonts). And a recent poster was writing about hot it screwed up his texturePaint, too. How could you adjust scale?
1. For shapes, I use AffineTransform's createTransformedShape to scale the shape itself.
2. For images, you can use class AffineTransformOp, or rescaling versions of Graphics' drawImage methods, or Graphics2D's drawRenderedImage (it takes a xform).
3. For simple rescaling, I just do it programmatically -- on my fingers and toes, so to speak...
In conclusion, you may not have to rescale in the way you are currently doing it...

Similar Messages

  • How to generate and output 3 TTL square waveforms with different pulse widths using counters of NI 6034E

    Hello
    I just have a few questions.
     I am using the NI 6034E DAQ board in order to
    generate simultaneouly 3 different TTL digital signals, with different
    pulse width, and output these TTL signals to an external circuit that I
    am using for this application.
    The following pattern of the TTL pulses will look like this:
    01010101 01010101
    00110011 00110011
    00001111 00001111
    From
    what I understand,  I have to use the 2 counters, Ctr0 and Ctr1, to
    generate the TTL pulses that I desire, because the DIO lines are
    software timed only and I will not be able to produce a deterministic
    output period using these DIO lines.  Am I correct?    Also, do I have
    to use a separate counter to generate a separate TTL digital pulse.  I
    need 3 different TTL pulses and there are only 2 counters for this DAQ
    device.  The three generated TTL signals will be feed to an external
    circuit.  Concerning the hardware connections for my application, I
    assume that the generated TTL signals will be output from
    GPCTR0_OUT(pin 2)  for counter 0 and GPCTR1_OUT(pin 40) for counter 1
    of the NI 6034E. Is this correct?  Is there any way that these TTL
    signals can be output from three DIO lines(DIO0...2). 
    Here is some code that I plan to use in order to do this:
     #include <NIDAQmx.h>
    static TaskHandle gTaskHandle = 0;
    DAQmxCreateTask ("", &gTaskHandle);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "Dev1/ctr0", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 1.0, 2.0, 2.0);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "Dev1/ctr1", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 3.0, 4.0, 4.0);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "?????", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 7.0, 8.0, 8.0);
    DAQmxCfgImplicitTiming (gTaskHandle, DAQmx_Val_FiniteSamps, 5);
    DAQmxStartTask (gTaskHandle);
    DAQmxWaitUntilTaskDone(gTaskHandle)
    DAQmxErrChk DAQmxStopTask(gTaskHandle)
    DAQmxErrChk DAQmxClearTask(gTaskHandle)
    I believe this code should generate the 3 TTL square waveforms that I want for my application.
    Please provide me with some feedback.  It would greatly be appreciated.
    Thank You

     Hi,
    The NI 6034E is a multifuntion DAQ device, this means you have:
      (2) counters
      (8) DIO lines (software timed)
      (16) AI, single ended
      (0) Analog Output
     You have a couple choices here:
       1. Software timed digital output of all three signals, max 1khz loop rate, non-deterministic.
       2. Hardware timed digital output of 2 signals, max 20Mhz.
       3. Hardware timed digital output of 2 signals and software timed digital output of 1 signal.
       4. Find another NI MIO board such as the NI 6251. This board will do 10Mhz pattern generation for (8) DIO lines.
    For the hardware connection, you are correct, the output for the counters will be taken from pin 2 & pin 40.  Here's the pinout for the NI 6034E for reference:
    The output of the Counters can be routed to some of the PFI's or to the RTSI connector. You can see this in MAX
    Message Edited by Matthew W on 11-19-2007 01:24 PM
    Attachments:
    2007-11-19_131609.jpg ‏61 KB
    2007-11-19_132435.jpg ‏86 KB

  • How to print ALV with full page width used?

    Dear all,
    I have a report which print out with a small font if some of the fields have a long data content, while there a large white space on the right hand side.
    After a few test, I think the following cause the problem:
    1) The line column is less then the page column
    2) The setup leave write space unused in the right side
        (Tested by setup a format which have the same column count as the testing print out data)
    Would like to know are there any work around on this.
    Regards
    Bill
    Edited by: Bill Chie on Jun 13, 2011 7:23 PM

    Hi Wiz,
    Thanks for the information.
    But it look like that it only affect the column width but not the migrate, anyone have any idea about the migrate setting?
    And I would like to know if I can:
    - Setup a limit for the long text limit
    - It the text over the limit, go to 2nd line
    Regards
    Bill

  • How do I write an external class with global constants?

    Hi you all !
    First I want to explain what exactly I want to do:
    I have an application that should run in different resolutions. The app runs fullscreen, and I don't use Layouts or something, just a single Frame with a Graphics Object.
    Now to handle the different resolutions, I want to write an external class with some constants to use. The usage in my main Class should be something like this:
    public
    class blah
    private Constants myConstants;
    public blah()
    if (highResolution)
    myConstants = new hiResConstants();
    else
    myConstants = new loResConstants();
    System.println(String.valueOf(myConstants.SCREEN_WIDTH);
    }or somthing like that. The important fact is that I can choose the constants at runtime and that I am NOT forced to use methods to get the values, cause something like
    System.println(String.valueOf(myConstants.getScreenWidth());sux if you have methods using 5 or more parameters.
    Anybody out there who understood my problem and can help me??? PLEASE?
    best regards,
    Skippy

    First, what's so much worse about
    System.println(myConstants.getScreenWidth());
    than
    System.println(myConstants.ScreenWidth);
    Is the extra five characters really that bad? (Note
    you don't need the String.valueOf method call.)Well actually it was a wrong example I gave here, but it's not the call that makes me shake but the implementation:
    public int screenWidth = 1024;vs.
    public
    int getScreenWidth()
    return 1024;
    }Here it makes a bigger difference, even when you think of managing about 100 or even more constants.
    Second, why do you have methods that take five or more
    parameters!?Well, maybe this example show up what I mean:
    if (cursorIsInArea(100,100,200,200,areaId))
    doSomeStuff();Ok, I could use Rectangles here, but if you think of the timing here (I draw 30 frames / sec and this check comes about every frame or the animation would be choppy) I refuse to create an Object everytime I make this call.
    Btw: Is it worth thinking about the time of execution like I did in this example? OO is a neat thing, but is it that fast?
    I don't think isCursorInArea(new Rectangle(100,100,200,200),areaId) is such a great idea, but I might be wrong.
    It sounds like you're trying to compound a bad design
    with an even worse design for no good reason!Well, I'm not that experienced Java programmer to judge about that, but I (and my profs at university too) found my codes well structured and designed so far.
    Skippy
    PS: the string.valueOf(123) call came from cut&paste:
    system.out.println(string.valueOf(number1)+string.valueOf(number2));Try this without the function.... ;-)

  • After use AffineTransform change also width of stroke

    Hi, may be you can help me. After use AffineTransform change also width of stroke. I want to paint a function graph and calculate that values but tje width of pen is also changed. May be, do I something incorrectly.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.Rectangle2D;
    import java.awt.geom.AffineTransform;
    import java.awt.geom.Point2D;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.print.*;
    public class MyFrame extends JFrame {
         public static final double MM_TO_PAPER_UNITS = 1 / 25.4 * 72;
         public static double widthA4 = 210 * MM_TO_PAPER_UNITS;
         public static double heightA4 = 297 * MM_TO_PAPER_UNITS;
         public static double leftMargin = 4.0 * MM_TO_PAPER_UNITS;
         public static double topMargin = 4.0 * MM_TO_PAPER_UNITS;
         JButton button;
         MyPanel panel;
         GridBagConstraints gridBagConstraints;
         public void init() {
              panel = new MyPanel();
              button = new JButton("Print");
              getContentPane().setLayout(new GridBagLayout());
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.fill = GridBagConstraints.BOTH;
              gridBagConstraints.weightx = 1.0;
              gridBagConstraints.weighty = 1.0;
              add(panel, gridBagConstraints);
              gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.gridx = 0;
              gridBagConstraints.gridy = 1;
              add(button, gridBagConstraints);
              setSize(500, 500);
              button.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        PrinterJob printJob = PrinterJob.getPrinterJob();
                        PageFormat pf = printJob.defaultPage();
                        pf.setOrientation(PageFormat.LANDSCAPE);
                        Paper paper = pf.getPaper();
                        paper.setSize(widthA4, heightA4);
                        paper.setImageableArea(leftMargin, topMargin, widthA4 - 2
                                  * leftMargin, heightA4 - 2 * topMargin);
                        pf.setPaper(paper);
                        printJob.setCopies(1);
                        Book book = new Book();
                        book.append(panel, pf, 1);
                        printJob.setPageable(book);
                        if (printJob.printDialog()) {
                             try {
                                  printJob.print();
                             } catch (Exception PrinterExeption) {
                                  PrinterExeption.printStackTrace();
              setVisible(true);
         public static void main(String[] args) {
              MyFrame myFrame = new MyFrame();
              myFrame.init();
         class MyPanel extends JPanel implements Printable {
              final int leftPadding = 20;
         final int rightPadding = 10;
         final int topPadding = 10;
         final int bottomPadding = 20;
              protected void paintComponent(Graphics g) {
                   super.paintComponent(g);
                   Graphics2D g2 = (Graphics2D) g;
                   paingMyGrafik(g2);
              public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) {
                   Graphics2D g2 = (Graphics2D) graphics;
                   // affine transformation for grip of the panel`s content to the size
                   // A4
                   double W = pageFormat.getImageableWidth();
                   double H = pageFormat.getImageableHeight();
                   double minX = pageFormat.getImageableX();
                   double minY = pageFormat.getImageableY();
                   g2.transform(new AffineTransform((W) / this.getWidth(), 0, 0, (H)
                             / this.getHeight(), minX, minY));
                   paingMyGrafik(g2);
                   return 0;
              private void paingMyGrafik(Graphics2D g2) {
                   // here paint i my grafik
                   AffineTransform old = g2.getTransform();
                   g2.transform(toEndCoordinate());
                   BasicStroke stroke = new BasicStroke(0.2f, BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER);
         g2.setStroke(stroke);
                   g2.drawLine(1899, 20, 1901, 20);
         g2.drawLine(1901, 20, 1901, 25);
         g2.drawLine(1901, 25, 1905, 26);
                   g2.setTransform(old);
              private AffineTransform toUsualyCoordinate(){
    AffineTransform at = new AffineTransform();
    //mirror reflection relative to ox
    at.concatenate(new AffineTransform(1,0,0,-1,0,0));
    //parallel shift (x,y) -> (x, y-h)
    at.concatenate(AffineTransform.getTranslateInstance(0,-this.getHeight()));
    return at;
    private AffineTransform toEndCoordinate(){
    AffineTransform at = new AffineTransform();
    at.concatenate(toUsualyCoordinate());
    at.concatenate((new AffineTransform((double)(this.getWidth()-leftPadding-rightPadding)/this.getWidth(),0,0,(double)(this.getHeight()-topPadding-bottomPadding )/this.getHeight(),leftPadding,bottomPadding)));
    at.concatenate(new AffineTransform(-this.getWidth()/(getMinX()-getMaxX()-2),0,0,this.getHeight()/(getMaxY()-getMinY()+10),this.getWidth()*(getMinX()-1)/(getMinX()-getMaxX()-2),-this.getHeight()*(getMinY()-5)/(getMaxY()-getMinY()+10)));
    return at;
              private int min(int a, int b) {
                   return (a < b) ? a : b;
              private double getMinX(){
                   return 1900;
              private double getMaxX(){
                   return 2000;
              private double getMinY(){
                   return 20;
              private double getMaxY(){
                   return 30;
    }

    The right answer is here ( http://www.javable.com/forum/thread.jspa?messageID=100080&#100080)
    It is necessary to apply BasicStroke before use AffineTransform.
    GeneralPath gp = new GeneralPath();
    g2.setStroke(stroke);
    gp.lineTo((float) xval, (float) yval);
    g2.draw(gp.createTransformedShape(transform));--------

  • I like and use Top Sites but it has become unsuable with this constant blacking out and reloading the thumbnails.  My MBP has not seen a problem at all.   I have been searching every other day for over a month trying to find a fix in Windows Safari with n

    I like and use Top Sites but it has become unsuable with this constant blacking out and reloading the thumbnails.  My MBP has not seen a problem at all.
    I have been searching every other day for over a month trying to find a fix in Windows Safari with no joy.  I want to resolve, not switch browsers. Please offer up a solution that only refreshes the Top Site thumbnails once a day or as some controlable interval.  Started about two versions ago, now on ver 5.1.5. Windows 7 64bit.
    Safari 5.1.5 for Win64 bit, Windows 7!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I think I solved the wifi connection problem, just by switching off completely the router! sounds trivial, but in this case it worked!!!
    the funny behaviour of the trackpad/cursor still persists. any suggestion???
    thanks again

  • How do I deal with missing pixel-widths?

    I apologize if this is the wrong forum. I am currently writing a GUI in swing, and I seem to be having some sort of a pixel mismatch problem. There are two verifiable symptoms so far. I have a BufferedImage that is intended to serve as a ribbon across the bottom of a larger page. I've run createGraphics() on it, and I am using that graphics object to draw hashmarks and numbers to the buffer, and thence the screen. The larger page is arranged in SpringLayout. I'm having two problems that I'm pretty sure are connected.
    - first is that the numbers that I'm drawing to the BufferedImage keep dropping pixel columns. Zeros will be drawn with the middle column gone, for example (and thus no hole). At smaller resolutions, unbolded, they can look like Cs if the drop hits the wrong spot.
    - the bottom ribbon itself goes all the way to the left edge of the page, but the numbering isn't supposed to start until a bit further in - matching up with a spring width from further up the page. The x coord used for drawing and the width spring used for layout are both drawing from the same variable, and thus should be identical, but the number and hashmark are about 4 pixels to the right of where they should be. My guess is that a detailed search would find that there are 4 columns missing between the hashmark and the edge of the screen - which would line up with the approximate frequency seen further in.
    I have tried messing with (java-native) fonts and sizes, I have tried swapping back and forth on bold, and I'm pretty sure by now that it's an error somewhere in the pixel lineup. Does anyone have any idea what causes this, or how to fix it?
    Thank you for your time.
    Fibula

    Hi, sounds like an interesting effect, but is rather hard for me to picture from just your description. A small compiling & runnable example demonstrating your problem would really help here. By the way, with "pages", do you mean panels?

  • Help with Video Performance Issues using Flash

    Asking on behalf of a customer who has been unable to get any answers so far - are you able to help?
    Background:
    We have a port of our Game Development Kit which allows us to recompile all our games using Crossbridge (http://adobe-flash.github.io/crossbridge/) into SWF without any code modifications.
    Overview:
    Our framework is using OpenGL for rendering and we have successfully ported it along with the audio and video to run in Flash.
    We are experiencing performance issues using Video. We cannot use image sequence as some of the video animations are too long and would increase the download to an unacceptable size.  Assets vary between 256x256 - 1024x1024 videos.

    Here's the rest of the story.  Let me know if you can see any resolution, and I will connect him to the forums.  Thank you.
    Current Video Solution:
    We create an instance of NetConnection, NetStream, and Video according to most samples out there, and invoke draw to rasterize the Video DisplayObject into a BitmapData instance.
    The BitmapData instance has a fixed color component layout which is not compatible with Stage3D texture and is therefore has to be reformatted before uploaded to Stage3D Texture (See Code Listing below).
    Our Problems:
    Performance issues with RGBA conversion (either using copyChannel or manually reformatting is not fast enough) natively in as3; this required for stage3d texture.Copying each channel individual using bitmapdata.Copychannel seems faster, but not significantly faster.
    Cannot detect when video frame has been updated, therefore we may copy pixels that are not needed in enterframe (processpixel).
    Looping video, our current solution uses the NET_STATUS event Buffer empty; Is there a better way to loop videos than checking buffer and seeking to 0.
    Stepping video, loading FLV or MP4 side by side assets from HTTP or embedded does not support stepping? Is there another way?
    ActionScript Code Listing:
    video_nc = new NetConnection();
    video_nc.addEventListener(NetStatusEvent.NET_STATUS , onConnect);
    video_nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR , trace);
    video_nc.connect(null);
    // OnConnect Event:
    this.ns = new NetStream(e.target as NetConnection);
    eventclient = new Object();
    eventclient.onMetaData = onMetaData;
    this.ns.client = eventclient;
    ns.play(flvfile);
    ns.pause();
    //onMetaData event:
    this.width = infoObject.width;
    this.height = infoObject.height;
    this.textureWidth = NextPowerOfTwo(this.width);
    this.textureHeight = NextPowerOfTwo(this.height);
    cliprect = new Rectangle(0, 0, this.width ,this.height);
    cliprect.x = 0;
    cliprect.y = 0;
    cliprect.width = this.textureWidth;
    cliprect.height = this.textureHeight;
    totalFrames = infoObject.duration * infoObject.fps;
    this.hasAlpha = true;
    if(infoObject.videocodecid == 5)
    this.hasAlpha = true;
    this.bitmapData = new BitmapData(this.textureWidth, this.textureHeight, hasAlpha, 0xff000000);
    this.video = new Video(this.width, this.height);
    this.video.attachNetStream(ns);
    this.video.addEventListener(Event.ENTER_FRAME, processPixels);
    // processPixel method:
    BitmapData.draw(video);
    GLAPI.instance.glBindTexture(GLAPI.GL_TEXTURE_2D,this.textureId);
    var fmt:uint = GLAPI.GL_ARGB;
    // converting pixels using copychannel or loop through pixels
    GLAPI.instance.glBindTexture(GLAPI.GL_TEXTURE_2D,this.textureId);
    GLAPI.instance.glTexImage2D(GLAPI.GL_TEXTURE_2D, 0, fmt, this.textureWidth, this.textureHeight, 0,fmt, GLAPI.GL_UNSIGNED_BYTE, 0, convBitmapData.getPixels(cliprect));

  • How to generate a pulse train with different pulse width and delay?

    How to generate a triggered pulse train with different pulse width. for example, after each trigger signal, let's say 2 ms, then the counter output a pulse with pulsewidth of 1 ms, and then after 3 ms delay after the first pulse, the second pulse was generated with a pulse width of 4 ms.  Next cycle when the trigger signal comes, the same two pulses will be generated and so on. Is it possible to achieve this by using 6601 counter card? and if yes, how to achieve this? Thanks!

    Unfortunately you can not create a hardware timed pulse train with different widths on each pulse from a counter. Whilst it can be changed on the fly using software, since you require a hardware triggered signal getting the software involved will not give a huge amount of accuracy when the pulse will actually change.
    So in short you can't use your 6601 card (or a counter timer) to achieve this
    There are three possible Alternative solutions
    1 You could use a high speed digital IO device such as the (6533/34) to generate your variable signal which would require setting up the pulse train as a series of states based around the burst transmission mode where the clock would give you your specific timing.
    2 A timed analogy output (for example on a MIO card with a clock (PCI-6220 / 62xx), i.e. Not the 6704 style static analogy output cards)
    3 A high speed digital waveform card such as the (, 656x , 655x, 654x, 6534, 6533 (http://www.ni.com/modularinstruments/find_right.ht​m) ) this could then be scripted to work with your triggering and also there is a digital waveform editor which will enable you to set up the pattern you wish to generate (http://sine.ni.com/nips/cds/view/p/lang/en/nid/135​55) 
    Hope that helps
    Tim Matthews
    NI (UK)

  • Why is Photoshop CS6 extremely slow with the brush tool using Wacom pen?

    Could my wacom tablet be the issue?  The psd processor spins not stop until I pick up the wacom mouse and click on an adjacent layer then back to the layer I was working on.  Then the wacom pen  work with the brush tool.  This seems to happen when every time I  pick up the pen and go back to the brush  tool.

    First, sorry it took so long to reply.  Have been a bit swamped.  What I mean by the psd processor, is the balls that rotate kind of like the SBDO when the app is executing a paint stroke.  So I tried your suggestion, mad a new file 7w x 5d at 72pi, set the brush to 25px at 100% hardness and made a stroke with the wacom pen.  It worked fine.  The issue is working in large files say around letter size at 300dpi or large format graphics for trade shows at 150dpi.  These files can range anywhere from 6ft x 8ft high  to 16ft w x 10 ft h for an example.  So painting in a channel mask or retouching using the brush tool in airbrush mode is painfully slow.  I've found that while this little psd icon is spinning, if I take the wacom mouse, click on an adjacent layer then go back to the layer I was working on and resume with the airbrush, the problem subsides.  It seems this spinning thing happens when I initially start using the brush on a layer or layer mask.  Do you get what I'm trying to explain?

  • How can I create a pulse train with varying pulse widths?

    I'm trying to create a finite pulse train that varies its duty cycle. I was hoping there was a clever way to do this neatly. I've attached a very rough picture of the train I'm hoping to make, with the pulse widths defined with t, the delay between pulses d, and a total of N+1 pulses. Thanks!
    Edit: My current method is to use the pulse train function, and actually create 2N+1 pulses, stacking the "double length" pulses.
    Attachments:
    ExPulseTrain.png ‏9 KB

    I wound up just building the first short pulse, and then the train of longer pulses, and sticking them together. I attached a screenshot of the code I went with.
    Attachments:
    VarPulseTrain.png ‏29 KB

  • Cell column width using spry horizontal menu

    Hi
    Trying to set the cell column width using DWCS5.5 Spry Horizontal menu.
    view-source:http://www.roatan.ws/spry-menu-bob
    I used help to get directions and I think I did it correctly but I do not know for sure.
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
              background-color: #356A68;
              float: none;
              background-color:transparent;
              height: auto;
              width: auto;
    Trying to clean up my site and get things working an looking right.
    Any suggestions appreciated
    bob

    Spry menus do not contain any table columns or cells.    They are just lists <ul> <li>  tags  styled with CSS.
    ul.MenuBarHorizontal li
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 12px;
        position: relative;
        text-align: center;
        cursor: pointer;
        width: 8em; /**adjust top-menu width**/
        float: left;
        text-decoration: underline;
    ul.MenuBarHorizontal ul
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 10px;
        z-index: 1020;
        cursor: default;
        width: 8em; /**adjust sub-menu width**/
        position: absolute;
        left: -1000em;
        background-color: #356A68;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com/

  • Trying to save key strokes with a for loop

    I have been trying to action script for years with no
    success. I to some time off and learned javascript and some oop
    (ruby) so I thought I would take another stab at it. I am still
    having problems. Here goes...
    I have several movieclips on the stage that will be set up as
    buttons. They all have the same effects associated with mouseover
    and mouseout so I thought I could save some key strokes with a for
    loop. But I can't get it working right. Could someone tell me what
    I am doing wrong please?
    If anyone can help it would be appreciated.

    kglad,
    Thanks for taking a look. In answer to your question. The
    movie clip instance names are mc_ItemText0 ... mc_ItemText3.
    quote:
    those declarations at the top of your for-loop aren't doing
    anything useful. what are the names of you movieclips that are
    on-stage?
    In reg\ards to the variable declarations, sorry my variable
    names are causing confusion. I use the name "mc" for two different
    variables. Once for the FOR loop and a separate time locally in the
    functions grow and shrink. The ones set for the For loop are used
    in the 'onEvents' at the bottom of the script. Sorry for the
    confusion.
    Because the code works if I take it out of the FOR loop and
    replace the
    's with the numbers that corruspond to the movie clip; I don't
    think the similar names are conflicting because of the scope. To
    make the code more readable and eliminate confusion I have posted
    the code with unique variable names.
    I have searched the forum for FOR loop difficulties and
    found several cases that seemed similar to mine, but I didn't
    understand what was happening.
    Examples:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid =1253110&highlight_key=y&keyword1=for%20loop
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid =1202338&highlight_key=y&keyword1=for%20loop
    My code with unique variable names to end confusion:

  • RS485 LabVIEW interface not working with a constant

    I need to control an RS 485 interface (not a National Instruments device).
    I found a vi written by a colleague which I have attached.
    This works perfectly, so I used a probe to identify the value being generated, and used this to replace the variables with a constant.
    Now the vi doesn’t work. It runs, but the device it is connected to no longer activates. Then I found that by replacing only one variable with the constant, and keeping the other as a variable kept the vi working.
    Can anyone offer any suggestions please ?
    Of course, where I really want to get to is a vi that just reads and writes to a non-NI RS485 interface.
    Many thanks.
    Attachments:
    RS485_usb.vi ‏55 KB

    Using NI Measurement and Automation Explorer, I sent vset50\n and the instrument responded correctly by going to position 50.
    Using the 485 example http://zone.ni.com/devzone/cda/epd/p/id/2674      202314.vi    The documentation states that this example will only work with National Instruments RS-485 interfaces. I don’t have and NI 485 and not sure what difference it will make.
    In 202314.vi    I enabled the termination character  since  RS485_usb.vi ‏55 KB uses this and it works. Not sure what to do about Assert DTR and transceiver mode so I tried all combinations but kept getting error code 1073807330.
    I looked at (Help>>Find Examples..>>search term "485"), but couldn’t pick anything out that I could apply here.
    Yes, the randome numbers are now string constants in the block diagram. The string constant, now including \n, is placed at the VISA write input.
    I’ve used Measurement and Automation Explorer to send the same command repetitively and there is no problem with this, the instrument jiggles back and forth and rests at the original position.
    When the instrument doesn’t work, the vi completes without errors, but there is no instrument activity.
    Any thoughts would be appreciated.

  • Goods Receipt Report With 101 movement type using bapi_goodsmvt_create

    Dear Abapers,
            i am getting some problem, i got requirement like Goods Receipt Report with 101 movement type using
    bapi_goodsmvt_create and data should upload through excel sheet.
    still facing problems, i have searched sdn forum n sdn code also, but relevant answer i could not find.
    What are all the inputs i need to take and please give some valuable inputs to me.
    please do help ..... thanks for advance..
    Thanks & regards,
    Vinay.
    Moderator message : Spec dumping is not allowed, show the work you have already done. Thead locked.
    Edited by: Vinod Kumar on Sep 27, 2011 10:58 AM

    Dear Abapers,
            i am getting some problem, i got requirement like Goods Receipt Report with 101 movement type using
    bapi_goodsmvt_create and data should upload through excel sheet.
    still facing problems, i have searched sdn forum n sdn code also, but relevant answer i could not find.
    What are all the inputs i need to take and please give some valuable inputs to me.
    please do help ..... thanks for advance..
    Thanks & regards,
    Vinay.
    Moderator message : Spec dumping is not allowed, show the work you have already done. Thead locked.
    Edited by: Vinod Kumar on Sep 27, 2011 10:58 AM

Maybe you are looking for

  • How do I stop syncing voice memos to iTunes on Windows?

    I want to delete my voice memos on my Windows computer (to free up disk space), but leave the voice memos intact on my iPod. How can I accomplish this? (iTunes says that when I delete from my computer, the memos will also be deleted from my iPod, whi

  • Why does my MacBook Pro make background music and video quieter when I am on FaceTime?

    Why does my MacBook Pro make background music and video quieter when I am on FaceTime? When my girlfriend and I are trying to watch a movie on Netflix together while on FaceTime my MacBook Pro always decreases the volume of any background sound on my

  • Could not open a volume

    Hi! As getting sensible german support is next to impossible I try it here I've just installed Windows 8 and CS6 When I start Photoshop I get a message like "could not open a volume...." and "could not initialize Photoshop" photoshop did create an em

  • All docs save and open in adobe

    Everything I do is either saving or opening in Adobe and I do not want it to.  What setting can I change?

  • How to use documents like pictures, stored on content management in forms

    Hi, We store on content management as an attachment, and in relations with a marketing campaign, an image which represents the campaign. We developed a smartform which restores the data of the campaign and we want to insert the image about which I sp