I need help looping animation

okay so i'm trying to loop the animation. i tryed using a for loop to loop it 4 times and it looped my trace statemnt 4 times but not my animation. any suggestions on how to loop the animation?
below is the code i have tried
import fl.motion.Animator;
for (var i:Number = 0; i < 5; i++)
trace(i);
var this_xml:XML = <Motion duration="449" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
<source>
<Source frameRate="19" x="0" y="0" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="cowanimation">
<dimensions>
<geom:Rectangle left="-8.5" top="-21.9" width="17.05" height="43.85"/>
</dimensions>
<transformationPoint>
<geom:Point x="0.49853372434017595" y="0.4994298745724059"/>
</transformationPoint>
</Source>
</source>
<Keyframe index="0" tweenSnap="true">
<tweens>
<CustomEase>
<geom:Point x="0.2096" y="0"/>
<geom:Point x="0.811" y="1"/>
</CustomEase>
</tweens>
</Keyframe>
<Keyframe index="194" tweenSnap="true" x="67.65" y="-80.3" rotation="60">
<tweens>
<CustomEase>
<geom:Point x="0.2096" y="0"/>
<geom:Point x="0.811" y="1"/>
</CustomEase>
</tweens>
</Keyframe>
<Keyframe index="240" tweenSnap="true" x="77.75" y="-62.25" rotation="-150">
<tweens>
<CustomEase>
<geom:Point x="0.2096" y="0"/>
<geom:Point x="0.811" y="1"/>
</CustomEase>
</tweens>
</Keyframe>
<Keyframe index="378" tweenSnap="true" x="17.35" y="13.05">
<tweens>
<CustomEase>
<geom:Point x="0.2096" y="0"/>
<geom:Point x="0.811" y="1"/>
</CustomEase>
</tweens>
</Keyframe>
<Keyframe index="448" tweenSnap="true" x="0" y="0" rotation="0">
<tweens>
<CustomEase>
<geom:Point x="0.2096" y="0"/>
<geom:Point x="0.811" y="1"/>
</CustomEase>
</tweens>
</Keyframe>
</Motion>;
var this_animator:Animator = new Animator(this_xml,this);
this_animator.play()

The problem with a for and while loop is that it will take complete the entire loop during the frame.  That is why u dint see it.  What u could do is increase the index by 1 each frame and then display that movie clip frame.  Via gotoAndStop(index).

