A New Animation Solution based on SWF for Cocos2d

Re-hi
@Raymond
Thanks for posting the project.
The translation error was on my side (modification I made when trying to look why the node wasnt displaying)
I can confirm that your code works now with the latest Cocos2dIphone beta.

Thanks again for sharing this.

Nicolas

Hi Raymond,
Thanks for the fix. However i encountered a new problem with the convertor. I tried to create a sample SWF file as you mentioned and tried to convert it. But the convertor just crashed. Btw iā€™m using Flash Player 10. Here is the crash log

Crashed Thread: 0 Dispatch queue: com.apple.main-thread
>
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000002c
>
VM Regions Near 0x2c:
ā€”> *PAGEZERO 0000000000000000-0000000000001000 [ 4K] ā€”/ā€” SM=NUL /Users/USER/Downloads/*/Super Animation Converter.app/Contents/MacOS/Super Animation Converter
>*TEXT 0000000000001000-00000000000c5000 [ 784K] r-x/rwx SM=COW /Users/USER/Downloads/*/Super Animation Converter.app/Contents/MacOS/Super Animation Converter
>
Application Specific Information:
objc[290]: garbage collection is OFF
>
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.raymondlu.Super-Animation-Converter 0x0001148e CInputScript::ParseShowFrame(unsigned long, unsigned long) + 4696
1 com.raymondlu.Super-Animation-Converter 0x0001409d CInputScript::ParseTags(bool, unsigned long) + 303
2 com.raymondlu.Super-Animation-Converter 0x00014398 CInputScript::ParseFile(char const*) + 352
3 com.raymondlu.Super-Animation-Converter 0x00016336 ConvSWF(std::string const&, std::string const&, bool, void*) + 415
4 com.raymondlu.Super-Animation-Converter 0x00016c23 SimpleConvSWF + 2187
5 com.raymondlu.Super-Animation-Converter 0x00003a8d + 404
6 com.apple.CoreFoundation 0x922e3d11
[NSObject performSelector:withObject:] + 65
7 com.apple.AppKit 0x9049e663 + 232
8 com.apple.AppKit 0x9049e540
[NSControl sendAction:to:] + 102
9 com.apple.AppKit 0x9049e443 + 160
10 com.apple.AppKit 0x9049d800
[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2295
11 com.apple.AppKit 0x90520a95 + 501
12 com.apple.AppKit 0x9049c243
[NSControl mouseDown:] + 943
13 com.apple.AppKit 0x90465dcd + 7533
14 com.apple.AppKit 0x903fef77
[NSApplication sendEvent:] + 4788
15 com.apple.AppKit 0x90390b21 -[NSApplication run] + 1007
16 com.apple.AppKit 0x90621ac5 NSApplicationMain + 1054
17 com.raymondlu.Super-Animation-Converter 0x00002b65 start + 53

To Raghu,

Can you send me your fla & swf file?
Here it is my email:raymond-lu@live.com.
Thank you.

BTW, you can check whether you break some rules I mention in the help doc first.
SWF is very complicated, I cannot handle all features in the converter.
So I have made some rules on Flash editor side to simplify this project, which are all in the help doc
.

This is very cool tool!

Does it support cocos2d-x multiresolution?

Thanks to Raymond.

@Raymond Lu- I have sent those files.

it is a terrific tool!
Thanks for that

btw, this only solved the first part of my problem.
I want to make an animation system that support changing the image of the frames.
say, if I want to make 50 characters with same set of animations, can i just make one animation and try to plug images to it for each character?

To Raghu,

Iā€™ve received your files.
Thank you!
Did you use any vector graphic in the process of creating your little character in Flash?
I guess you must use some vector graphic, like pen or something else to draw those black strokes of your little character in Flash.
The convercter cannot parse thoese vector graphic stuff even you have changed them into graphic symbol.
when you create your animation in Flash, you can only use image(bitmap), then change them into graphic symbol.

Bon Lam wrote:

it is a terrific tool!
Thanks for that
>
>
btw, this only solved the first part of my problem.
I want to make an animation system that support changing the image of the frames.
say, if I want to make 50 characters with same set of animations, can i just make one animation and try to plug images to it for each character?

We share the same idea, I think.
Assuming that we have a character animation, if the character get damaged, we can replace some images of the animation to show damage effect.
But right now, I dont have a good solution for that.
And the tool is still not so stable.
Maybe some time after I get a stable version of this tool, then I will think about how to implement this idea.

To Raymond Lu.

I want to make an animation system that support mutli resolution.
Can ā€œSuper Animation Converterā€ export add a feature to export mutli resolution pic?
Just like TexturePacker ā€œAutoSDā€ function?

Thanks to youā€¦. and Happy The End of World! :slight_smile:

hi Raymond,
Thanks for the update. You were right. that was vector graphic. How stupid of me :frowning: . I changed those to .png and everything works now, Thank you.

hi, raymond~
I wonder how I can change my Vertor Graphics to bitmap if there is so much Vertor Graphics or MovieClips in my .fla file?

Thanks.

Raghu S wrote:

hi Raymond,
Thanks for the update. You were right. that was vector graphic. How stupid of me :frowning: . I changed those to .png and everything works now, Thank you.

hi, may I ask about the method how to convert vertor grahpics to .png file?

Hi Zhang,
If you are using Flash CS5.5 and above you can do this by going to modify->Convert to Bitmap option. since my sample animation was small enough i just imported png images and animated them.

Raghu S wrote:

Hi Zhang,
If you are using Flash CS5.5 and above you can do this by going to modify->Convert to Bitmap option. since my sample animation was small enough i just imported png images and animated them.

Oh, crap~ I think I can never change the file our artiest createdā€¦ So much Vertor Imageā€¦

Oh, crap~ I think I can never change the file our artiest createdā€¦ So much Vertor Imageā€¦

then i think your only option is to export frames as png, use texture packer and do frame by frame animation.

ruler, Raghu:
that might be true at the moment, but it would be possible to have a tool like this go into the swf, find a vector image, create a BitmapData (AS3) and draw the vector to itā€¦ then apply the same transform matrix as the vector - thereby allowing the rest of the tool to save as normal.

Raymond:
is it possible to do such processing on a swf? I havenā€™t looked closely at your conversion tool - is it as3 based or does it read the swf file and interpret it manually itself?

daniel,

the tool read swf file and interpret it manually.
thatā€™s why i need to make sure the final swf as simple as possible.
so you cannot use any vector graphic stuff when creating your animation on Flash editor side.
and the tool is implemented based on this rule.

BTW, thanks to Raghu, I just fixed a crash bug.
A new version will be uploaded to git later.

Raghu S wrote:

> Oh, crap~ I think I can never change the file our artiest createdā€¦ So much Vertor Imageā€¦
>
then i think your only option is to export frames as png, use texture packer and do frame by frame animation.

Yep, I think soā€¦

Raghu S wrote:

> Oh, crap~ I think I can never change the file our artiest createdā€¦ So much Vertor Imageā€¦
>
then i think your only option is to export frames as png, use texture packer and do frame by frame animation.

But the files will be damn LARGEā€¦ and memory occupies GREATā€¦

Hi, guys,

A new vesion of converter has been uploaded to git.
Fixed some crash bugs, and this version should be more stable.
If you have any question, feel free to contact me.
thank you!