Skip navigation
Rodan_Shiner
Currently Being Moderated

How to set Keyframe duration automatically?

Feb 3, 2013 4:34 AM

Tags: #adobe_flash

Hello. I am using Flash Pro CS6.

Now I am trying to  place bitmap image sequence on a layer. I imported images as image sequence using the menu "File - Import - Import to Stage", and Flash Pro automatically placed them into a layer, but all keyframes are set as 1 frame.

Plz see the picture below.

rapture_20130203211359.png

 

"1F" layer shows the situation. I import image sequence into "1F" layer. All keyframes are set as 1 frame, but I want to make them to be 5 frames like "5F" layer.

 

Is there any way to make all 1frame keyframes to be  5frames automatically? I need to import lots of bitmap sequence and place them in a layer and adjust duration. It's really time consuming If I need to set the duration manually.

 

Please give me your advice.Thank you in advance.

 
Replies
  • Currently Being Moderated
    Feb 3, 2013 5:17 AM   in reply to Rodan_Shiner

    Is there a reason for needing the 5 frames for each?  If it is just a matter of timing, you can use code to manage waiting between frame movements.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2013 7:07 AM   in reply to Rodan_Shiner

    Which version of Actionscript is your file set to publish for?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2013 7:09 AM   in reply to Rodan_Shiner

    Also, what amount of time does 5 frames represent?  You could just change the frame rate of the file.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2013 8:00 AM   in reply to Rodan_Shiner

    To answer your original question, there is no quick/easy way to have frames automatically added between keyframes.

     

    In AS2 you cannot do anything to modify the frame rate of the file, so if you need things to operate at different speeds you will need to implement code-based controls that dictate frame progression or object manipulation. 

     

    The only built-in timer tools that support AS2 are the setTimeout() function and the setInterval() function, which you can find information about if you search Google using terms like "AS2 setInterval".  If you want these timers to control moving one frame at a time, then they could be used in combination with nextFrame() commands, which do what they say... go to the next frame and stop.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2013 5:51 PM   in reply to Rodan_Shiner

    In AS3 you can change the frameRate property of the file using code, but it applies to the whole file, not individual movieclips.  If you still want things to operate at different rates then you'll need to use timing elements.

     

    AS3 has one more tool in its arsenal as far as timing things goes... the Timer class, which can work somewhat like the setInterval function (which is in AS2 and AS3).

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 4, 2013 1:29 AM   in reply to Rodan_Shiner

    This jsfl-Code works as a Macro that automatically stretches the duration of every frame of every layer on your current  timeline from1 to 5 frames:

     

    var countNum = fl.getDocumentDOM().getTimeline().frameCount*5;

    for (var i = 0;i<countNum;i += 5){

        fl.getDocumentDOM().getTimeline().insertFrames(4,true,i);

    }

     

    to use it: create a blank jsfl-file (file->new), paste the code above and have your fla open in a second window. Press the playbutton on the jsfl and it should "stretch" the duration of every frame of every layer on your current  timeline from1 to 5 frames.

     

    Beware: Depending on how many layers and bitmaps you have to manipulate, it can take a while.

    Backup your work before usage.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points