Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I was wondering if someone could please explain the process and rules for turning an animation into a png sequence, in flash CS5.

I know you can go to export movie and chose png sequence but sometimes I only get 1 frame?

I don't know if my character (which was imported from illustrator) should be a graphic or a movie clip symbol and I also have animation within layers in the timeline, I don't know if they all have to be the immediate timeline??

Also my intention for the animation (png sequence) is to make a sprite sheet with texture packer and then to take it into cocos2d, and then use for my iphone game. If there is anything I need to keep in mind when animating for this purpose, please any advice would help.

One last thing does my animation need to be frame by frame (which is what I have been doing) or can I use classic / motion tweens in my animation and still export as a png sequence.

As I'm sure you can tell i'm pretty new to flash and iphone development so any help or advice would be greatly appreciated, sorry for all the questions.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

The "export movie" command exports the currently active timeline as a PNG sequence. You can export any kind of animation, that means frame-by-frame, tweens or shape-tweens. It also doesn't matter if you're animating bitmaps or vector objects... a good rule of thumb is: You'll get exported what you see when you play the timeline within the Flash IDE (hit Enter).

Animations within MovieClips won't work. If you have nested animations, your best bet would be to export to QuickTime (which would even allow you to export scripted animations). Make sure to tick "Ignore stage color (generate alpha channel)", choose a lossless codec (eg. Animation) and then convert from QuickTime to a PNG sequence.

Your further progress seems fine as it is. Drag the folder with your exported PNG frames into TexturePacker and let the tool handle the rest.

Most likely you'll want to support retina displays, so make sure your assets are double the screen-size in Flash or set the stage-size or DPI to double the original size in the export dialog.

Also be aware that the maximum texture size on iPhone 3G is 1024x1024 and 2048x2048 on iPhone 4 (since this will use retina assets, it basically translates to the same amount of screen-points for iPhone 4 and 3). Switching texture during animation can be cumbersome and also have an impact on performance, therefore I suggest you don't split up animations to multiple textures.

share|improve this answer
    
Thanks a lot this really helped, just wondered when you said and animation in a movie clip won't work will an animation in a graphic work or does it all have to be on the base timeline. Thanks for all the extra information on sprite sheets and textures. One lat thing, should I put all my graphics and images into a sprite sheet even if there not an animation, would this help to reduce memory, so my game would run smoother. I want it low enough memory that people can download it on their phones if they wanted. Thanks for all the help and the reply I really appreciate it. –  Hunter Jan 23 '13 at 10:32
    
Graphics instead of MovieClips should work, but not exactly the same as MovieClips. If I recall correctly, they won't allow gotoAndPlay actions and will loop if the main timeline is longer. Regarding the texture atlas: Sure, pack as many sprites in there as possible! –  bummzack Jan 23 '13 at 10:45
    
Thanks, really appreciate all the help. –  Hunter Jan 23 '13 at 10:50

Your problem is probably that you had animations nested inside multiple objects; the "Export PNG Sequence" function only works on the base timeline.

Fortunately a variety of tools exist to make exporting Flash animations more robust. Many of these tools also turn the images into a spritesheet rather than a sequence of separate images. You'll want your animations in spritesheets (ie. all the frames are assembled into a single image that you display portions of) because that's a lot better for performance.

One such tool is Animo (formerly known as SpriteLoq) although that tool has gotten crazy expensive after some updates. The best free tool I know of is Zoe. Note that both tools say they are built for a specific development tool, but they simply output image files.

share|improve this answer
    
Hey, thanks for the reply and all the help I will look into that software you recommended (Zoe). But I bought texture packer but Zoe is free so it can't hurt. Thanks. –  Hunter Jan 23 '13 at 10:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.