Similar Messages

  • Need help with animation, for my XAML game

    Hello friends,
    I need help in creating animation for my snake and ladder game(C#,XAML). I have completed the game logic, but can't understand how to animate my UI.
    1. I want to animate 6 dice images so that when the player clicks on the Roll Dice Button a shuffle animation will play, and while the animation is playing the user can't click any thing.
    2. I want the player disc to move one step at a time (animation) on the game board.
    Please help me I am new to animation. Kindly give a reply

    Hello,
    I would recommend using
    Storyboards and / or the
    XAML animation library.
    Other resources:
    Storyboarded animations (XAML)
    XAML animation library sample
    I hope this helps,
    James
    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

  • Need help w/ animation in a for loop

    Hey all, its 1:33 am here... and im stuck as far as how to code to make the ball move...
    I should be able to do this... ive done it in other programs...in a way... but any help would be appricated.
    import java.awt.event.*;
    import java.awt.*;
    import java.applet.*;
    public class dolls extends Applet implements AdjustmentListener, ActionListener {
         Shirt myShirt;
         Pants myPants;
         Color c,sky,grass,smBall;
         Scrollbar red,green,blue,pantsRed,pantsGreen,pantsBlue;
         int redValue, greenValue, blueValue, pantsRedValue,pantsGreenValue,pantsBlueValue, ballsize = 0;
         Label redColor, greenColor, blueColor,shirtLabel, pantsLabel,pantsRedColor,pantsGreenColor,pantsBlueColor;
         Button shirt, pants, smallBall, bigBall;
         boolean clickedShirt = false, clickedPants = false,throwSB = false, throwBB = false;
         public void init(){
              // Labels and Sliders for the Shirt
              shirtLabel = new Label("Use the sliders to pick your shirt color");
              add(shirtLabel);
              redColor = new Label("Red");
              add(redColor);
              red = new Scrollbar(Scrollbar.HORIZONTAL,0,0,0,256);
              add(red);
              red.addAdjustmentListener(this);
              greenColor = new Label("Green");
              add(greenColor);
              green = new Scrollbar(Scrollbar.HORIZONTAL,0,0,0,256);
              add(green);
              green.addAdjustmentListener(this);
              blueColor = new Label("Blue");
              add(blueColor);
              blue = new Scrollbar(Scrollbar.HORIZONTAL,0,0,0,256);
              add(blue);
              blue.addAdjustmentListener(this);
              // Labels and Sliders for the Pants
              pantsLabel = new Label("Use the sliders to pick your pant color");
              add(pantsLabel);
              pantsRedColor = new Label("Red");
              add(pantsRedColor);
              pantsRed = new Scrollbar(Scrollbar.HORIZONTAL,0,0,0,256);
              add(pantsRed);
              pantsRed.addAdjustmentListener(this);
              pantsGreenColor = new Label("Green");
              add(pantsGreenColor);
              pantsGreen = new Scrollbar(Scrollbar.HORIZONTAL,0,0,0,256);
              add(pantsGreen);
              pantsGreen.addAdjustmentListener(this);
              pantsBlueColor = new Label("Blue");
              add(pantsBlueColor);
              pantsBlue = new Scrollbar(Scrollbar.HORIZONTAL,0,0,0,256);
              add(pantsBlue);
              pantsBlue.addAdjustmentListener(this);
              // Buttons for Shirts and Pants
              shirt = new Button("Add Shirt");
              add(shirt);
              pants = new Button("Add Pants");
              add(pants);
              smallBall = new Button("Throw a small ball");
              add(smallBall);
              bigBall = new Button("Throw a big ball");
              add(bigBall);
              myShirt = new Shirt(120,125,3);
              myPants = new Pants(120,125,3);
         public void adjustmentValueChanged(AdjustmentEvent e){
              redValue = red.getValue();
              greenValue = green.getValue();
              blueValue = blue.getValue();
              pantsRedValue = pantsRed.getValue();
              pantsGreenValue = pantsGreen.getValue();
              pantsBlueValue = pantsBlue.getValue();
              repaint();
         public void start(){
              shirt.addActionListener(this);
              pants.addActionListener(this);
              smallBall.addActionListener(this);
              bigBall.addActionListener(this);
         public void stop(){
              shirt.removeActionListener(this);
              pants.removeActionListener(this);
              smallBall.removeActionListener(this);
              bigBall.removeActionListener(this);
         public void paint(Graphics g){
              // sky
              sky = new Color(0,179,255);
              g.setColor(sky);
              g.fillRect(0,0,550,200);
              // grass
              grass = new Color(28,170,42);
              g.setColor(grass);
              g.fillRect(0,200,550,50);
              g.setColor(Color.black);
              // person
              g.setColor(Color.white);
              g.fillOval(150,100,30,30);
              g.setColor(Color.black);
              g.drawOval(150,100,30,30);
              g.drawLine(165,130,165,180);
              g.drawLine(165,133,120,160);
              g.drawLine(165,133,210,160);
              g.drawLine(165,180,143,235);
              g.drawLine(165,180,187,235);
              if(clickedShirt == true) {
                   c = new Color(redValue, greenValue, blueValue);
                   g.setColor(c);
                   myShirt.display(g);
              if(clickedPants == true){
                   clickedPants = true;
                   c = new Color(pantsRedValue, pantsGreenValue, pantsBlueValue);
                   g.setColor(c);
                   myPants.display(g);
              if(throwSB == true){
                   int sx = 205;
                   int sy = 160;
                   int times;
                   smBall = new Color(153,255,0);
                   g.setColor(smBall);
                   g.fillOval(sx,sy,10,10);
              if(throwBB == true){
                   c = new Color(255,128,0);
                   g.setColor(c);
                   g.fillOval(195,150,20,20);
         public void actionPerformed(ActionEvent ae){
              if(ae.getSource() == shirt)
                   clickedShirt = true;
                   repaint();
              if(ae.getSource() == pants)
                   clickedPants = true;
              if(ae.getSource() == smallBall)
                   throwSB = true;
              if(ae.getSource() == bigBall)
                   throwBB = true;
    // <applet code = "dolls.class" height = 300 width=550> </applet>code for pants.class
    import java.awt.*;
    public class Pants {
    Polygon pants;
    public Pants(int h, int v, int size){
    pants = new Polygon();
    pants.addPoint(10*size+h,18*size+v); // 1
    pants.addPoint(20*size+h,18*size+v); // 2
    pants.addPoint(25*size+h,35*size+v); // 3
    pants.addPoint(18*size+h,35*size+v); // 4
    pants.addPoint(15*size+h,27*size+v); // 5
    pants.addPoint(13*size+h,35*size+v); // 6
    pants.addPoint(05*size+h,35*size+v); // 7
    public void display(Graphics g){
    g.fillPolygon(pants);
    code for shirts.class
    import java.awt.*;
    public class Shirt {
    Polygon shirts;
    int h;
    public Shirt(int h, int v, int size){
    shirts = new Polygon();
    shirts.addPoint(12*size+h,1*size+v); // 1
    shirts.addPoint(18*size+h,1*size+v); // 2
    shirts.addPoint(29*size+h,9*size+v); // 3
    shirts.addPoint(26*size+h,12*size+v); // 4
    shirts.addPoint(20*size+h,8*size+v); // 5
    shirts.addPoint(20*size+h,20*size+v); // 6
    shirts.addPoint(10*size+h,20*size+v); // 7
    shirts.addPoint(10*size+h,8*size+v); // 8
    shirts.addPoint(4*size+h,12*size+v); // 9
    shirts.addPoint(1*size+h,9*size+v); //10
    public void display(Graphics g){
    g.fillPolygon(shirts);

    all fixed...

  • Need help exporting animation to Wordpress (I've looked at all the tutorials I could find).

    Alright, I've been working on a slide show animation for sometime now, but I need to export it to wordpress and I can't exactly understand how to do it correctly. I've even used the edge wordpress plugin, but it doesn't seem to work at all (I tried on two different sites, first seems to be a projram script error, the other site didn't upload anything). I've done a few of the tutorials floating around but none of them make sense to me, I don't know exaclty which parts of code to edit and in which clients to work them in. If someone could help make these five hours of confusion make sense for me that that would be amazing.
    Where should I start on trying to get my animation to wordpress?

    I've come with the same issue myself. I love Adobe Edge and i find it dead easy to make wonderful stuff there, though making it work in Wordpress has become a challenge. I followed the instructions in this video and in this guide and they seem to work only if you happen to use wordpress with a plain theme with no fancy jquery animations and functionality using these libs. I tried intergrating an Edge animation in my wordpress site, though because i happen to use a theme with a slider which uses jquery, when following the instructions step by step then neither the slider worked neither the edge animation itself. I found somewhere that you need to edit some .js libs using the noconflict mode though that did not work either (it was an example for joomla).
    I tried installing the Edge Suite wordpress plugin which is still in developing stage. You need to export your Edge composition using the File > Publish tool found in edge in order to import the .aom files. Unfortunatelly no luck with that. I'm still looking for a solution in order to make animations for my website. I sent a tweet to Adobe Edge and they refered me to the support forums. Uhg!
    I'm sure there's a workaorund using the .js libraries. Im not experienced with them so i'll have to wait for a solution to come about. I'm sorry for not helping though be sure to check the links above

  • I need help with animation with progress bar.

    Hi,
    I need some help with creating something similar to this site (window opening animation with scrub bar):
    http://www.drutex.pl/pl/oferta/okna/okna-pvc/okna-pvc-iglo-5.html
    I'm kinda new to flash and all so some tutorials for such thing would be helpful.
    Thanks in advance
    Oscar

    What this will involve is a movieclip/timeline containing images showing the sequence of the motion (like the frames of a movie film) and a Slider component that changes the frame of that movieclip/timeline based on its position.
    Here is a link to an Actionscript 3 sample file that demonstrates a Slider providing the control of the timeline...
    http://www.nedwebs.com/Flash/AS3_Slider.fla
    You could edit the looks of the Slider component if you like by doubleclicking it and the inner parts you want to modify, or you could create one of your own if you have enough know-how to code it to work.

  • I need help with animation, PLEASE help!

    I am trying to create pacman animation by using a series of filled arcs that I create by coding in java. I know how to create the arcs, but I don't know how to use them to create animation. In other words I don't know how to put them in sequence to create animation.
    I have searched the web, and all I find is animation that use a series of GIF or JPEG images.
    can you please help me or point me to the right direction.
    by the way, which of these two animation would run faster? The one that uses GIF images, or the one that would use shapes created in java?
    Thanx

    Perhaps you could do this two ways
    One way, (im not sure if this will work), is to create a .gif file that is already animated. An open mouth animated to a closed mouth. But i don't know if Java will accept this.
    The second way would be to create a Thread. And to create however many images you want to display the open to closed mouth. Then continuously change the image so it appears the mouth is opening and closing.
    Put in a delay so it doens't go too fast, and there ya have it.
    Public void run()
    int i =0;
    while(true)
    myThread.sleep(10);
    image = difImage;
    }something like that. Might used a bufferedImage and make just use subImage to pull off each picture you need to change.

  • Need help importing animated gif by ImageIcon in Japplet

    Hello. Im new to Java, but I want to import this animated gif with Java in a Japplet using ImageIcon, but it does not work and I would really appreciate if anyone could help me with this.
    import java.applet.*;                                   
    import java.awt.*;   
    import java.net.*;
         public class Bilder extends Japplet{                               
         public ImageIcon(java.net."http://pixelninja.se/kappawin.gif");
      Image[] bild = new Image[1];                            
      int nr=0;                                                
      public void init(){                                     
        setBackground(Color.black);                         
        bild[0] = getImage(getCodeBase(),"4a.gif");     
      public void paint(Graphics g){
        g.drawImage(bild[0],50,50,212,282,this);
    }

    You cant do animated gifs this way.
    Also you should remember that you cannot load images in to an applet if it is hosted somewere else than the host that hosts the applet.
    Esiast way to display an image icon with a animated gif will be creating a Image Label and adding it to the applet.
    Ex:-
    public class MyImageApplet extends JApplet{
       public void init(){
          getConentPane().setLayout(new BorderLayout());
           URL imageURL = getClass().getResource("/myImage.gif"); 
          // Above image file should be in the code base or in the archive file of the applet
          getConentPane().add(new JLabel(new ImageIcon(imageURL)));
    }

  • Need help with animated JLabel

    I've created an animated extension of the JLabel which imitates a "typewriter" effect. It works smoothly for single-line labels.
    Here is a basic pseudo-code outline of how I went about doing it:
    constructor(String fullText, int delay) {
      create swing timer
      start timer
    //called by timer
    actionPerformed() {
      if (all chars are printed)
        stop timer
      else {
        labelStr += fullText.charAt(pos);
        this.setText(labelStr);
        pos++;
    }The problem is, whenever It recognises an HTML line break (to make it a multi-line label), all of the text gets bumped up. Here's a rough animation showing my animated label and a regular jlabel...
    http://img223.imageshack.us/img223/8459/typewriteranizy1.gif
    As you can see, once the line breaks are added to the animated label's text, all the text is moved up. This creates a choppy scrolling effect, something I'm trying to avoid at the moment.
    Any ideas on how I could keep the animated text in a fixed position, so it doesn't scroll up like this?
    I can provide source code if needed.

    Ah yes, my bad. I tried it now but realised I have tried it before, and it doesn't work. i never increments and so it prints the first character every time the timer fires instead. Here is a SSCCE:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TW extends JFrame implements ActionListener
         JLabel iValue = new JLabel("i = ");
         JTextArea log = new JTextArea(10, 20);
         JButton start = new JButton("Start");
         Timer type;
         public TW()
              setLayout(new BorderLayout(0, 0));
              log.setEditable(false);
              log.setLineWrap(true);
              log.setWrapStyleWord(true);
              add(iValue, BorderLayout.PAGE_START);
              add(log, BorderLayout.CENTER);
              add(start, BorderLayout.PAGE_END);
              start.addActionListener(this);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setLocationRelativeTo(null);
              setVisible(true);
         public void actionPerformed(ActionEvent e)
              ActionListener listen = new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        int i = 0;
                        String msg = "This is a simple typewriter demo.";
                        if (i < msg.length())
                             String str = (String)new Character(msg.charAt(i)).toString();
                             log.append(str);
                             iValue.setText("i = " +i);
                             i++;
                        else
                             type.stop();
              type = new Timer(250, listen);
              type.start();
         public static void main (String[] args)
              new TW();
    }

  • [need help with animated gif - shows up fuzzy on IE]

    Hi,
    I created an animated gif in photoshop cs3 with combination of text and images in Mac.  For some reason, the text on the banner looks fuzzy on Internet Explorer. Do any of you know what is wrong with the banner?  Can anyone help me on this?
    Thanks

    How does it look in Firefox on Windows? By only testing one browser on Windows, you cannot determine if it is a matter of the browser or the overall settings for the computer.
    Do you have a page to share so that we can see the fuzziness or can you post the GIF file here?

  • I need help with animating a walk cycle

        I have a person created and have a script that helps everything move right I am just having trouble getting the walk cycle to look and act properly. I want to use the loopOut expression to use this composition in another movie. Any help offerend would be greatly appreciated.

    Mylenium is correct, I've animated quite a few walk cycles in various different techniques and all I can say is that each technique is so radically different it really just depends on how and what you're trying to achieve.  Not only that, the quality of the movement in the animation itself so much depends on the feeling and story you're trying to get across.  What looks wrong to someone, might look right to someone else.  You might want a totally weird walk cycle for your character becuase that might tell the audience something completely different about who and what they are.  Without seeing anything there's no possible way to advise.  In the meantime, I highly recommend looking at a hand-drawn film from 1978 called "Satiemania" by Zdenko Gasparovic.  The beginning is all walk cycles of different types and I think it could be inspiring for any character animator who's interested in animating walk cycles.

  • Really Need Help! Animating a wavy line.

    Would really appreciate some help with this.
    Here's what I'm trying to do: An animation of an aeroplane
    that flies from point A to point B on a map. (along a motion
    guide), but does so in a rather haphazard fasion, doublinkg back on
    itself, crossing over it's previous path and generally going all
    over the place.
    Easy to do with a motion guide, obviously. What I would
    really like to do however is to have the route my Aeroplane has
    taken appear in red as the aeroplane moves along it's guide.
    Essentially, A line that increases in length along a very squiggly
    path!
    I've tried using masks with a predrawn line, but that's
    generally quite impractical beccause to do a line of any
    complexity, you may as well draw each frame individually, there are
    so many different masks and layers involved.
    Does anyone know of another way of doing this??
    Cheers. Ben

    If this is purely a timeline animation, then in the timeline you can have commands at particular frames to tell the character to change to its appropriate frames at the different stages of the circular path.

  • 5800 5530 models: Need help for animated wallpaper...

    Hi!
    I have some questions... Does the 5800 and 5530 supports .GIF files on wallpaper usage? I have tried using .GIF files as wallpapers on both phones but it only displays as a "picture"... not animated. But when I view those .GIF files under Gallery, all is fine.
    If it is not possible on both phones... is there a 3rd party software that I can use or any ways to do it?
    I would really appreciate all your responses!
    Thank you so much!

    Try here
    http://www.tehkseven.net/theme/nokia-5800-themes.html
    Good Luck
    If I have helped at all, a click on the White Star is always appreciated :
    you can also help others by marking 'accept as solution' 

  • Need help with animation that triggers on MouseEvent

    I have four movieclips on a stage that when you roll over any of them it triggers another movie clip on the stage to play from a certain frame.
    In this instance plaz is a movieclip, mcTher is the movie clip I am trying to get to play through its animation.
    Here is the code for one of the clips the others are nearly identical.
    plaz.addEventListener(MouseEvent.MOUSE_OVER,function(evt:MouseEvent){lightCenter(evt,mcThe r)},false, 0, true );
    plaz.addEventListener(MouseEvent.MOUSE_OUT,function(evt:MouseEvent){dimCenter(evt,mcTher)} ,false, 0, true );
    function lightCenter(evt:MouseEvent, msg) {
    //msg is capturing which movieclip to play based on which button you've rolled over
    trace(msg);
    msg.gotoAndPlay(2);
    //msg is a fifteen frame 'classic tween' frame one has a stop() action and represents the static state.
    //Frame 5 has  stop action on it at this point the clip has changed color
    function dimCenter(evt:MouseEvent, msg) {
    trace(msg);
    msg.gotoAndPlay(6);
    //Frames 6 - 15 return the clip back to its static state
    The problem I am experiencing is after rolling in and out of buttons for a short period one of the movie clips will freeze on frame 5
    msg will;
         either stop getting passed all together
         or
         will only be passed on the the rollover event of the last clip I rolled over
    Any thoughts or suggestions would be greatly appreciated.

    that should be:
    kglad wrote:
    if plaz is a movieclip it would be preferable to encode that like so:
    plaz.mc=mcTher;
    plaz.overframe=2;
    plaz.outframe=6;
    plaz.addEventListener(MouseEvent.MOUSE_OVER,overF,false, 0, true );
    plaz.addEventListener(MouseEvent.MOUSE_OUT,outF,false, 0, true );
    function overF(evt:MouseEven) {var mctarget:MovieClip=MovieClip(evt.currentTarget);
    mctarget.mc.gotoAndPlay(mctarget.overframe);
    function outF(evt:MouseEvent) {var mctarget:MovieClip=MovieClip(evt.currentTarget);
    mctarget.mc.gotoAndPlay(mctarget.outframe)

  • The product that I purchased is not working!!!! I need help and I've been stuck in your "Contact us loop" for the last few days and I'm getting frustrated. How do I contact you for HELP!

    The product that I purchased is not working!!!! I need help and I've been stuck in your "Contact us loop" for the last few days and I'm getting frustrated. How do I contact you for HELP!

    Probably the best place to start is the right forum for your product. This is the forum for Distiller Server, a long dead product used by big companies, and probably not what you have. If you can't find the right forum, please let us know the FULL name of what you paid for (please check your invoice, as Adobe have many similar products), and we can perhaps direct you. Good luck!

  • NEED HELP!!! Flash Animation (MAC) play back on PowerPoint (PC)

    NEED HELP!!! Flash Animation (MAC) play back on PowerPoint
    (PC)
    Shockwave Flash Animation is complete.
    We want to change the Flash Animation w/video (MAC) files to
    QuickTime files.
    Then change the QuickTime files using Adobe Premiere®
    Pro CS3 to an MPG level 1 file (not level 4)
    Must be expert in:
    Shockwave Flash Animation (MAC)
    QuickTime (MAC)
    Adobe Premiere® Pro CS3 (MAC or PC)
    AdobePowerPoint (PC)
    Virtual,Telephone or inperson heip on how to make a Shockwave
    Flash Animation (MAC) play back on PowerPoint PC

    (This is the Adobe Scout forum for game developers, you should try the Flash Player forum)
    To install Flash Player, try this link: http://get.adobe.com/flashplayer/

Maybe you are looking for

  • Infinity order in crisis

    My first post in the forum is about ordering issues, I cannot resolve this through the normal route, having tried numerous times including discussions with Easy Assist and Infinity Order Management. In summary I ordered Infinity 1 by mistake and what

  • Adobe Flash Player not working in Adobe Connect only on Tablet PC

    When logging into Adobe Acrobat Connect Pro on a Tablet PC, the following message is observed. Flash Player 9.0.0.0 or above is required Adobe Acrobat Connect Pro requires the Flash Player browser plugin, version 9.0.0.0 or above. Please download and

  • Apple logo is it a light ?

    if it is how do i turn it on it looks like a light :P

  • Autonumber in a Sequence after Export/Import

    Hi, I have a sequence running in a DB, which increments an ID field. The problem comes up, when I need to backup/restore the DB. What I need then is a SQL script, which would allow me to set the MinValue to the max used value +1 (or + 100). Unfortuna

  • After exporting, the sound in some areas goes crazy

    So like the title explains, after exporting the sound in a couple of areas goes crazy, like static. I tried twice, still the same result. NB: I exported in H.264 in Apple devices 1080p, MBP retina 15 inch 2.6 GHz i7, FCPX 10.0.8 Thank you