Mouse Click - Play mc

Hi All
Can anybody help me? I basically have a mc in my library that
I want to appear on the stage, multiple times wherever the mouse is
clicked. I assume it will take the x & y co-ordinates of the
mouse, duplicate the mc and place it where the mouse is clicked.
I am just not sure how to code this correctly.
Many thanks in advance.

Sample:
http://www.johnkalnin.com/flashhelp/DuplicateMC.html
Click on the yellow field.
Flash 8 code:
http://www.johnkalnin.com/flashhelp/DuplicateMC.fla
Based on this tutorial:
http://www.kirupa.com/developer/actionscript/duplicate.htm

Similar Messages

  • No more mouse click sounds for buttons on Captivate 5

    I have been working on a project that uses buttons and click boxes.  Previously the mouse click played when the button was selected, but now there is no mouse click sound when selecting the button.  When closing the application I see a message that pops up saying "Discovering Unreachable Audio".
    I also tried to create a new project with buttons and the mouse click still does not play.
    I double checked in the properties for the button and the box for "Disable Click Sound" is NOT checked, so I know that this is not the problem.
    I am using Windows XP SP3.
    Any advice on how to correct this is greatly appreciated!
    Thanks

    Did you ever find a solution to this?  I am having the same trouble.  The mouse click will not play despite the fact it is selected.  Some mouse clicks will play so I don't know what the issue is.  Also if I change it to a custom mouse click it the sound will play.

  • How do I set my project to advance to next slide on mouse click vs just play?

    Captivate 6 on mac running OS 10.7.5 file format in question .htm (firefox)
    I'm brand new to Captivate 6 (never used it before) I have put together a mock presentation from scratch which has a few introductory slides then a quiz. When I publish it there is a "play" button which is NOT the behavior I want.
    I watched a training video from Lynda.com and the insstructor imported a PPT file, there was a dialog box which asked the how to advance slide, there was a drop down menu and one of two options was advance "on mouse click". This is the behavior I'm looking for.
    I've scoured the internet and forums etc to find a comparable option elsewhere in Captivate 6 when creating from scratch vs importing from PPT and cannot find one anywhere. I've also read that you can insert a click box object and that that would do what I'm looking for but that doesn't work either.
    Does any such option exist and if so where/ how do I get to it/ use it. Please see attachments below. First screen shot is the first slide I get which isn't the first slide either, what's up with that? Next one is simply to show how the project just "plays" instead of advancing slide by slide. Third is my publish dialog box. Bottom line I don't want a "play" button I want the user to mouse click next, next, next etc. How do I do this?
    Thank you for any help or suggestions!

    Maybe I understand something wrongly, but thought you also wanted to know how you can make slides advance on clicking the Next button instead of having it playing on automatically? And instead of using the playbar you want to have a Previous and Next button?
    The way imported PPT with advance on Mouse click works is because there is a click box added to each slide that pauses that slide at its end. The user has to click on the slide to advance.
    A click box is an 'interactive' object: this means that you can have it pausing the slide, that the user can interact with it and trigger an action like 'Go to Next Slide'.
    You added (from what I see on the last screenshot) another interactive object, but now I'm confused: the third screenshot has a Prev and Next arrow, I think those are shapes. You do not need to add a click box on top of them (what I see on the last screenshot), they can be converted themselves into buttons. I blogged a lot about those shape buttons. Anyway, both click box and shape button can pause the slide. This is the case by default for click boxes (at the end of their duration, their timeline), for shape buttons you have to tell them to pause in the Timing accordion. In your case I certainly would choose a shape button because they can be put on a master slide, or timed for the rest of the project whereas Click boxes need to be unique on each slide, you'l have a lot of copy/paste to do then. In the Action accordion, On Success you choose the action, I think in this case you want 'Go to Next Slide' for the Next 'thing'
    As for the first screenshot, Rod explained that you cannot get rid of the play button for pdf output, but you can have a poster image instead of the blank screen. There is a folder icon in Preferences, Project, Start and End when you deselect AuotPlay.
    Here is a link to an article where I explain shape buttons:
    http://lilybiri.posterous.com/why-i-like-shape-buttons-captivate-6
    There is an on-demand webinar as well on the Adobe site which I presented, only about shape buttons.
    Lilybiri

  • Mouse clicks not working on published air app, works fine when debugging/testing

    So I have an issue where when debugging my Air application, it runs fine and mouse clicks work and everything.  When I publish the application and install it, it plays fine but clicking does nothing.
    We have an older version which is working when we publish it and we're trying to add things in one step at a time, but I figured I'd see if anyone else has had this issue.  A bit frustrating.
    Thanks!

    FIXED!!!!
    We're using Dropbox to share files and it turns out that two people having project open at same time is a bad idea when doing final publish!  It creates conflict files and effects the final package or something of that nature.
    Glad we got that one figured out!

  • Is there a way to remove the mouse click splash that appears on See It!

    Can I remove the red splash that appears on the mouse click when playing back a recording in See It mode?
    The client thinks that it is not visually appealing.
    Thank you
    Edited by: dgmurphy on Sep 20, 2012 1:32 PM

    You can request new features in this forum: <br />
    http://webmailnotifier.mozdev.org/drupal/forum/
    But I don't think it would be possible, exactly like you described. An extension can't do anything until Firefox is opened and running. Plus the developer would have to create a different version for every Operating System he decided to support with a feature like that - Windoze, MacOSX, and Linux - to be able to use the "System Tray".

  • MultiCam Monitor Bug - mouse clicking dont swap audio track

    "Audio Follows Video" ON
    and "on play" it switch to MC1/2/3
    but on pause switch only video track. And now i have video MC2 and audio MC3 for example. When use CTRL for new edit MC for video and audio are same. And all ok when switch with RMB. This bug only on MC Monitor mouse clicking.
    my englih bad and i make video
    http://www.youtube.com/watch?v=yrLL1MTgU00

    ok in laymens terms I create a multicam sequence using four video tracks and four audio tracks. Normally the start of the sequence would have all the video audio tracks in, however I have started by editing single clips in time line 1. After a min or so I then import all the multicam footage to time lines 2,3,4. So the the actual sequence starts with clips on a single timeline as oppossed to all 4 video and sound tracks filled.
    I multicam edit them in a new sequence and on final go to export but it fails. and it fails giving an "unknown error" message because the start of the multicam only has clips on one timeline.
    However if I go to the synced sequence (original sequence) copy all the single edits at the beginning, then go to the multicammed sequence and paste these clip straight over the same clips in the multicamed sequence it then exports ok with no errors. I have to do this with every multicam edit I do which is a pain.
    now the text above say if I repeat the same process in CS5 not CS5.5 there is no unknown error message and no need to fiddle about copying and pasting so why so in CS5.5?
    I know your gonna say simple just do your multicam in CS5 but my main bought plugins and effects are for CS5.5 including native Canon MXF support and AVCHD support so I need the CS5.5 really. its bugged and needs fixing.
    Better?
    Roddy

  • Sound to occur on mouse click?

    Sound to occur on mouse click? Thanks again. (example 3
    second gun shot. Must stop after only one play and not
    loop.)

    Go to Control Panel, and open the properties for Sounds And
    Audio Devices. In there look for Start Navigation. For the sound,
    select None.

  • MBA Mouse clicks not registering?

    I've got a weird one with my son's MBA (2008), running Mountain Lion. It's not recognizing mouse clicks from either trackpad or external Magic Mouse. This is happening from boot- normal boot, safe boot and booting into tools menu.
    He was playing minecraft when it went out and nothing I've tried since has got it back- basically lots of reboots and reseting NVRAM and SMC.
    I don't have a wired USB mouse to test that with at home, and I don't have an external USB drive with enough space to create a mountain lion rescue disk at them moment- at least not one I'm milling to mess with (backup drives). I'll pick up an 8GB thumb drive later and give that a try however.
    Any thoughts appreciated- likely a trip to the genius bar, but that's best avoided- closest one is an hour away.

    This is kind of a dirty rotten problem.  Your submenus are inside the main menu right?  So when you click on a submenu item (i.e. menu1A), you are also clicking on the main menu (menu1).  Technically both click events fire (menu1a is first, menu1 is second). A better way to think about it is:  If you are doing construction on your bathroom you are doing construction on your house since the bathroom is in your house.  Confusing, right?
    To fix this, you want to "cancel" the click event for menu1 if you click on one of the sub menu items. Add this line into each of your sub menu functions:
    e.stopImmediatePropagation();
    So one of your functions would look like this:
    function onClick1A(e:MouseEvent):void {
    e.stopImmediatePropagation();
    SWFAddress.setValue("cycling/amgen2010/");

  • Detecting missing mouse clicks?

    There are some times when a user clicks on a movie clip in my
    SWF that the mouse click goes undetected by any of my mouse event
    handlers.
    I even added a MouseClick listener at the root sprite of my
    SWF.
    Is there any way to detect where this mouse click is going,
    and why it is not being detected by anything?
    NOTE: I have *only* seen this happen so far when a user
    clicks on a movie clip that I have dynamically loaded. The movie
    clip is not playing, and I am manually calling gotoAndStop() on the
    movie clip various times. Not sure if that is related.

    please don't cross post.

  • Use mouse click trigger option more than once?

    Hi, is there some way to use the "mouse click" trigger option more than once in the project? I am trying to build a menu button animate where the users click the (menu grid icon) once, and it transforms into the (x icon) and stays there until they click it again ONCE to change it back to the (menu grid icon). Other trigger actions aren't ideal, and I find that if I used the "double mouse click", the response gets a bit messy as clicking once would replay the whole sequence again. Thanks!

    At CreationComplete make a var as:
    button = -1;
    At click event of the button write:
    if (button == -1){
    sym.getSymbol("nmnmnmn").play("xicon");   // if you have a trigger in timeline to make this action that you want
    button++;
    else {
    sym.getSymbol("nmnmnmn").play("returnedicon");
    button = -1;
    Somehow like the above you'll have to do it.
    Or else you can use boolean , TRUE/FALSE

  • Non Responsive to my mouse click

    I'm new to Mac and I'm not sure if my problem sounds strange... Yesterday after I entered a web page in Safarai, I found that some buttons in the page did not responsed to my mouse click no matter how 'hard' I tried... The strange thing is that only some of the buttons / hyperlinks are not responsive. But if I use my PC to visit the same web page, there is no such problem.
    Does anyone encounter something like this before? How to fix it? thanks.

    I've encountered this problem with a few sites, notably airline ticket ordering pages. I get to the end of the process, go to "confirm purchase", and nothing. Very frustrating. Definitely "poor coding" is at play.
    The resolution to the frustration was using Firefox for these type of transactions.
    Have a look at your Bank's FAQ section, specifically "browsers". Do you see anything about browser compatability?

  • Ctrl + Mouse Click to Advance - Possible?

    In the course I'm working on, I want the user to select several options from a list and it uses typical Windows behavior - the user would click and hold ctrl and left mouse click each option.  When I recorded the screen in Captivate 7, the dialogue box states this instruction but when I test it, i can advance by only using the mouse.  Is there a way to force the user to use both the ctrl key and mouse to advance or else get a failure caption?
    Thanks!

    First of all, i couldn't figure out how to advance the slide
    with the use of the mouse. so i chose the spacebar as the select
    key. i used the following settings: on success--continue; allow
    user--one; select keys--space bar; apply settings--all. the
    settings-all didn't seem to have any effect. on the slides i worked
    on individually, here are the issues i ran into: slide continued to
    play for a long time before advancing to the next slide, needed to
    press space bar multiple times before slide advanced, clicking
    button on screen to advance (the one i created with the click box)
    did not seem to have any effect. right now, the show is playing by
    itself. my goal is to slow it down so the user has control over
    when to advance to the next slide.

  • Recording a series of mouse clicks possible with Flash?

    Hi,
    I am having a go at developing a drum machine and I have a collection of buttons that play audio.
    Is there a piece of code, or somewhere I can search to record a series of mouse clicks, ideally against a timer that I could then play back?
    I have no idea if this is possible (I am sure it is) or what to search for.

    you can record mouse clicks but timing in flash is approximate so may not be suitable for what you want.
    you can use getTimer() to record the number of ms that have transpired since your app started.  and you can use mouse click listeners to record when the mouse is clicked.

  • In Logic X, the mouse click wheel scroll is way too fast on the arrange window and the piano roll.  Is there a way to adjust this?

    In Logic X, the mouse click wheel scroll is way too fast on the arrange window and the piano roll.  Is there a way to adjust this?  This is the way I scrolled for MIDI editing on Logic 9

    Hi cris2121, assuming you're using a mouse from apple, go to >System Preferences<
    it's here where one can configure a mouse device.
    Additionally you can also configure Scrubbing in Logic: "When in scrub mode, you can slowly move the playhead in the Tracks Window and the Audio (and optional MIDI) will be played back. The playback speed depends on how fast you move the Playhead in either direction."
    Have a nice day!

  • How to get  the mouse clicked positions on a movie

    I am doing a project on Objects tracking
    I am capturing the video data using webcamera and playing it using processor in JMF
    my problem is , if i click on the movie that is being played currently, i have to display the co-ordinates of the mouse clicked position.
    can anyone help me?
    Thanks in advance
    Sudha

    hello
    i have attache my coding here
    see to it
    import java.io.*;
    import java.io.IOException;
    import java.net.*;
    import java.net.URL;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import javax.swing.*;
    import javax.media.*;
    import javax.media.util.*;
    import javax.media.Buffer.*;
    import javax.media.format.*;
    import javax.media.Format;
    import javax.media.protocol.*;
    import javax.media.control.*;
    import javax.media.rtp.*;
    import javax.media.protocol.DataSource;
    import com.sun.media.ui.*;
    import javax.media.format.YUVFormat;
    import java.util.*;
    import java.util.Vector;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    class capturing1 extends JInternalFrame implements ActionListener,MouseListener,MouseMotionListener,ControllerListener
    * The entry point of the example
    * @param args The command line arguments
         int mark_flg=0;
         int xpos=0,ypos=0;
         mdetect mde=new mdetect();
         protected boolean transitionOK;
         protected Object synchronizer;
         protected Processor processor;
         JButton mark;
         JButton track;
    capturing1(String fname)
    {     super(fname, true, true, true, true);
         getContentPane().setLayout( new BorderLayout() );
         setSize(320, 10);
         setLocation(50, 50);
         setVisible(true);
         processor = null;
    synchronizer = new Object();
    transitionOK = true;
         mark=new JButton("mark");
         track=new JButton("track");
         mark.setSize(25,25);
         track.setSize(25,25);
         mark.addActionListener(this);
         track.addActionListener(this);
         getContentPane().add("East", mark);
         //getContentPane().add("West", track);
         try {
         UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
         } catch (Exception e) {
         System.err.println("Could not initialize java.awt Metal lnf");
         Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
         addMouseListener(this);
         addMouseMotionListener(this);
         loadAndStart(fname);
    public void loadAndStart(String fn)
    boolean status;
    status = loadFile(fn);
    if (status) status = configure();
         TrackControl tc[] = processor.getTrackControls();
         if (tc == null) {
                   System.err.println("Failed to obtain track controls from the processor.");
                   System.exit(0);
              // Search for the track control for the video track.
              TrackControl videoTrack = null;
              for (int i = 0; i < tc.length; i++) {
                   if (tc.getFormat() instanceof VideoFormat) {
                   videoTrack = tc[i];
                   break;
              if (videoTrack == null) {
                   System.err.println("The input media does not contain a video track.");
                   System.exit(0);
         try {
         Codec codec[] = {mde};
         videoTrack.setCodecChain(codec);
         } catch (UnsupportedPlugInException e) {
         System.err.println("The processor does not support effects.");
    if (status) status = realize();
    public boolean loadFile(String fn)
    boolean status;
    URL url;
         status = false;
         /*Vector v = CaptureDeviceManager.getDeviceList(new VideoFormat(
    VideoFormat.YUV));
    System.out.println(((CaptureDeviceInfo) v.get(0)).getName());
    try{
         MediaLocator ml = ((CaptureDeviceInfo) v.get(0)).getLocator();
    System.out.println(ml.toString());
         processor = Manager.createProcessor(ml);processor.addControllerListener(this);status = true;
    }catch(Exception e){
    System.err.println("Exception occured\n");
    e.printStackTrace();
         System.exit(0);
    try {
    url = new URL("file:"+
    System.getProperty("user.dir")+
    "/"+fn);
    if (url != null) {
    processor = Manager.createProcessor(url);
         processor.addControllerListener(this);
    status = true;
    } catch (NoProcessorException npe) {
    System.out.println("Unable to create a processor!");
    } catch (IOException ioe) {
    System.out.println("Unable to connect to source!");
    return status;
    public boolean configure()
    boolean status;
    status = false;
    // Put the Processor into the configured state
    processor.configure();
    if (waitFor(processor.Configured)) {               
    // Set the content descriptor to null so that the
    // processor can be used as a player
    processor.setContentDescriptor(null);
    status = true;
    } else {
    System.out.println("Unable to configure the processor!");
    return status;
    public boolean realize()
    boolean status;
    Component c;
    status = false;
    // Put the Processor into the realized state
    processor.prefetch();
    if (waitFor(processor.Prefetched)) {               
    // The Processor has been realized so the
    // components can be layed out
    c = processor.getVisualComponent();
    getContentPane().add("Center", c);
    c = processor.getControlPanelComponent();
    if (c != null)
              getContentPane().add("South", c);
    System.out.println("button added");
    // Start the Processor
              validate();System.out.println("button added");
    processor.start();
    status = true;
    } else {
    System.out.println("Unable to realize the processor!");
    return status;
    protected boolean waitFor(int state)
    // Make this block synchronized
    synchronized(synchronizer) {
    try {
    while ((processor.getState() != state) &&
    (transitionOK)) {
    synchronizer.wait();
    } catch (InterruptedException ie) {
    // Ignore it
    return transitionOK;
    public synchronized void controllerUpdate(ControllerEvent evt)
    if ( (evt instanceof ConfigureCompleteEvent) ||
    (evt instanceof RealizeCompleteEvent) ||
    (evt instanceof PrefetchCompleteEvent) ) {
    // Synchronize this block
    synchronized(synchronizer) {
    transitionOK = true;
    synchronizer.notifyAll();
    } else if (evt instanceof ResourceUnavailableEvent) {
    // Synchronize this block
    synchronized(synchronizer) {
    transitionOK = false;
    synchronizer.notifyAll();
    public void mouseMoved(MouseEvent e) {
    //saySomething("Mouse moved", e);
    public void mouseDragged(MouseEvent e) {
    saySomething("Mouse dragged", e);
    public void mousePressed(MouseEvent e) {
    //saySomething("Mouse pressed; # of clicks: "
    // + e.getClickCount(), e);
    public void mouseReleased(MouseEvent e) {
    //saySomething("Mouse released; # of clicks: "
    // + e.getClickCount(), e);
    public void mouseEntered(MouseEvent e) {
    //saySomething("Mouse entered", e);
    public void mouseExited(MouseEvent e) {
    //saySomething("Mouse exited", e);
    public void mouseClicked(MouseEvent e) {
    saySomething("Mouse clicked (# of clicks: "
    + e.getClickCount() + ")", e);
         xpos=e.getX(); ypos=e.getY();
    void saySomething(String eventDescription, MouseEvent e) {
         System.out.println("The Object is at the point "+"x ,"+e.getX()+ "y" + e.getY());
         if(mark_flg==1){
         mdetect.markObject(xpos,ypos);
         //mark_flg=0;
    public void actionPerformed(ActionEvent e)
         if(e.getSource()==track)
              System.out.println("track pressed");
              processor.start();
         if(e.getSource()==mark)
              mark_flg=1;//processor.stop();
              System.out.println("mark pressed");
    public class track extends Frame
    {     JDesktopPane desktop;
    public track(String f)
         setLayout( new BorderLayout() );
         desktop = new JDesktopPane();
         desktop.setDoubleBuffered(true);
         add("Center", desktop);
         setSize(640, 480);
         capturing1 cap1=new capturing1(f);
         desktop.add(cap1);
         setVisible(true);
    public static void main(String args[])
    new track(args[0]);
    /****************************** mdetect class**********************************************/
    class mdetect implements Effect
         //Processor processor;
    static boolean marked=true; static int mark_flg=0; int a=1;
    static int xpos=0,ypos=0;
    private Format inputFormat;
    private Format outputFormat;
    private Format[] inputFormats;
    private Format[] outputFormats;
    private int[] bwPixels;
    private byte[] bwData;
    private RGBFormat vfIn = null;
    private static int imageWidth = 0;
    private int imageHeight = 0;
    private int imageArea = 0;
    static int[] p1;
    mdetect()
    System.out.println("mdetect called");
    inputFormats = new Format[] {
    new RGBFormat(null,
    Format.NOT_SPECIFIED,
    Format.byteArray,
    Format.NOT_SPECIFIED,
                                  24,
    3, 2, 1,
    3, Format.NOT_SPECIFIED,
    Format.TRUE,
    Format.NOT_SPECIFIED)
    outputFormats = new Format[] {
    new RGBFormat(null,
    Format.NOT_SPECIFIED,
    Format.byteArray,
    Format.NOT_SPECIFIED,
                                  24,
    3, 2, 1,
    3, Format.NOT_SPECIFIED,
    Format.TRUE,
    Format.NOT_SPECIFIED)
         public Format[] getSupportedInputFormats() {
    return inputFormats;
         public Format [] getSupportedOutputFormats(Format input) {
    if (input == null) {
    return outputFormats;
    if (matches(input, inputFormats) != null) {
    return new Format[] { outputFormats[0].intersects(input) };
    } else {
    return new Format[0];
         public Format setInputFormat(Format input) {
    inputFormat = input;
         return input;
         public Format setOutputFormat(Format output) {
    if (output == null || matches(output, outputFormats) == null)
    return null;
    RGBFormat incoming = (RGBFormat) output;
    Dimension size = incoming.getSize();
    int maxDataLength = incoming.getMaxDataLength();
    int lineStride = incoming.getLineStride();
    float frameRate = incoming.getFrameRate();
    int flipped = incoming.getFlipped();
    int endian = incoming.getEndian();
    if (size == null)
    return null;
    if (maxDataLength < size.width * size.height * 3)
    maxDataLength = size.width * size.height * 3;
    if (lineStride < size.width * 3)
    lineStride = size.width * 3;
    if (flipped != Format.FALSE)
    flipped = Format.FALSE;
    outputFormat = outputFormats[0].intersects(new RGBFormat(size,
    maxDataLength,
    null,
    frameRate,
    Format.NOT_SPECIFIED,
    Format.NOT_SPECIFIED,
    Format.NOT_SPECIFIED,
    Format.NOT_SPECIFIED,
    Format.NOT_SPECIFIED,
    lineStride,
    Format.NOT_SPECIFIED,
    Format.NOT_SPECIFIED));
    return outputFormat;
    public synchronized int process(Buffer inBuffer, Buffer outBuffer) {
         int i=0;
         a++;
              //System.out.println("discard buffer"+inBuffer.isEOM());
              //System.out.println("w n h");
              //System.out.println("w"+size.width+"h"+size.height);
              //System.out.println("format"+inBuffer.getFormat());
              //System.out.println("RGB"+outImage.getRGB(3,3));
              //Graphics og = outImage.getGraphics();
              //og.drawImage(stopImage, 0, 0, size.width, size.height, null);
              vfIn = (RGBFormat) inBuffer.getFormat();
         Dimension size = vfIn.getSize();
              if(inBuffer.isEOM()==false)
              BufferToImage stopBuffer = new BufferToImage((VideoFormat) inBuffer.getFormat());
              Image stopImage = stopBuffer.createImage( inBuffer);
              BufferedImage outImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
              if(a==6)
              PictureButton.but(stopImage);
              System.out.println("stop image called");
              //cut
    /*if(a<0)
         for(int rr=0;rr<MAXROWS;rr++)
              for(int cc=0;cc<MAXCOLS;cc++)
                   System.out.print(PixelArray[rr][cc]+" ");
         System.out.println("@");
    a=0;
         int outputDataLength = ((VideoFormat)outputFormat).getMaxDataLength();
    validateByteArraySize(outBuffer, outputDataLength);
    outBuffer.setLength(outputDataLength);
    outBuffer.setFormat(outputFormat);
    outBuffer.setFlags(inBuffer.getFlags());
         byte [] inData = (byte[]) inBuffer.getData();
    byte [] outData =(byte[]) outBuffer.getData();
         Object data = inBuffer.getData();
    int pixStrideIn = vfIn.getPixelStride();
    int lineStrideIn = vfIn.getLineStride();
         imageWidth = (vfIn.getLineStride())/3; //Divide by 3 since each pixel has 3 colours.
         imageHeight = ((vfIn.getMaxDataLength())/3)/imageWidth;
         imageArea = imageWidth*imageHeight;
    int r=0,g=0,b = 0; //Red, green and blue values.
         System.arraycopy(inData,0,outData,0,outData.length);
         bwPixels = new int[outputDataLength/3] ;
         p1=new int[outputDataLength/3];int[] p=new int[outputDataLength/3];
         for (int ip = 0; ip < inData.length; ip+=3) {
              int bw = 0;
                   r = (int) inData[ip] ;
                   g = (int) inData[ip+1] ;
                   b = (int) inData[ip+2];
    bw = (int) ((r + b + g)/ (double) 3);
              p1[ip/3]=bw;
         return BUFFER_PROCESSED_OK;
         public String getName() {
    return "Motion Detection Codec";
    public void open() {
    public void close() {
    public void reset() {
         public Format matches(Format in, Format outs[]) {
         for (int i = 0; i < outs.length; i++) {
         if (in.matches(outs[i]))
              return outs[i];
         return null;
    public Object getControl(String controlType) {
    System.out.println(controlType);
         return null;
    public Object[] getControls() {
    return null;
    byte[] validateByteArraySize(Buffer buffer,int newSize) {
    Object objectArray=buffer.getData();
    byte[] typedArray;
    if (objectArray instanceof byte[]) {     // Has correct type and is not null
    typedArray=(byte[])objectArray;
    if (typedArray.length >= newSize ) { // Has sufficient capacity
    return typedArray;
    byte[] tempArray=new byte[newSize]; // Reallocate array
    System.arraycopy(typedArray,0,tempArray,0,typedArray.length);
    typedArray = tempArray;
    } else {
    typedArray = new byte[newSize];
    buffer.setData(typedArray);
    return typedArray;
    public static void markObject(int x,int y)
    marked=true;
    xpos=x; ypos=y;
    /* int j =0, m=0,n=0;
    int total = p1.length; int col = imageWidth; //int row = imageHeight;
    int[][] twodim = new int[total/col][col];
    System.out.println("p1 arr"+p1.length+","+twodim.length+"col"+col);
    for(j=0;j<total;j++)
    twodim[n][m] = p1[j];
    System.out.print( twodim[n][m]+" ");
    m++;
    if( m ==col)
    m=0; n++;
    System.out.println("@"+n);
    System.out.println("m"+m+"n"+n);*/
    public int markObject()
    //System.out.println("boolean mark called");
    mark_flg=1;
    return mark_flg;
    /*****************************************end of mdetect class*****************************************************/
    /*********************************** Image Icon class ****************************************************************/
    class PictureButton extends JFrame implements MouseMotionListener,MouseListener{
    static Image image;Icon icon2;JButton button2=new JButton("hi"); int[] pixels; Container content;
    public PictureButton(Image img ) {
    super("PictureButton v1.0");
    setSize(200, 200);
    setLocation(200, 200);
    Icon icon = new ImageIcon(img);
    JButton button = new JButton(icon);
         button.addMouseMotionListener(this);
         button.addMouseListener(this);
    button.addActionListener(new ActionListener( ) {
    public void actionPerformed(ActionEvent ae) {
    System.out.println("Urp!");
    content = getContentPane( );
    content.setLayout(new FlowLayout( ));
    content.add(button);
         //content.add(button2);
    public static void but(Image im) {
         image=im;
    JFrame f = new PictureButton(im );
    f.addWindowListener(new WindowAdapter( ) {
    public void windowClosing(WindowEvent we) { System.exit(0); }
    f.setVisible(true);
    public void mouseMoved(MouseEvent e) {
    //saySomething("Mouse moved", e);
    public void mouseDragged(MouseEvent e) {
    saySomething("Mouse dragged", e);
    public void mousePressed(MouseEvent e) {
    //saySomething("Mouse pressed; # of clicks: "
    // + e.getClickCount(), e);
    public void mouseReleased(MouseEvent e) {
    //saySomething("Mouse released; # of clicks: "
    // + e.getClickCount(), e);
    public void mouseEntered(MouseEvent e) {
    //saySomething("Mouse entered", e);
    public void mouseExited(MouseEvent e) {
    //saySomething("Mouse exited", e);
    public void mouseClicked(MouseEvent e) {
    saySomething("Mouse clicked (# of clicks: "
    + e.getClickCount() + ")", e);
    void saySomething(String eventDescription, MouseEvent e) {
    int w=0;int ind=0;
         System.out.println("The Object is at the point "+"x ,"+e.getX()+ "y" + e.getY());
         int[][][] imagePixels = imageIO.loadImage(image);
              final int MAXROWS = imagePixels.length;
              final int MAXCOLS = imagePixels[0].length;
              int[][] PixelArray = new int[MAXROWS][MAXCOLS];
              pixels=new int[MAXROWS*MAXCOLS];
              int cnt=0;
              int pix=0,pix1=0;
    for(int row=0; row<imagePixels.length; row++) {
    for(int col=0; col<imagePixels[0].length; col++) {
    for(int rgbo=0; rgbo<4; rgbo++) {
                   if((cnt<3)&&(rgbo<3))
    w++;
                   pix=pix+imagePixels[row][col][rgbo];
                   cnt++;
                   else
                   {cnt=0;}
    } // for rgbo
    pix1 = pix/3;
    pix = 0;
                   /*if(col<97)
                   {pix1=(byte)192;}*/
    PixelArray[row][col] = pix1;
                   System.out.print(pix1+" ");
    } // for col
                   System.out.println("@");
    } // for row
         System.out.println("pix arr"+PixelArray.length);
         for(int ww=0;ww<MAXROWS;ww++)
         for(int hh=0;hh<MAXCOLS;hh++)
         pixels[ind++]=PixelArray[ww][hh];
         image = createImage (new MemoryImageSource( MAXROWS,MAXCOLS, pixels, 0, MAXROWS));
         System.out.println(" img added");
    /********************************* end of Image Icon class**********************************************************/
    this program will capture the video n play
    if u click on the mark button processor will be stopped
    u can click on the image and get the mouse co-ordinates
    i have also got the pixel values of the current frame at which u had clicked the mark button..do some manipulation on the pixels to get ur stuff work
    hope this will help u in some way
    regards
    sudha

Maybe you are looking for

  • Photoshop CS5 Pen tool Selection problem?

    I've been using photoshop for a while, and have never encountered this problem. I've had CS5 for about a year now and this is the first time it has done this, so hopefully someone can help me! When I open photoshop, everything works. I make a new lay

  • Shared libary gives error in 10.1.0.3 on AIX 5.2. Is it Stability Issue

    Hi, I am trying to make a shared library immediately after the server installation for my 32bit MicroFocus COBOL application which is running fine on 8.1.7.4 make LIBDIR=lib32 LOC_RTSORA=libmfora.so -f ins_precomp.mk libmfora.so After that I copy the

  • Running sql script from pl/sql

    Is there any standard way to run an external sql script from pl/sql I really appreciate any assistance.

  • How to add HBR plugin in EAS console

    Hi All, The Business rule menu is missing the enterprise view tree. I figured out we can add the plugins through tools --> configure components. For HBR plugin, i need to add com.hyperion.hbr.easuiplugin. But i am not sure which .jar file contains th

  • PL/SQL function returning a SQL Query

    Is this only availabe in HTML db or in 10g in general? Where do I find more about this feature? Thanks in advance, Denes