Sprite Sheet Animation started by Mouse Click

I have a animated fire sprite. It is set to hidden, another button is set to "show" this sprite when it's clicked.
Problem is that the animation runs while hidden so when you click the button that reveals the sprite, the animation cycle may be complete. It's set to loop but I would like the sprite to start on frame 1 and begin play once you click the button, not autoplay.
Any ideas how to do this?

You can uncheck(i.e. disable) the Autoplay for the spritesheet symbol from the property panel (which you will see when you select the stage of the symbol in the symbol editing mode).
hth,
Vivekuma

Similar Messages

  • CS6 Sprite Sheet animation alignment puzzle

    Hey all, I greatly enjoy using Flash CS6's Generate Sprite Sheet tool since it's much much quicker than exporting all the sprites and using TexturePacker (though I wager TP would provide far better optimization). One problem I seem to have is aligning different animations to the same origin - which isn't the origin of the sprite (top left corner).
    Say my character Jim has two animations:
    Run (small sprites, as he runs in place)
    Jump (short and tall sprites, and a bit wider than the Run)
    I currently generate a sprite sheet by highlighting both clips and right clicking. This gets me a perfect Sprite Sheet with both animations and their respective names (based on MC name). The Run and Jump frame sizes are different, because the Jump sprites are taller than the Run sprites -- this all makes sense.
    What doesn't is that there's zero information on how those two animations should be placed such that Jim can go from playing his run animation and then his jump animation with his feet in the same place, despite the fact that if you inspect either of those clips Jim is standing right at Flash's little origin point at the start of both.
    Sure, the data file (JSON in my case) has all the offsets for placing the individual frames in the right place, but how do I align Jim's feet from one set of frames to the next without having to do it all by hand? To date the only workaround I've found is to dump all the animations into a single timeline such that they all take the same frame size, but this is TERRIBLE for managing sprites and animations since it gives all the frames the same name as the combined timeline.
    What I really need is another set of numbers in the Sprite Sheet data file that tells me the frame x & y offset from Flash's movieclip origin. I have a suspicion this doesn't exist and is impossible.
    At a loss here other than aligning each animation's frame by hand, which may have to be done every time an interal sprite changes size.
    Thanks for any insight, none of the Adobe pages or demos go into any depth other than creating a sprite sheet of a single image or animation.

    Yes, I understand how to make animations blend together, but my question relates to the technical side of how sprite sheets are generated.
    When I generate a sprite sheet from multiple animation movieclips each animation has a unique frame size that Flash calculates and codes into the data file, and that frame size is not the size of document but the size of the smallest frame that can fit all of the sprites in the animation. I can't control this frame size or define a region within the document that is the frame size. Each animation within the sprite sheet could have a different frame size.
    I'm interested to know if there is a way to view, generate, or export the data that would relate one animation frame to another so that a character (Jim) could be standing at the movieclip origin in the Run animation which is size A and also be standing at the movieclip origin in the Jump animation which is size B, and not only are A and B different sized frames, but none of the corners are coincident. Since it doesn't do this currently I'd have to manually code the offsets of each animation to a common origin instead of being able to use the one that's already in Flash.
    I don't see how any of the default data that is exported along with the spritesheet PNG could relate that info and I'm very curious.
    (I could do it by putting every animation within the same movieclip, but then the spritesheet tool is pretty useless since it'd all be one animation)

  • Changing animation start from On Click to Automatic problem

    Hello,
    I have a downloaded Keynote template, which I edited and modified. The template contains animations that begin "On Click". I want all the animations to begin automatically after slide appears. So I changed all the animations in inspector to automatically after prior build (or automatically after build X). But when playing the animation, I still have to click to proceed, like it was set. I can save the file and reopen it, but it does not help, when everything is set fine in inspector. The only thing I can do to fix this, is to delete ALL animations and recreate them.
    Does anyone have an idea what I am doing wrong?
    Thanks

    I did save the theme, but it does not make any difference.

  • Mouse Clicks in Captivate

    I have a number of captivate animations that have mouse
    clicks. However even though I have set and checked all mouse clicks
    the 'click' audio does not consistently work. Is there a trick to
    setting the audio click.
    I am using Captivate V2.0.0 build 1177

    Hi Mike Wald and welcome to our community
    Sorry, but I'm a bit confused by your post. Which is true?
    Are you saying that a mouse click is heard and you don't want
    it to be? If so, take a look at the links below:
    Link One
    Link
    Two
    Or is it that you
    want to hear mouse clicks and are not? In this case, other
    than checking each mouse movement, I'm a bit stumped.
    Cheers... Rick

  • Mouse click and drag through turntable animation

    Hi all,
    First - thanks for taking the time to look through and possibly helping me with this question.
    I'm just getting to grips with flash cc actionscript 3.0 - so I apologise in advance to my not so technical jargon.
    In the past I have used actionscript 1.0 to create an interactive html file that contains a turntable animation of a 3D model. Users can mouse click and drag to the left or right to 'spin' the model around - however what they are really doing is scrubing through the timeline which contained 360 images of it from 360 degrees. Similar ideas can be found here: Interactive Thyroidectomy
    Now annoying I can't use the old code any more as I'm working in the latest flash cc actionscript 3.0
    So how do I do the same thing but in actionscript 3.0?
    So I've worked this bit out so far
    On my main stage I have two layers - actions layer and another layer with my movie clip (movieclip_mc)
    In the actions layer so far:
    movieclip_mc.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
    movieclip_mc.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
    function onMouseDown(event:MouseEvent):void
      movieclip_mc.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
      //I should put something in here about mouseX  - but no idea what
    function onMouseUp(event:MouseEvent):void
      movieclip_mc.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
    function onMouseMove(event:MouseEvent):void
    //I have to put something in about total frames - width of movieclip_mc etc but I'm not sure how   
    // this is what someone else did on another forum - but I'm not sure what it means:
         var delta:int = backgroundClip.mouseX - clickedMouseX;
       var wantedFrame:uint = (clickedFrame + delta * clip.totalFrames / backgroundClip.width) % clip.totalFrames;
       while (wantedFrame < 1)
      wantedFrame += clip.totalFrames;
      clip.gotoAndStop(wantedFrame);
    Also I think i need something in the beginning like.....:
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    var clickedMouseX:int;
    var clickedFrame:uint;
    var backgroundClip:Sprite = getChildByName("background") as Sprite;
    var clip:MovieClip = getChildByName("animation") as MovieClip;
    clip.stop();
    clip.mouseEnabled = false;
    .....but I'm a bit confused about what all of it means
    So I understand the principle but no idea how to actually make it work - Could anyone help explain it to me or help with the code?
    Thanks so much to anyone who can offer some help
    Catherine

    Hi Ned,
    sorry to bother you again on this subject -
    the script...
    function onMouseMove(event:MouseEvent): void {
      movieclip.gotoAndStop(Math.round(mouseX/movieclip.width*(movieclip.totalFrames-1))+1 )
    worked fine - but when you click and drag on the movie clip it didn't always get to the end of the movie and never carried on through the frames back to the beginning like i wanted it to (such as this one does Interactive Thyroidectomy)
    So I went back to the older 2.0 script and played with it a bit to be :
    function onMouseMove(event:MouseEvent): void {
      changeDistance = movieclip.mouseX - startX;
      travelDistance = startFrame + changeDistance;
      if (travelDistance > movieclip.totalFrames) {
      movieclip.gotoAndStop (travelDistance % movieclip.totalFrames);
      } else if (travelDistance < 0) {
      movieclip.gotoAndStop (movieclip.totalFrames + (travelDistance % movieclip.totalFrames));
      } else {
      movieclip.gotoAndStop (travelDistance);
    .... which almost works but it is very stuttery to mouse over and then it has this output error..
    mouseDown
    ArgumentError: Error #2109: Frame label 2.3500000000000227 not found in scene 2.3500000000000227.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 3.6499999999999773 not found in scene 3.6499999999999773.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 4.949999999999989 not found in scene 4.949999999999989.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 6.25 not found in scene 6.25.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 7.600000000000023 not found in scene 7.600000000000023.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 8.899999999999977 not found in scene 8.899999999999977.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 11.5 not found in scene 11.5.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 12.850000000000023 not found in scene 12.850000000000023.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 14.149999999999977 not found in scene 14.149999999999977.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 15.449999999999989 not found in scene 15.449999999999989.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 16.75 not found in scene 16.75.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    mouseUp
    I've obviously put some code in the wrong place - could you help me find out what it might be?
    I haven't labelled any frames odd numbers such as 15.4499999999999989 or labeled scenes than number either.
    I can send you my scene if that would help?
    Thanks very much for your time Ned
    (p.s Or maybe if it is easier you might offer some guidance as to how i can change the action script
    function onMouseMove(event:MouseEvent): void {
      movieclip.gotoAndStop(Math.round(mouseX/movieclip.width*(movieclip.totalFrames-1))+1 )
    to allow it to be more like Interactive Thyroidectomy

  • Macbook Pro mouse click delay on 10.6.4 start-up

    Just installed Snow Leopard 10.6.3 and found that while the track pad will move the cursor around the screen, you can not select (click) on anything for the first 3 or 4 minutes after start-up. Updated to 10.6.4 and have the same trouble. Plug in a single button USB apple mouse and still the same trouble. Anyone else having this glitch??? I have a Macbook Pro 17", 2.33 Ghz, 2 Gig of SDRam. Is it a firmware problem?? I'm ready to wipe the drive and do a clean install, but that seems to be a lot of work for something that is annoying but not a devastating problem. Other than that it seems to be a great OS.
    Help!!!

    Since I posted I have done several things... reset Pram, repaired disk (there were minor problems) repaired permissions (again minor problems and all were fixed... and both were done booted from the Snow Leopard install disk). On restart the same problem persists, and after checking, there is no keyboard input either. (hadn't checked that before) also on last boot from full shutdown, time from button push to full desktop... 3 minutes 42 seconds... time from full desktop to working mouse click 4 minutes 13 seconds.... That's almost 8 minutes from a cold laptop to a working machine...
    Think a disk wipe and clean reinstall would help this??

  • Upon start up my Apple is unresponsive to mouse clicks.

    Upon start up my Apple is unresponsive to mouse clicks.

    Go to > Troubleshooting wireless mouse and keyboard issues

  • Record Audio in Captivate 4 for PP Slide with multiple mouse click animation

    I have a power point presentation imported into  Captivate 4.  Several of the slides have custom animation that ocurr's on mouse click. What is the best way to record the audio for these slides and have the audio sync to the right portion of the slide?

    I am afraid there is no direct way to solve your problem. You can identify the time at which the movie stops because of an on-click animation. At every location, insert a transparent caption (blank caption) and add audio to the caption.
    Thus once the movie pauses for the user to click, audio wont appear till user click on the swf. Once he does, movie timeline will move ahead and transparent caption will appear thus playing the audio file.
    Hope this helps. Do let us know if it works.
    Regards,
    Mukul

  • NSView subclass and mouse clicks

    I wrote a relatively simple program. It's got a single visual component on the window, an NSView subclass with drawing delegated out to another class called Arrow. Anyway, it uses a timer to trigger calls to drawRect which in turn "animates" a layer. I have a 100x100 layer and a velocity & position which get updated each time through depending on how much "real" time has passed. As the layer bounces around the screen, the animation seems smooth and everything looks good. If I start clicking in the window, however, things get wonky. The animation stutters (probably expected) and the position sometimes gets set back to the origin (0,0, bottom left corner of screen). I wonder if there's something I can do to stop mouse clicks from affecting the view, I have no set up anything to use the mouse clicks AT ALL so I don't really know how they can affect anything in the code I wrote. If this isn't enough info to answer the question, I'll post the xcode project.

    The end result is going to be a very simple 2d game with maybe 8-10 things on the screen moving around at any one time. My next step is to try out openGL but using these CALayers seemed a lot simpler. However, since you say any event will block, I expect that will happen to opengl as well. I'll dig some more in the examples. It seems I followed the pattern from the crash landing demo (although I'm doing it on the mac itself, not iphone/simulator) to set up the rendering.
    When you suggest using core animation, are you talking about just telling it the start/end position and the speed, and letting it handle everything in between? I don't think that will work for my case because eventually I will have to handle mouse/keyboard events to alter the movement in real-time. Am I missing something?
    Thanks again for your help.

  • Mouse clicking amd Dragging

    Hi, I have the following code so far, and when run in conjunction with other classes it creates a carousel feature.
    When you click and hold on the carousel and drag up or down, the carousel moves in the relevant direction.
    I am trying to change this click and drag, so instead when you click one of the polygons (which represent up and down arrows), the carousel moves up or down depending on which you click.
    Can anyone help with this?!
    Thanks very much!
    class ScheduleBarCanvas extends Canvas implements MouseListener,
    MouseMotionListener, ActionListener
    * CONSTANTS *
    /** Width of a slot, in pixels. */
    static final int SLOT_WIDTH = 2;
    /** Width of an entire day schedule bar, in pixels. */
    static final int BAR_WIDTH = Slot.SLOTS_PER_DAY * SLOT_WIDTH;
    /** Half of the height of a day schedule bar, in pixels. */
    static final int BAR_HALF_HEIGHT = 20;
    /** The width of an hour within a day schedule bar, in pixels. */
    static final double HOUR_WIDTH = BAR_WIDTH / 24;
    * The schedule day bars are represented as a rotatable 'wheel'. This value
    * defines the 'angle' allocated to a single day bar.
    private static final float DEGREES_PER_DAY_BAR = 10;
    * For convenience, this value represents the number of day bars that occupy
    * a 90-degree 'slice' of the schedule wheel.
    private static final int DAY_BARS_PER_90_DEGREES = (int) 9;
    * The maximum number of day bars that can be represented in the wheel.
    private static final int MAX_BARS = 9*2-1;
    * FIELDS *
    * Popup menu to use for right click menu. The right click menu allows users
    * to perform actions such as changing the climate for a selected period of
    * time.
    private final JPopupMenu rightClickMenu = new JPopupMenu();
    * Determines whether 'paste day schedule' is an available option in the
    * right click menu. 'Paste day schedule' should remain unavailable until
    * the user has copied a day schedule bar.
    private boolean allowPaste = false;
    * When the user has chosen to copy a day schedule, it will be stored here.
    private DaySchedule copiedDaySchedule;
    * A day schedule with the default period allocations.
    private final DaySchedule defaultDaySchedule;
    /** X coordinate of the left end of the schedule bars. */
    private int barLeftX;
    /** Y coordinate of centre of schedule bar display. */
    private int centreY;
    /** Width of canvas, pixels. */
    private int width;
    /** Height of canvas, pixels. */
    private int height;
    /** X coordinate of last mouse click. */
    private int lastMouseClickPositionX = 0;
    /** Y coordinate of last mouse click. */
    private int lastMouseClickPositionY = 0;
    /** X coordinate of last right mouse button click. */
    private int lastRightClickPositionX = 0;
    /** Y coordinate of last right mouse button click. */
    private int lastRightClickPositionY = 0;
    /** Start time of last selected period. */
    private Slot periodStartTime = new Slot(0);
    /** End time of last selected period. */
    private Slot periodEndTime = new Slot(0);
    /** Last-pressed mouse button. */
    private int pressedButton;
    * While clicking and dragging to modify the end time of a period, this
    * field stores the 'old' end time of the period.
    private int currentPeriodEnd;
    * While clicking and dragging to modify the end time of a period, this
    * field stores the width of the current period. At other times, this field
    * has the value 0.
    private int currentPeriodWidth = 0;
    * Rather than directly manipulating the window's canvas, a buffer is used.
    * All updates to the display are computed 'out of sight', by writing to
    * this buffer's Graphics object (see 'graphicsBuffer') and then copied to
    * the canvas in one go.
    private Image imageBuffer;
    private Image imageBuffer2;
    /** Graphics object buffer to use when updating the display. */
    private Graphics graphicsBuffer;
    private double animationSpeed = 0;
    private double simTimeInc;
    private double simTime = 0; // simulated time, HOURS from start
    /** Collection of days */
    private Schedule schedule;
    * The set of day schedule bars visible on screen at present. As the user
    * scrolls through different days, schedule bars will come in and out of
    * sight, and hence will enter and leave this array.
    private DayBar[] visibleScheduleBars;
    /** Stores the available schedulables */
    private List<Schedulable> palette;
    private int barZeroDay;
    /** Currently highlighted period - not currently used */
    private Period selection;
    /** Previously highlighted selection - not currently used */
    private Period oldSelection; // button 3 selections
    private Period dayDrag; // button 1 drag region
    private DaySchedule daySched; // schedule affected by drag
    * When clicking and dragging to change the duration of a Period, this value
    * is used to store the number of the slot being dragged.
    * If this is a new Period, and hence no prior boundary existed, this value
    * will be -1.
    private int draggedSlotBoundary;
    * When you right click on a Period, the system fills this value with the
    * number of the first slot in that Period. For instance, if 13:00 to 16:00
    * is set to 'away', and you right click at 14:40 (or any other slot inside
    * the 'away' Period), then this value will be set to the index of the slot
    * 13:00.
    private int firstSlotNumber;
    * When you right click on a Period, the system fills this value with the
    * number of the last slot in that Period. For instance, if 13:00 to 16:00
    * is set to 'away', and you right click at 14:40 (or any other slot inside
    * the 'away' Period), then this value will be set to the index of the slot
    * 16:00.
    private int lastSlotNumber;
    private DaySchedule selectedDaySchedule;
    private boolean createPeriods = true;
    * CONSTRUCTORS *
    * Setting various schedules that can be displayed
    * Initialises the display of the scheduler
    * Setting right click menu
    ScheduleBarCanvas()
    int delay = 0; // milliseconds
    int period = 40; // milliseconds
    final double updateFreq = 1000.0 / period; // H
    visibleScheduleBars = new DayBar[20];
    palette = new ArrayList<Schedulable>();
    palette.add(new Schedulable(new Color(50, 50, 220))); // away
    palette.add(new Schedulable(new Color(100, 180, 160))); // sleep
    palette.add(new Schedulable(new Color(150, 150, 120))); // busy
    palette.add(new Schedulable(new Color(200, 100, 20))); // relax
    defaultDaySchedule = new DaySchedule(palette);
    schedule = new Schedule(palette);
    Timer timer = new Timer();
    // Inner class construction for a java.util.Timer object with a
    // defined TimerTask to run processes. See the java.util library
    // in the Java API for details. Also refer to other java utility
    // assistance classes which may be useful to you in the future.
    timer.schedule(new TimerTask()
    public void run()
    simTimeInc = getAnimationSpeed() / (updateFreq * 200.0);
    if (simTimeInc > 0.0)
    { // Advance simulation time at
    simTime += simTimeInc; // current rate
    repaint(); // then update the display ASAP.
    }, delay, period); // schedule's init delay & repeat-call period
    JMenuItem menuItem1 = new JMenuItem(
    "Set climate to 'Away'", new ImageIcon("away.png")),
    menuItem2 = new JMenuItem(
    "Set climate to 'Sleeping'", new ImageIcon("sleep.png")),
    menuItem3 = new JMenuItem(
    "Set climate to 'Relaxing'", new ImageIcon("relax.png")),
    menuItem4 = new JMenuItem(
    "Set climate to 'Busy'", new ImageIcon("busy.png")),
    menuItem5 = new JMenuItem(
    "Reset day schedule", new ImageIcon("refresh.png")),
    menuItem6 = new JMenuItem(
    "Copy day schedule", new ImageIcon("copy.png"));
    menuItem1.addActionListener(this);
    menuItem2.addActionListener(this);
    menuItem3.addActionListener(this);
    menuItem4.addActionListener(this);
    menuItem5.addActionListener(this);
    menuItem6.addActionListener(this);
    rightClickMenu.add(menuItem2);
    rightClickMenu.add(menuItem4);
    rightClickMenu.add(menuItem1);
    rightClickMenu.add(menuItem3);
    rightClickMenu.add(menuItem5);
    rightClickMenu.add(menuItem6);
    addMouseListener(this);
    addMouseMotionListener(this);
    * GRAPHICS METHODS *
    * Updates the GUI.
    * @param g graphics object to draw to.
    public void update(Graphics g)
    // NB: repaint() above automatically calls update(Graphics g) ASAP.
    paint(g);
    * Updates the display.
    * @param g canvas to draw on.
    public void paint(Graphics g)
    float carouselRadius = 100; // Carousel radius in pixels
    float degreesPerPixel = (float) (57.29 / carouselRadius);
    if (currentPeriodWidth != 0)
    simTime += currentPeriodWidth * (degreesPerPixel / DEGREES_PER_DAY_BAR) * 24;
    currentPeriodEnd += currentPeriodWidth;
    currentPeriodWidth = 0;
    barZeroDay = (int) simTime / 24; // treat 1 sim sec as 1 hour
    int maxDayNo = barZeroDay + MAX_BARS;
    if (barZeroDay < 0 || maxDayNo >= Schedule.N_SCHEDULES)
    return; // invalid day number; do nothing
    Dimension dim = getSize();
    int maxX = dim.width - 1, maxY = dim.height - 1;
    barLeftX = maxX / 7;
    centreY = maxY / 2;
    if (width != dim.width || height != dim.height)
    width = dim.width;
    height = dim.height;
    imageBuffer = createImage(width, height);
    graphicsBuffer = imageBuffer.getGraphics();
    graphicsBuffer.clearRect(0, 0, width, height);
    graphicsBuffer.setColor(new Color(0, 0, 0));
    int hour = (int) simTime - barZeroDay * 24;
    float dayZeroOffsetAngle = (float) (((hour - 12) / 24.0) * DEGREES_PER_DAY_BAR);
    for (int barNo = 0; barNo <= MAX_BARS; barNo++)
    int dayNo = barZeroDay + barNo;
    int daysEarlier = DAY_BARS_PER_90_DEGREES - barNo;
    float dayAngle = daysEarlier * DEGREES_PER_DAY_BAR
    + dayZeroOffsetAngle;
    float z = carouselRadius * (float) Math.cos(0);
    float y = carouselRadius * (float) Math.sin(dayAngle / 57.3);
    float x = z / 20;
    DayBar dayBar = new DayBar(dayNo, schedule.getDaySchedule(dayNo),
    graphicsBuffer, barLeftX, centreY, x, y);
    visibleScheduleBars[barNo] = dayBar;
    for (int barNo = 0; barNo <= MAX_BARS; barNo++)
    visibleScheduleBars[barNo].paintBar(oldSelection, selection);
    g.drawImage(imageBuffer, 20, 0, null);
    g.setColor(Color.WHITE);
    g.drawRect(40,25,375,50);
    g.fillRect(40,25,375,50);
    g.drawRect(40,205,375,65);
    g.fillRect(40,205,375,65);
    Point bigArrowPoint1 = new Point(0,0);
    Point bigArrowPoint2 = new Point(0,0);
    Point bigArrowPoint3 = new Point(0,0);
    Point smallArrowPoint1 = new Point(0,0);
    Point smallArrowPoint2 = new Point(0,0);
    Point smallArrowPoint3 = new Point(0,0);
    bigArrowPoint1 = new Point(100,100); //top left
    bigArrowPoint2 = new Point(100,100); //middle right
    bigArrowPoint3 = new Point(100,100); //bottom left
    smallArrowPoint1 = new Point(100,100); //top left
    smallArrowPoint2 = new Point(100,100); //middle right
    smallArrowPoint3 = new Point(100,100); //bottom left
    Polygon bigArrow = new Polygon();
    bigArrow.addPoint(bigArrowPoint1.x+310,bigArrowPoint1.y-25);
    bigArrow.addPoint(bigArrowPoint2.x+320,bigArrowPoint2.y-25);
    bigArrow.addPoint(bigArrowPoint3.x+315,bigArrowPoint3.y-30);
    Polygon smallArrow = new Polygon();
    smallArrow.addPoint(smallArrowPoint1.x+310,smallArrowPoint1.y+105);
    smallArrow.addPoint(smallArrowPoint2.x+320,smallArrowPoint2.y+105);
    smallArrow.addPoint(smallArrowPoint3.x+315,smallArrowPoint3.y+110);
    g.setColor(Color.black);
    g.fillPolygon(bigArrow);
    g.drawPolygon(bigArrow);
    g.setColor(Color.black);
    g.fillPolygon(smallArrow);
    g.drawPolygon(smallArrow);
    addMouseListener(this);
    addMouseMotionListener(this);
    * Sets a new percentage value for the animation speed of the application.
    * @param animationSpeed desired animation speed.
    void setAnimationSpeed(double animationSpeed)
    this.animationSpeed = animationSpeed;
    * Returns the current speed of the animation, as a percentage.
    * @return the current speed of the animation, as a percentage.
    private double getAnimationSpeed()
    return animationSpeed;
    * Finds and returns a slot based upon the specified mouse position
    * coordinates.
    * @param x x coordinate of selection, relative to centre-left of schedule
    * bar display.
    * @param y y coordinate of selection, relative to centre-left of schedule
    * bar display.
    * @return a Slot value corresponding to the selected slot if available. If
    * no slot was selected, null is returned.
    private Slot findSlot(int x, int y)
    int barNumber = findDayBarNumber(x, y);
    if (barNumber == -1)
    return null;
    int foo = (x - (int) visibleScheduleBars[barNumber].getLeftAngleX());
    int bar = (barNumber * Slot.SLOTS_PER_DAY + foo / SLOT_WIDTH);
    return new Slot(bar + barZeroDay * Slot.SLOTS_PER_DAY);
    * Finds the day bar specified by the provided mouse coordinates, and then
    * returns its number.
    * @param x x coordinate of mouse position.
    * @param y y coordinate of mouse position.
    * @return the number of the day bar, or -1 if no day bar was found at the
    * specified mouse coordinates.
    private int findDayBarNumber(int x, int y)
    for (int barNo = MAX_BARS - 1; barNo >= 0; barNo--)
    DayBar dayBar = visibleScheduleBars[barNo];
    if (x >= dayBar.getLeftAngleX() && x <= dayBar.getBarRightAngleX()
    && y >= dayBar.getBarBottomAngleY()
    && y <= dayBar.getBarTopAngleY())
    return barNo;
    return -1;
    * EVENT HANDLER METHODS *
    * This event handler is unused.
    * @param evt ignored.
    public void mouseClicked(MouseEvent evt)
    * This event handler is unused.
    * @param evt ignored.
    public void mouseExited(MouseEvent evt)
    * This event handler is unused.
    * @param evt ignored.
    public void mouseEntered(MouseEvent evt)
    * This event handler is unused.
    * @param evt ignored.
    public void mouseMoved(MouseEvent evt)
    * Called when the mouse button is released.
    * 1. Displays the right click menu if the right mouse button was clicked 2.
    * Updates 'last click position' fields 3. Modifies end time of current
    * selection
    * @param evt mouse event information.
    public void mouseReleased(MouseEvent evt)
    if (evt.isPopupTrigger()) // was the menu requested?
    displayRightClickMenu(evt);
    // Update 'last click position' fields
    lastMouseClickPositionX = evt.getX();
    lastMouseClickPositionY = evt.getY();
    if (pressedButton == MouseEvent.BUTTON3)
    { // selecting
    int barPositionX = lastMouseClickPositionX - barLeftX;
    int barPositionY = centreY - lastMouseClickPositionY;
    periodEndTime = findSlot(barPositionX, barPositionY);
    selection.setEnd(periodEndTime);
    * Called when mouse button is pressed. Updates slot with schedulable.
    * @param evt mouse event information.
    public void mousePressed(MouseEvent evt)
    if (evt.isPopupTrigger()) // was the menu requested?
    displayRightClickMenu(evt);
    lastMouseClickPositionX = evt.getX();
    int barPositionX = lastMouseClickPositionX - barLeftX;
    lastMouseClickPositionY = evt.getY();
    int barPositionY = centreY - lastMouseClickPositionY;
    periodStartTime = findSlot(barPositionX, barPositionY);
    if (periodStartTime == null)
    return;
    if (periodStartTime.getDayNumber() < 0
    || periodStartTime.getDayNumber() >= Schedule.N_SCHEDULES)
    return; // boundary case.
    pressedButton = evt.getButton(); // 1=left, 2=mid or wheel 3= right
    if (pressedButton == MouseEvent.BUTTON1)
    { // dragging
    // but maybe creating new selection too so...
    oldSelection = selection;
    currentPeriodEnd = barPositionY;
    currentPeriodWidth = 0;
    dayDrag = new Period(periodStartTime, periodStartTime);
    int s = periodStartTime.getSlotNumber();
    if (!createPeriods)
    return;
    daySched = schedule.getDaySchedule(periodStartTime.getDayNumber());
    draggedSlotBoundary = daySched.findNearBoundary(s, 3);
    if (draggedSlotBoundary < 0)
    if (s < 0 || s >= Slot.SLOTS_PER_DAY)
    return; // boundary case
    // Not near a boundary, so create seed slot for new
    // period
    if (daySched.getSlot(s) == palette.get(0))
    daySched.setSlot(s, palette.get(1));
    else
    daySched.setSlot(s, palette.get(0));
    draggedSlotBoundary = s;
    } else
    Schedulable SS = daySched.getSlot(draggedSlotBoundary);
    if (draggedSlotBoundary < s)
    daySched.insert(SS, draggedSlotBoundary, s);
    else
    daySched.insert(SS, s, draggedSlotBoundary);
    else if (pressedButton == MouseEvent.BUTTON3)
    { // selecting
    oldSelection = selection;
    periodStartTime = findSlot(barPositionX, barPositionY);
    selection = new Period(periodStartTime, periodStartTime);
    * Called when the mouse is moved while a button on it is held down.
    * Changes the end time of the selected Period.
    * @param evt information about the current mouse cursor state, e.g.
    * position.
    public void mouseDragged(MouseEvent evt)
    lastMouseClickPositionX = evt.getX();
    int barPositionX = lastMouseClickPositionX - barLeftX;
    lastMouseClickPositionY = evt.getY();
    int barPositionY = centreY - lastMouseClickPositionY;
    if (pressedButton == MouseEvent.BUTTON1)
    { // dragging
    Slot selectedSlot = findSlot(barPositionX, barPositionY);
    currentPeriodWidth = barPositionY - currentPeriodEnd;
    if (draggedSlotBoundary < 0 || selectedSlot == null)
    return; // out of bounds
    if (!createPeriods)
    return;
    for (int s = draggedSlotBoundary + 1; s < selectedSlot.getSlotNumber(); s++)
    daySched.setSlot(s, daySched.getSlot(draggedSlotBoundary));
    dayDrag.setEnd(selectedSlot); // or could use Selection instead
    if (pressedButton == MouseEvent.BUTTON3)
    { // selecting
    Slot selectedSlot = findSlot(barPositionX, barPositionY);
    selection.setEnd(selectedSlot);
    * Displays the right click menu.
    * @param evt information about the current mouse cursor state, e.g.
    * position.
    private void displayRightClickMenu(MouseEvent evt)
    // Calculate positions of mouse click relative to centre-left of
    // schedule bars display.
    lastRightClickPositionX = evt.getX() - barLeftX;
    lastRightClickPositionY = centreY - evt.getY();
    // identify bar to modify
    DayBar db = null;
    for (int barNo = MAX_BARS - 1; barNo >= 0; barNo--)
    DayBar currentBar = visibleScheduleBars[barNo];
    if (lastRightClickPositionX >= currentBar.getLeftAngleX()
    && lastRightClickPositionX <= currentBar.getBarRightAngleX()
    && lastRightClickPositionY >= currentBar.getBarBottomAngleY()
    && lastRightClickPositionY <= currentBar.getBarTopAngleY())
    db = currentBar;
    break;
    if (db == null)
    return;
    // identify 'selected' section/setting
    Slot t = findSlot(lastRightClickPositionX, lastRightClickPositionY);
    int slot = t.getSlotNumber();
    if (slot < 0)
    return; // out of bounds
    // find out colour of selected section
    selectedDaySchedule = db.getDaySchedule();
    Color colour = selectedDaySchedule.getSlot(slot).colour;
    // go left/back; find earliest section with this colour
    firstSlotNumber = slot;
    while (true)
    Color currentSlotColour = selectedDaySchedule
    .getSlot(firstSlotNumber).colour;
    if (!currentSlotColour.equals(colour))
    firstSlotNumber++;
    break;
    if (firstSlotNumber > 0) // lower boundary case
    firstSlotNumber--;
    else
    break;
    // go right/forwards; find latest section with this colour
    lastSlotNumber = slot;
    while (true)
    Color currentSlotColour = selectedDaySchedule
    .getSlot(lastSlotNumber).colour;
    if (!currentSlotColour.equals(colour))
    break;
    if (lastSlotNumber < Slot.SLOTS_PER_DAY - 1) // upper bound case
    lastSlotNumber++;
    else
    break;
    rightClickMenu.show(evt.getComponent(), evt.getX(), evt.getY());
    * Called when the user selects an item from the right click menu. Changes
    * the Schedulable for the selected Period to the requested value.
    * @param evt an ActionEvent, providing information about the command that
    * was selected from the menu.
    public void actionPerformed(ActionEvent evt)
    String command = evt.getActionCommand();
    if (command.equals("Copy day schedule"))
    if (!allowPaste) {
    * If the user copies a day schedule, we must enable
    * the paste option in the menu.
    JMenuItem menuItem7 = new JMenuItem("Paste day schedule",
    new ImageIcon("paste.png"));
    menuItem7.addActionListener(this);
    rightClickMenu.add(menuItem7);
    allowPaste = true; // only do this once
    int barNo = findDayBarNumber(
    lastRightClickPositionX, lastRightClickPositionY);
    DayBar db = visibleScheduleBars[barNo];
    /* It's important that we copy the day schedule by value, not by
    * reference. If we just copy a reference, then if we 'copy' a bar,
    * changing the source bar after the copy operation will change what
    * is ultimately 'pasted'.
    copiedDaySchedule = db.getDaySchedule().clone();
    else if (command.equals("Paste day schedule"))
    int barNo = findDayBarNumber(
    lastRightClickPositionX, lastRightClickPositionY);
    DayBar db = visibleScheduleBars[barNo];
    db.getDaySchedule().insert(
    copiedDaySchedule, 0, Slot.SLOTS_PER_DAY-1);
    else if (command.equals("Reset day schedule"))
    int barNo = findDayBarNumber(
    lastRightClickPositionX, lastRightClickPositionY);
    DayBar db = visibleScheduleBars[barNo];
    db.getDaySchedule().insert(
    defaultDaySchedule, 0, Slot.SLOTS_PER_DAY-1);
    else
    * Identifies which new Schedulable was requested. This Schedulable
    * will replace the selected Period's Schedulable value.
    * For instance, if "Away" was selected from the menu, then we must
    * fetch the "Away" Schedulable.
    Schedulable schedulable;
    if (evt.getActionCommand().equals("Set climate to 'Away'"))
    schedulable = palette.get(2); // the 'away' Schedulable
    else if (evt.getActionCommand().equals("Set climate to 'Sleeping'"))
    schedulable = palette.get(0); // the 'sleeping' Schedulable
    else if (evt.getActionCommand().equals("Set climate to 'Busy'"))
    schedulable = palette.get(1);
    else if (evt.getActionCommand().equals("Set climate to 'Relaxing'"))
    schedulable = palette.get(3);
    else
    // Should never occur
    throw new Error("Unrecognised command.");
    // Now fill the selected Period with the requested Schedulable.
    selectedDaySchedule.insert(
    schedulable, firstSlotNumber, lastSlotNumber);
    * User is able to edit schedule when boolean is set to true
    * @param createPeriods sets state of interaction with day schedules
    void setCreatePeriods(boolean createPeriods) {
    this.createPeriods = createPeriods;
    }

    Here is the Apple document covering Magic Mouse faults.  Symptom number 6 seems the one to check out.  Is this a longstanding or a recently developed fault?
    And, of course, is it still under the 12 month warranty.
    One thing to pay particular attention to is the proximity of electronic items such as cradles for phones and the like which if active, can interfere with the signal.
    Troubleshooting wireless mouse and keyboard issues

  • Multiple Movie symbols into one sprite sheet

    I have my character split into different symbols. Arms, Head, Body and so on. Each symbol (movie clip) has its own timeline of animation. How do I get all of my symbols into one clip without losing animation? I've tried selecting all of the symbols and and creating a new movie clip out of all of them together but when I try to covert to sprite sheet, it is just my entire character with no other sequences of movement on the sprite sheet.
    Thank you in advance

    There are a couple of things you could try depending on what exactly you need.
    1. Assuming your character has all the different body parts as separate symbols with their own animations within.
         a. Select all the body-part symbols in Library or on Stage, right-click and select 'Generate Sprite Sheet..' 
         b. Check the sprite sheet preview - each of the selected symbols are packed one after the other.
    2. If you have one Movieclip containing all the body part symbols and you wish to export the animation as it is ==>
         a. Double click on the main movieclip to get inside it.
         b. Select all the body part symbols on stage and change their instance type to Graphic in the Properties panel.
         c. Increase the frames in the main movieclip's timeline (press F5) to cover the entire animation of its children.
         d. Now generate the sprite-sheet for main movieclip from library or stage and check the preview.

  • Why are my sprites sheets not sizing/aligning properly?

    I'm trying to export my Flash animations as sprite sheets to import into the Unreal Engine.  But I keep running into issues where the reported sprite size/locations reported by Flash aren't quite right.
    My example generated sprite sheet, it was generated with no border/shape padding:
    The first bit of the sun.json file it generates, it says every frame is 214 x 214.
    {"frames": {
    "Sun Spin0000":
        "frame": {"x":0,"y":0,"w":214,"h":214},
        "rotated": false,
        "trimmed": false,
        "spriteSourceSize": {"x":0,"y":0,"w":214,"h":214},
        "sourceSize": {"w":214,"h":214}
    If I load the sprite sheet into cs6 and shrink the canvas size down to 214 x 214, you'll see the first frame is already starting to show tiny slivers from adjacent frames.
    I'm not using padding around the borders or between frames. You can see the there is enough padding already IMO.  The problem to me seems to be that Flash
    isn't properly outputting the the values into the JSON file, which then I'm using to import into the Unreal engine. If I can't trust these values to be correct,
    even if I were to add in padding to alleviate this, I will still have to manually adjust the frame size/locations of every frame of every sprite sheet by hand.

    what's the size of your untransformed suns?  are they 214x214?
    if so how are you loading your spritesheet and displaying the sprites?

  • What I do after generate sprite sheet?

    Hi,
    I generated my sprite sheet. I have two files. One png and one xml file. How do I use xml file in Flash? Is it possible to generate sprite sheet and use it in a movieclip?
    I want to put my animation on stage with programation (AS3).
    Thank you,
    Have a nice day.

    Please refer the tutorials here
    You will get an idea how sprite will use animations.
    . http://www.hsharma.com/tutorials/starting-with-starling-ep-1-intro-setup/

  • Distinguish left and right mouse click

    I am making some demo, I don't use any narration. How do I
    tell the viewer when to use left mouse click and when to use right
    mouse click? Can it be done automatically?

    Hello Simon,
    Hmmm, I don't think that there is anything in Captivate that
    will automatically let the leaner know that you are
    right-clicking...Here are some of the things that I might try.
    1. Adding a text caption that notifies the learner that I am
    right-clicking
    2. At the very start of the demonstration point out to
    learners that when they hear a certain sound this is an indication
    that I am right-clicking.
    3. Create a small animation that shows pressing the right
    mouse button
    4. Use one of the existing animations that you can find in
    the Adobe Captivate 2 gallery such as visual clicks and again point
    out at the beginning of the demo that when they see this animation
    you are performing a right-click action, you could also record or
    import audio onto your animation if you so desired.
    Those are my (of the top of my head) thoughts . I am sure
    that there are others.
    Regards,
    Mark

  • Adobe Edge sprite sheet doesn't show

    Hi,
    When importing animation from Edge to Muse using sprite sheet, I can see it work when playing automatically the Edge animation.
    But when enabling "Advanced 1 second every" feature, sprite sheet objects doesn't function.
    Any suggestions how to solve this?
    Thanks,
    Avi

    i did this before i started this thread ("do not download or install updates automatically")... it doesnt change anything.
    really, wouldnt be life easier if people would disable auto update on SAME window where updates popup? why we must spend our time for searching something that could be just next to info about new updates waiting for download? then wouldnt be this and thounds of other threads :/

Maybe you are looking for

  • Here's how I restored my mini from the dead (Win XP)

    When I installed the 1.4 updater on my iPod, it erased everything on it. Here's what I did to fix it: 1) Uninstall the 1.4 software 2) Disconnect the iPod from the computer, but do so safely, even if you have to reboot the computer. 3) Reset your iPo

  • How to create lossless PDF from DOCX?

    Hi everyone, Im currently trying to convert my Diploma´s Thesis to PDF but am having a hard time with the images. No matter which converter I try, the pictures come out skewed and low quality, just like below: Not only are the pictures skewed, but th

  • How to do spam-blocking in the flash form

    Hi, I designed form in the flash so i want to put the spam blocking in the form ... Then tell me the script. How ...... what are the code fot it reply me Thanks DDirector,

  • Deep structure output Issue:

    Hello everyone, I have an output form that simply contains billing document item records. Repeating subform works great. However I have been asked to make a more complex solution. I have been tasked to output the corresponding condition records for e

  • How much can macbooks take?

    Ok. I just installed windows 7 and am very happy with it. but, just wondering, are macbooks themselves made with the ability to game and download big torrent files? I don't wanna wear it down past its ability to function. I am turning into a big game