{"action":"created","issue":{"url":"https://api.github.com/repos/ienaga/swf2js/issues/5","repository_url":"https://api.github.com/repos/ienaga/swf2js","labels_url":"https://api.github.com/repos/ienaga/swf2js/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/ienaga/swf2js/issues/5/comments","events_url":"https://api.github.com/repos/ienaga/swf2js/issues/5/events","html_url":"https://github.com/ienaga/swf2js/issues/5","id":170437881,"number":5,"title":"Identify loop in / loop out keyframes","user":{"login":"karkinge","id":8901294,"avatar_url":"https://avatars.githubusercontent.com/u/8901294?v=3","gravatar_id":"","url":"https://api.github.com/users/karkinge","html_url":"https://github.com/karkinge","followers_url":"https://api.github.com/users/karkinge/followers","following_url":"https://api.github.com/users/karkinge/following{/other_user}","gists_url":"https://api.github.com/users/karkinge/gists{/gist_id}","starred_url":"https://api.github.com/users/karkinge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karkinge/subscriptions","organizations_url":"https://api.github.com/users/karkinge/orgs","repos_url":"https://api.github.com/users/karkinge/repos","events_url":"https://api.github.com/users/karkinge/events{/privacy}","received_events_url":"https://api.github.com/users/karkinge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-10T14:55:26Z","updated_at":"2016-08-12T13:35:34Z","closed_at":null,"body":"Is there a simple way to identify the loop in / loop out keyframes, like the ones you found in the given example here : #3 ?\r\n\r\n```javascript\r\n// action\r\n    _root.addEventListener(\"enterFrame\", function(){\r\n        if (this.getCurrentFrame() === 349) {\r\n            this.gotoAndPlay(215);\r\n        }\r\n    });\r\n```"},"comment":{"url":"https://api.github.com/repos/ienaga/swf2js/issues/comments/239447700","html_url":"https://github.com/ienaga/swf2js/issues/5#issuecomment-239447700","issue_url":"https://api.github.com/repos/ienaga/swf2js/issues/5","id":239447700,"user":{"login":"ienaga","id":4123454,"avatar_url":"https://avatars.githubusercontent.com/u/4123454?v=3","gravatar_id":"","url":"https://api.github.com/users/ienaga","html_url":"https://github.com/ienaga","followers_url":"https://api.github.com/users/ienaga/followers","following_url":"https://api.github.com/users/ienaga/following{/other_user}","gists_url":"https://api.github.com/users/ienaga/gists{/gist_id}","starred_url":"https://api.github.com/users/ienaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ienaga/subscriptions","organizations_url":"https://api.github.com/users/ienaga/orgs","repos_url":"https://api.github.com/users/ienaga/repos","events_url":"https://api.github.com/users/ienaga/events{/privacy}","received_events_url":"https://api.github.com/users/ienaga/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T13:35:34Z","updated_at":"2016-08-12T13:35:34Z","body":"@vikbez @karkinge \r\n\r\n`ActionScript3.0` is under development.\r\n\r\nPlease wait until completion...\r\n  \r\n\r\n> Is there a way to get the contents of the DoAction tags from the swf ?\r\n\r\nSorry. Its function is not...\r\n  \r\n\r\n> Maybe we could then look for ActionGotoFrame and use them in javascript ?\r\n\r\nIt added the ability !\r\n\r\n# overWriteAction\r\n\r\n```js\r\n_root.overWriteAction(349, function()\r\n{\r\n    this.gotoAndPlay(215);\r\n})\r\n```\r\n\r\n# addAction\r\n\r\n```js\r\n_root.addAction(349, function()\r\n{\r\n    this.x++;\r\n    this.alpha -= 0.1;\r\n})\r\n```\r\n\r\n> Our goal is to get the flash object to play then loop as it would in flash player\r\n\r\n# object list sample code\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html lang=\"ja\">\r\n<head>\r\n    <meta charset=\"UTF-8\"/>\r\n    <meta name=\"viewport\" content=\"width=device-width,user-scalable=no,initial-scale=1.0\" />\r\n    <title>swf2js</title>\r\n    <script type=\"text/javascript\" src=\"swf2js.js\"></script>\r\n</head>\r\n<body style=\"margin: 0; padding: 0; background-color: #b7d;\">\r\n<script type=\"text/javascript\">\r\n\r\n    // _root\r\n    var _root = swf2js.createRootMovieClip(1024, 768, 120);\r\n\r\n    // stage setting\r\n    var stage = _root.getStage();\r\n    stage.backgroundColor = \"transparent\";\r\n\r\n    // add MovieClip\r\n    var mc = _root.createMovieClip(\"GB\");\r\n\r\n    // swf load\r\n    mc.loadMovie(\"./FHkkjnKNR4R_TransparentBG.swf\");\r\n\r\n    // swf load end event\r\n    mc.addEventListener(\"data\", function()\r\n    {\r\n        // action overwrite\r\n        this.overWriteAction(349, function () {\r\n            this.gotoAndPlay(215);\r\n        });\r\n\r\n        // add action\r\n        this.addAction(349, function () {\r\n            this.x++;\r\n            this.alpha -= 0.1;\r\n        });\r\n\r\n        // object list\r\n        var tags = this.getTags(349);\r\n        var loadStag =  this.getStage();\r\n        for (var depth in tags) {\r\n            if (!tags.hasOwnProperty(depth)) {\r\n                continue;\r\n            }\r\n\r\n            //  instance id\r\n            var id = tags[depth];\r\n            var instance = loadStag.getInstance(id);\r\n            if (!instance) {\r\n                continue;\r\n            }\r\n\r\n            // instance type\r\n            console.log(instance);\r\n\r\n            // action list\r\n            var actions = instance.actions;\r\n            if (actions) {\r\n                for (var frame in actions) {\r\n                    if (!actions.hasOwnProperty(frame)) {\r\n                        continue;\r\n                    }\r\n                    console.log(frame);\r\n                }\r\n            }\r\n            \r\n            var labels = instance.labels;\r\n            if (labels) {\r\n                for (frame in labels) {\r\n                    if (!labels.hasOwnProperty(frame)) {\r\n                        continue;\r\n                    }\r\n                    // frame and label name\r\n                    console.log(frame, labels[frame]);\r\n                }\r\n            }\r\n        }\r\n    });\r\n\r\n    // sample Flash => [var object = _root.BG;]\r\n    var object = _root.getDisplayObject(\"_root.BG\");\r\n    // object === mc\r\n    console.log(object);\r\n\r\n</script>\r\n</body>\r\n</html>\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"ienaga"}}