Problem with animation loop in AS3

I'm having a problem doing an animation loop (a walk cycle in
this case) in CS3. I never had this problem in Studio 8 and am
wondering if I've gone crazy or if something has changed in CS3.
The animation cycle works fine so long as I have it loop
without using ActionScript, but when I try to loop it using
gotoAndPlay it skips the last frame (i.e., the frame that the code
is on). I tried adding an extra frame at the end and placing the
code on it... it works a bit better, but there's still a bit of odd
timing during the looping.
Interestingly, when I save the fla as a Studio 8 file, it
works fine (if I include that extra frame at the end). I may be
misremembering, but it seemed to me that Studio 8 didn't require
that extra frame before CS3.
Has anyone else seen this? Anyone have a solution to share
(I'm planning to use ActionScript3, so saving as Studio 8 won't
solve my problems)?

Sim-Enzo,
> Interestingly, when I save the fla as a Studio 8 file,
it works
> fine (if I include that extra frame at the end). I may
be
> misremembering, but it seemed to me that Studio 8 didn't
> require that extra frame before CS3.
It shouldn't require that extra frame, but I wonder if
you've somehow
configured your FLA's publish settings for a version of
ActionScript you're
not actually using.
> Has anyone else seen this? Anyone have a solution to
share
> (I'm planning to use ActionScript3, so saving as Studio
8
> won't solve my problems)?
If your file works fine in Flash 8, then you must be using
ActionScript
2.0 (or lower) for the time being. Based on what you've
described, I can't
imagine what's going awry. Can you make that FLA available
online
somewhere? See if you can reproduce this issue with a
simplified version,
in case your company's policies (or whatever reason(s)) keep
you from
uploading the real file somewhere.
I'll take a look.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."

Similar Messages

  • Script for saving GIF with Animation Loop Endless

    Hi,
    I am searching for a way to use  "save for web" in a Photoshop CC Script.
    I already found how to use the "save for web" using Script, but now i am stuck, because i cannot find any information on how to set
    that the animation, i want to save as a Animated GIF File, can be set to loop endless.
    I already tried to search in all the docs i found about scripting, but there is not a single information about saving gif with animation loop endless...
    thanks,
    Philipp

    When you do use "save for web" and select GIF, on the bottom right, the loop mode can be selected. But i think i wouldn't matter to me if it's being set before saving the image.
    I already tried to run the script, but somehow
    "charIDToTID('Ordn')" for example won't run. Is this the same as charIDToTypeID? because i found charIDToTypeID is a function, but charIDToTID is not...
    also the third line from the end, one of the functions seem not to work, i think....
    But already you given me a real good answer to what i may try to search for, since i did not actually know that this is set within the timeline, i always used the option within the "save for web" dialog on the bottom-right.
    I Solved my own problem ...
    I just made Photoshop CC with a script log everything, then gotten to this:
    function setLoopForever() {
    var idsetd = charIDToTypeID( "setd" );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref2 = new ActionReference();
            var idanimationClass = stringIDToTypeID( "animationClass" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref2.putEnumerated( idanimationClass, idOrdn, idTrgt );
        desc5.putReference( idnull, ref2 );
        var idT = charIDToTypeID( "T   " );
            var desc6 = new ActionDescriptor();
            var idanimationLoopEnum = stringIDToTypeID( "animationLoopEnum" );
            var idanimationLoopType = stringIDToTypeID( "animationLoopType" );
            var idanimationLoopForever = stringIDToTypeID( "animationLoopForever" );
            desc6.putEnumerated( idanimationLoopEnum, idanimationLoopType, idanimationLoopForever );
        var idanimationClass = stringIDToTypeID( "animationClass" );
        desc5.putObject( idT, idanimationClass, desc6 );
    executeAction( idsetd, desc5, DialogModes.NO );
    Works perfect!

  • Problem with animated .gif

    I have a problem with animated gifs. So if I set a animated gif as background and a button is over it as in the example below, then everytime the animation goes on the button disappears until I go over it with the mouse. So what can I do to solve this?
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    public class FrameBackImage {
              public static void main(String args []){
                   final JFrame frame = new JFrame("Frame");
                   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   frame.setSize(400, 400);
                   frame.setResizable(false);
                   frame.setLayout(null);
                   java.net.URL imageURL = ImageApp.class.getResource("animatedw.gif");
                   ImageIcon imageIcon = new ImageIcon(imageURL);
                 final JLabel label = new JLabel(imageIcon);
                 label.setBounds(0,0 , 400, 400);
                 frame.getLayeredPane().add(label);
                 JButton button = new JButton ("Exit");
                 button.setBounds(200, 129, 60, 60);
                 button.setBackground(Color.black);
                 button.setForeground(Color.white);
                 frame.add(button);
                 button.addActionListener(
                 new ActionListener(){
                        public void actionPerformed(ActionEvent arg0) {
                             System.exit(0);
                 frame.validate();
                  frame.setVisible(true);
    }

    In the future, Swing related questions should be posted in the Swing forum.
    Your usage of the getLayeredPane() method is something I've never seen before, so I don't know if thats the problem or not.
    How to display a "background image" is asked all the time in the Swing forum. So to familiarize yourself with the forum you can try searching the Swing forum. Using the keywords I highlighted would be a good place to start.

  • Quality problem with animated gif through flash

    i got a problem with making animated gif through flash.
    on html/swf publication it looks clear.
    but the weird thing is through gif publication, it wouldn't show. and exporting it as a movie as gif cause visual defect when put up on web.
    it looks better when you open it in a browser.
    this is how it looks for a profile gif in thumbnail mode. blocky and unclear.
    how do you get it to look good both in thumbnail mode and in browser mode. i seen other that have a clear gif in thumbnail mode.  are my setting wrong for flash? or should i just do gif in photshop instead. i heard rumors flash don't do gif very well.

    Change your gif export setting under publish...
              Dimensions         : Match movie
              Playback             : Animated
                                        : Loop continuously
              Options               : Optimize colors
                                        : Smooth
              Transparent         : Opaque
              Dither                 : None
              Palette Type       : Adaptive
              Max colors         : 99999

  • Safari 4: Problems with animated GIF

    Hi,
    since I've updated to Mac OS X 10.6 my Safari 4.0.3 has Problems with some animated GIF.
    Some of these smileys look strange.
    OS: Mac OS X 10.6.1
    Mac: iMac (24-inch Early 2008)

    HI,
    Apparently you aren't alone.
    http://discussions.apple.com/thread.jspa?messageID=10059219&#10059219
    Carolyn

  • Qsm pc, problem with stop loop

    Hello,
    i tested queue producer/consument with event case, but i have problem with stop the both loop, can you help me with attachment ?
    Attachments:
    queue_mereni_1.zip ‏46 KB
    Global_queue.zip ‏3 KB

    thanks for your answer,
    i had problem with upload *.vi (some mistake), so when a upload *.zip it was ok, but i do not know why..
    please, when i put time out constatn, so when i push "stop" then both loops end - it is ok BUT:
    when i push "stop 2" button (for the second loop) so there is error (in attachment), please do you know why?
    i am sorry for a lot of questions but i try understand it..
    thank you
    Attachments:
    qsm.jpg ‏31 KB

  • Problem with a loop

    Hello All
    I'm working on a Flash Gallery and I'm having some issues
    with a loop and it's probably something simple I don't know so I
    thought I'd see if someone can help me.
    the problem is that once the thumbnail panel is populated the
    image I want to display from a rollover is no longer defined. As I
    mentioned I was hoping someone could shed some light on this.
    [code]
    // create the thumbnail panel
    var i = -1;
    while(++i<thumbList.length) {
    name = "item"+i;
    thumbs_mc.duplicateMovieClip(name,i);
    this[name]._x = i*spacing;
    this[name].contentPath = "children/" + thumbList
    // show the larger pic on rollover
    this[name].onRollOver = function() {
    picture.contentPath = "children/" + thumblist;
    [/code]
    by using this I get an error of: "error opening
    URL...undefined"

    mark2685 wrote:
    Well, the array of student objects is larger than 2, there are about 6 students so it would have to get the highest from TestScore 1 and the lowests from TestScore 2 out of all of the students, not just those 2. And I want the entire object stored in the chessTeam array. Does this make sense?No you're not reading my code right (BTW - add an open brace on the for loop top and set score2 to 101), or else I'm not understanding you requirements correctly. The student array can hold as many Students as needs be. You stated that you have only two scores that you care about and so that's the 1 and the 2. Based on the Student class you've shown us, this should work, but you'll have to try it before you know.

  • Problems with animations on tablet version

    I've been having problems with the tablet version of my site. I want it to work in a tablet version as well as it works on the desktop, because my site is for kids and so many kids use tablets now, so it is important to me. I have 3 Edge Animate little animations. One works perfectly, one only part of the animation even appears, and the third does not appear at all. Can someone help me, please? http://iampuppylove.businesscatalyst.com
    Thank you so much!

    Can you try placing the edge animate files on a regular web page outside of Muse and see if it works on your tablet?  If it does, please send the edge animate files in with your muse file to [email protected]  Also, include the tablet type and OS version.   cheers, Justin

  • Probably simple problem with while loops

    I was programming something for a CS class and came across a problem I can't explain with while loops. The condition for the loop is true, but the loop doesn't continue; it terminates after executing once. The actual program was bigger than this, but I isolated my problem to a short loop:
    import java.util.Scanner;
    public class ok {
    public static void main(String[] args){
         Scanner scan = new Scanner(System.in);
         String antlol = "p";
         while(antlol == "p" || antlol == "P"){
              System.out.println("write a P so we can get this over with");
              antlol = scan.nextLine(); 
    //it terminates after this, even if I type "P", which should make the while condition true.
    }

    Thanks, that worked.
    I think my real problem with this program was my CS
    teacher, who never covered how to compare strings,Here's something important.
    This isn't just about comparing Strings. This applies to comparing ANY objects. When you use == that compares to see if two references refer to the same instance. equals compares objects for equality in the sense that equality means they have equal "content" as it were.

  • A problem with for loop..

    i have a problem with this code :
         int [] P = new int [M.length];
         System.out.println(P[0]+" "+P[15]);     
         for (int i = 0 ; i < P.length ; i++){
         for (int j = i + 1 ; j < P.length ; j++){
              if (j == (P.length - 1) && M [ i ] != M [ j ]){
                        P [ i ] = M [ i ] ;
                   else if ( M [ i ] != M [ j ] ) continue ;
                   else break;
         for (int i = 0 ; i < P.length ; i++){
              System.out.println(P [ i ]);
    this code to copy distinct values in array M and print them into array P
    M and P are both of size 16
    the problem is the previous code doesn't work for P[15]
    and i don't know way
    if i have in M {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
    P will be {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}
    could any body help ?

    I am sorry, but you are not done. May-be your code does what it is supposed to do but it is hard to understand. An important part of programming is not just to get your code to work, but to write code that is easily maintainable. You are probably quite new programming and I do not want to discourage you. Keep working hard and it will come.
    You almost had the solution a while back:
            int [] P = new int [M.length];
         System.out.println(P[0]+" "+P[M.length]);
            boolean unique;
         for (int i = 0 ; i < P.length ; i++){
             // All non-zero entries in P with index less than i are unique in M.
               unique = true; //Assume M[i] unique until contrary has been proven
            for (int j = 0 ; j < P.length ; j++){
              if (i != j && M[i] == M[j]) { //found another entry in M with the same value as M[i]
                            unique=false;
                   break;
               if (unique) { // M[i] is unique in M.
                  P[i] = M;
         for (int i = 0 ; i < P.length ; i++){
              System.out.println(P [ i ]);
         }This code executes in time O(n^2). It is possible to achieve O(nlog(n)) by
    1) copy M into P
    2) sort P
    3) iterate through P and set duplicates to 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem with animation and separate CPU intensive thread.

    Hi All,
    I'm in the process of writing a Java chess game with a computer AI. I've got everything working except for the animation of the computer making its move. Sometimes it works, sometimes it doesnt.
    Here's the problem:
    After the computer has finished deciding what move to make (CPU intensive - using standard Minimax w/ Alpha Beta pruning), the thread terminates passing the move to the animation thread (implemented using javax.swing.Timer). My delay is set to 50. But the multiple calls to repaint() in the Timer thread all get collapsed into one (they somehow get bunched up) causing a major display glitch!
    Sometimes this happens, sometimes it doesnt. I wanted to know if i could write some kind of wait function to wait until the CPU is free to process quick repaint() requests so that my animation can look descent all the time.
    Thanks for any help.
    jairam at ecf dot utoronto dot ca

    In the javax.swing.Timer class is a method called
    setCoalesque(boolean) (I think I spelled that wrong, but you will find it)
    By default the Timer class does exacltly what you mentioned, it merges multiple events into one when the application is too busy. Call setCoalesque(false) to receive all the events from the Timer.

  • Problem with animated gif image getting displayed

    My problem is that my animated image does not get displayed properly. I am extending JButton and the button already contains a static image. I want to display the animated image over the static one for some reason. If I replace the animated image with a static gif, then there is no problem.
    Here is the code that I am using
    Icon anim = new ImageIcon((new ImageLoader()).getImage("/graphics/busy.gif"));
    // thread to call displayAnim method
    class ColorThread extends Thread {
    ColorThread() {
    public void run() {
    while (AnimFlag) {
    try {
    displayAnim();
    Thread.sleep(400);
    } catch (InterruptedException e) {
    public void displayAnim()
    repaint();
    public void paint(Graphics g)
    super.paint(g);
    int x=5;
    int y=0;
    if ( AnimFlag) {
    anim.paintIcon(this,g,x,y);

    This code is working fine for JRE 1.2 and the animation is displayed. The problem is with JRE 1.3. when there is no animation, neither is there any image getting displayed.

  • Duration problem with animated gif

    Hi!
    I love the animated gif feature and have used it several times successfully.
    This time, it seems to ignoring my settings for duration. I've set the number as high as 1500/100, but when I preview in browser (Mac Safari or Firefox), the images just whip by. I did slice the animated area and optimize it as an animated gif and export it. When I worked with it again this morning, the first image reflected the 1500/100, but the rest are still racing. I've tried to attach file here.
    Also, I'm wondering if this really should be done in Flash rather than FW. The client wants maybe 5 or 6 images and with the 7 test I have now, I see we're at 216K file size. I don't know flash but if the blog theme we use doesn't have something set up, I assume I'll just outsource the Flash development.
    Thanks,
    Caryn

    Okay...it works for me, but....
    One thing to be careful of is saving vs. exporting. When you create your file, you should save it as a Fireworks .png document. Then, to produce your animated .gif, you should export it. I like using the Image Preview (under the File menu), as I can tweak any of the settings I want. Other people prefer the Export item and optimize their output.
    There are two kinds of .png files. A Fireworks .png has all the layers, vector shapes, Web layer, active filters, and special proprietary information that Fireworks uses. A flattened .png is just a bitmap, whether it has 32, 24, or 8 bits. There's no distinction between these files based on the extension. Another user once suggested using .fw.png for Fireworks documents and .png for exported .pngs and I found that a good suggestion.
    In any case, a good rule to follow is to use save when you want a Fireworks .png and export when you want a Web-ready bitmap of any format.
    So, this is my "but." I took your file and changed the durations of the other frames. I saved it as a Fireworks .png. I then went to File > Image Preview and selected Animated GIF as the format. From the Animation tab, I set the number of loops to 3 and exported. I then saved the .png again to store the loop information.
    Here's the .png (474k):
    Here's the animation (303k):
    Given that the .gif format does't have the colors to reproduce photographs well, I still recommend you look into image rotators. These are scripts that can cycle through a set of images. See this thread:
    http://forums.adobe.com/thread/518231?tstart=1

  • Problems with animated masks and external images

    I have an instance of a movieClip on the stage and I load an external JPG into the movieClip.  The movieClip is masked by a layer that begins animating on a certain frame.  As soon as I reach that frame my externally loaded JPG disappears.  The movieClip doesn't mind being masked, but as soon as the mask animates the external image goes away.  The mask animation is shapes drawn frame by frame.
    It is interesting to note that if I create a Class and load the JPG into the movieClip (or do this in a constructor) I do not experience this problem - it is when the JPGs are loaded into an instance of the movieClip that lives on the stage that I encounter this. Unfortunately that is not an option in my project (since I have to get the path for the JPG from an xml file I am loading).
    Could someone please help me with this?

    that's a flash bug.

  • Having problems with animation in PSE4

    Admittedly, I am a newbie to animation, though I do know how to create an animated .gif.
    I am on a Mac - OS 10.3 --
    My problem however, is keeping my background from being part of the animation. To be
    clearer --- what I wish to do is create my background image (which often involves many layers) -
    and then have only part of the finished image animate. For example - having a twinkling
    border of stars around a picture. Whenever I "save for web" and enter the appropriate settings
    the entire picture animates rather than just the star border. How do you animate only certain
    layers and have the other layers remain stationery?
    Can anyone help me with this issue please? My primary concern is that Elements is not the appropriate program to do what I wish to do---and perhaps I need additional plug-ins or a different program altogether. Have read the Help manual and bought the book - neither say anything about what I want to do.
    Thanks in advance
    Donna Lindsay-Goodwin

    Hi Donna,
    PSE only makes simple animated gif's. To do what you want it may pay
    to invest in Alchemy Mindworks' GIF Construction Set.
    http://www.mindworkshop.com/alchemy/alchemy.html
    You can download Byron Gale's animated gif at
    http://www.cavesofice.org/~grant/Present/Byron_Gale.html
    & load it into PSE to see how he achieved the blinking lights.
    Alex,

Maybe you are looking for