{"action":"created","issue":{"url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/674","labels_url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/674/labels{/name}","comments_url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/674/comments","events_url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/674/events","html_url":"https://github.com/Gamua/Starling-Framework/pull/674","id":56952221,"number":674,"title":"Open mCall in DelayedCall","user":{"login":"nomikovsupe","id":10908676,"avatar_url":"https://avatars.githubusercontent.com/u/10908676?v=3","gravatar_id":"","url":"https://api.github.com/users/nomikovsupe","html_url":"https://github.com/nomikovsupe","followers_url":"https://api.github.com/users/nomikovsupe/followers","following_url":"https://api.github.com/users/nomikovsupe/following{/other_user}","gists_url":"https://api.github.com/users/nomikovsupe/gists{/gist_id}","starred_url":"https://api.github.com/users/nomikovsupe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomikovsupe/subscriptions","organizations_url":"https://api.github.com/users/nomikovsupe/orgs","repos_url":"https://api.github.com/users/nomikovsupe/repos","events_url":"https://api.github.com/users/nomikovsupe/events{/privacy}","received_events_url":"https://api.github.com/users/nomikovsupe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-08T13:53:33Z","updated_at":"2015-02-23T10:47:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Gamua/Starling-Framework/pulls/674","html_url":"https://github.com/Gamua/Starling-Framework/pull/674","diff_url":"https://github.com/Gamua/Starling-Framework/pull/674.diff","patch_url":"https://github.com/Gamua/Starling-Framework/pull/674.patch"},"body":"Sorry my english.\r\n\r\nMy class with call getter:\r\n\r\n```as3\r\npublic class InstantDelayedCall implements IAnimatable\r\n{\r\n\tpublic function InstantDelayedCall(call:Function, delay:Number)\r\n\t{\r\n\t\t_delayedCall = new DelayedCall(call, delay);\r\n\t\t_juggler.add(_delayedCall);\r\n\t}\r\n\t\r\n\tpublic function advanceTime(time:Number):void\r\n\t{\r\n\t\tif (_delayedCall.currentTime == 0) _delayedCall.call();\r\n\t\t_juggler.advanceTime(time);\r\n\t}\r\n\t\r\n\tprivate var _juggler:Juggler = new Juggler();\r\n\tprivate var _delayedCall:DelayedCall;\r\n}\r\n```\r\n\r\nwithout call getter:\r\n\r\n```as3\r\npublic class InstantDelayedCall implements IAnimatable\r\n{\r\n\tpublic function InstantDelayedCall(call:Function, delay:Number)\r\n\t{\r\n\t\t_call = call;\r\n\t\t_delayedCall = new DelayedCall(call, delay);\r\n\t\t_juggler.add(_delayedCall);\r\n\t}\r\n\t\r\n\tpublic function advanceTime(time:Number):void\r\n\t{\r\n\t\tif (_delayedCall.currentTime == 0) _call();\r\n\t\t_juggler.advanceTime(time);\r\n\t}\r\n\t\r\n\tprivate var _call:Function;\r\n\tprivate var _juggler:Juggler = new Juggler();\r\n\tprivate var _delayedCall:DelayedCall;\r\n}\r\n```\r\n\r\nI want to store \"call\" only in one place.\r\nMaybe \"DelayedCall.mArgs\" should be opened too.\r\n\r\nSorry if i sound rude. I know english bad."},"comment":{"url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/comments/75521576","html_url":"https://github.com/Gamua/Starling-Framework/pull/674#issuecomment-75521576","issue_url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/674","id":75521576,"user":{"login":"PrimaryFeather","id":547347,"avatar_url":"https://avatars.githubusercontent.com/u/547347?v=3","gravatar_id":"","url":"https://api.github.com/users/PrimaryFeather","html_url":"https://github.com/PrimaryFeather","followers_url":"https://api.github.com/users/PrimaryFeather/followers","following_url":"https://api.github.com/users/PrimaryFeather/following{/other_user}","gists_url":"https://api.github.com/users/PrimaryFeather/gists{/gist_id}","starred_url":"https://api.github.com/users/PrimaryFeather/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrimaryFeather/subscriptions","organizations_url":"https://api.github.com/users/PrimaryFeather/orgs","repos_url":"https://api.github.com/users/PrimaryFeather/repos","events_url":"https://api.github.com/users/PrimaryFeather/events{/privacy}","received_events_url":"https://api.github.com/users/PrimaryFeather/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T10:47:49Z","updated_at":"2015-02-23T10:47:49Z","body":"Sorry for the long silence on this issue; I was busy with other features and then forgot about it!\r\nI've got another idea: what do you think of me adding a new method to the \"DelayedCall\" class that executes the callback with the given arguments right away?\r\n\r\n```as3\r\nprivate var mDelayedCall:DelayedCall;\r\n\r\nprivate function someFunction():void\r\n{\r\n    mDelayedCall.execute();\r\n    mDelayedCall.reset(myFunction, 10);\r\n    mDelayedCall.repeatCount = 3;\r\n    mJuggler.add(mDelayedCall);\r\n}\r\n```\r\n\r\nThe advantage: this would even take the given arguments into account. What do you think?"}}