{"id":13744094,"url":"https://github.com/TheDamArmada/Flash2Cocos2D","last_synced_at":"2025-05-09T02:32:35.794Z","repository":{"id":2734975,"uuid":"3730492","full_name":"TheDamArmada/Flash2Cocos2D","owner":"TheDamArmada","description":"Library to import animations made in Flash to Cocos2D","archived":false,"fork":false,"pushed_at":"2019-05-21T19:38:37.000Z","size":62061,"stargazers_count":91,"open_issues_count":3,"forks_count":31,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-15T15:42:06.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheDamArmada.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-15T16:51:11.000Z","updated_at":"2024-01-08T12:24:44.000Z","dependencies_parsed_at":"2022-08-25T21:00:16.569Z","dependency_job_id":null,"html_url":"https://github.com/TheDamArmada/Flash2Cocos2D","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDamArmada%2FFlash2Cocos2D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDamArmada%2FFlash2Cocos2D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDamArmada%2FFlash2Cocos2D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDamArmada%2FFlash2Cocos2D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheDamArmada","download_url":"https://codeload.github.com/TheDamArmada/Flash2Cocos2D/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253177830,"owners_count":21866404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:01:02.999Z","updated_at":"2025-05-09T02:32:35.432Z","avatar_url":"https://github.com/TheDamArmada.png","language":"ActionScript","funding_links":[],"categories":["Frameworks","etc"],"sub_categories":["Animation Framework"],"readme":"FlashToCocos2D\n===============\n\n\nThis tool provides a fast way of reusing animations made in Flash CS in Cocos2D projects.\nA minimaly tweaked version of the amazing exporter by [Grapefrukt](https://github.com/grapefrukt/grapefrukt-export) provides a way to export all the animation information (position, rotation, scale) of a Flash made character to xml.\nThe FlashToCocos iOS library reads those xml files and recreates the characters in Cocos2D.\n\n\u003ch2\u003eBasic workflow:\u003c/h2\u003e\n\n\u003ch3\u003eFLASH SIDE:\u003c/h3\u003e\n- create your character in Flash \n- create as many animations a needed\n- every animation has to have a keyframe labeled with an unique name. IE: \"*dancing*\", \"*running*\"...\n- to launch custom events during an animation, you can use keyframes labels prefixed with @. IE: \"*@launchSound*\"\n- select 'Export for Actionscript' for your character MovieClip\n- add the Grapefukrt exporting code on the first frame:\n\n\t```actionscript\n\timport com.grapefrukt.exporter.simple.SimpleExport;\n\timport com.grapefrukt.exporter.extractors.*;\n\t// change robot for whatever name you want to use\n\tvar export:SimpleExport = new SimpleExport(this, \"robot\"); \n\t// change RobotCharacterMc for whatever name you MovieClip is in the library\n\texport.textures.add(TextureExtractor.extract(new RobotCharacterMc)); \n\tAnimationExtractor.extract(export.animations, new RobotCharacterMc);\n\texport.export();\n\t```\n\n- publish\n- on the top left corner click on \"*click to output*\"\n- save the zip file\n- unzip the zip file\n\n\n\u003ch3\u003eXCODE:\u003c/h3\u003e\n\n- start a Cocos2D project\n- enabled ARC following this [instructions](http://www.tinytimgames.com/2011/07/22/cocos2d-and-arc/)\n- add the FlashToCocos Library\n- add the [TBXML Library](http://tbxml.co.uk/)\n- add the results of unzipping the file created from Flash\n\n\n\u003ch2\u003eFTCCharacter Class\u003c/h2\u003e\n\u003ch3\u003eOverview\u003c/h3\u003e\nFTCharacter is the main class to be used. It extends CCLayer and it's the responsible to load the XML files and textures.\nThere are still a lot of methods exposed that shouldn't be. Hopefully we'll be able to clear the code a little bit in short time.\n\u003ch3\u003eClass Methods\u003c/h3\u003e\n\n```-(FTCharacter) characterFromXMLFile:(NSString *)xmlFileName```\n\nReads and XML, loads texture and returns a FTCCharacter.\u003cbr/\u003e\nIE: \u003ccode\u003eFTCharacter *robot = [FTCharacter characterFromXMLFile:@\"robot\"]\u003c/code\u003e\n\n\u003ch3\u003eInstance Methods\u003c/h3\u003e\n\n\u003ccode\u003e-(void) playAnimation:(NSString *)animation loop:(BOOL)loops wait:(BOOL)waits\u003c/code\u003e\n\nStarts playing the specified **animation**. It will **loop** it if specified.\nThe wait parameter indicates if this animation should **wait** for the previous one to finish before start playing.\n\n\u003ccode\u003e-(void) stopAnimation\u003c/code\u003e\n\nStops the current animation being played.\n\n\u003ccode\u003e-(void) pauseAnimation\u003c/code\u003e\n\nPauses the current animation.\n\n\u003ccode\u003e-(void) resumeAnimation\u003c/code\u003e\n\nResumes the current paused animation.\n\n\u003ccode\u003e-(void) playFrame:(int)_frameIndex fromAnimation:(NSString *)_animationId\u003c/code\u003e\n\nSets the character to the specified **frame** for the specified **animation**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheDamArmada%2FFlash2Cocos2D","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTheDamArmada%2FFlash2Cocos2D","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheDamArmada%2FFlash2Cocos2D/lists"}