{"action":"opened","issue":{"url":"https://api.github.com/repos/doublefx/easyWorker/issues/11","labels_url":"https://api.github.com/repos/doublefx/easyWorker/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/doublefx/easyWorker/issues/11/comments","events_url":"https://api.github.com/repos/doublefx/easyWorker/issues/11/events","html_url":"https://github.com/doublefx/easyWorker/issues/11","id":114123841,"number":11,"title":"[Fault] exception, information=TypeError: Error #1009: Cannot access a property or method of a null object reference.","user":{"login":"varadig","id":6317148,"avatar_url":"https://avatars.githubusercontent.com/u/6317148?v=3","gravatar_id":"","url":"https://api.github.com/users/varadig","html_url":"https://github.com/varadig","followers_url":"https://api.github.com/users/varadig/followers","following_url":"https://api.github.com/users/varadig/following{/other_user}","gists_url":"https://api.github.com/users/varadig/gists{/gist_id}","starred_url":"https://api.github.com/users/varadig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varadig/subscriptions","organizations_url":"https://api.github.com/users/varadig/orgs","repos_url":"https://api.github.com/users/varadig/repos","events_url":"https://api.github.com/users/varadig/events{/privacy}","received_events_url":"https://api.github.com/users/varadig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-29T19:04:55Z","updated_at":"2015-10-29T19:04:55Z","closed_at":null,"body":"A try easyWorker with a simple example, but I always got this error message:\r\n\r\n[Fault] exception, information=TypeError: Error #1009: Cannot access a property or method of a null object reference.\r\nat com.doublefx.as3.thread::Thread$cinit()\r\nat global$init()[/Volumes/Work/AS3/__TEST/EasyWorker/extsrc/com/doublefx/as3/thread/Thread.as:69]\r\nat EasyWorker/startApp()[/Volumes/Work/AS3/__TEST/EasyWorker/src/EasyWorker.as:22]\r\nat EasyWorker()[/Volumes/Work/AS3/__TEST/EasyWorker/src/EasyWorker.as:18]\r\n\r\n```javascript\r\n//Main class\r\npackage {\r\nimport com.doublefx.as3.thread.Thread;\r\nimport com.doublefx.as3.thread.api.IThread;\r\nimport com.doublefx.as3.thread.event.ThreadFaultEvent;\r\nimport com.doublefx.as3.thread.event.ThreadProgressEvent;\r\nimport com.doublefx.as3.thread.event.ThreadResultEvent;\r\n\r\nimport flash.display.Sprite;\r\n\r\nimport model.TermsVo;\r\n\r\nimport workers.ComplexWorker;\r\n\r\npublic class EasyWorker extends Sprite {\r\n    private var _thread:IThread;\r\n\r\n    public function EasyWorker() {\r\n        startApp();\r\n    }\r\n\r\n    private function startApp():void {\r\n        _thread = new Thread(ComplexWorker, \"nameOfMyThread\");\r\n\r\n        _thread.addEventListener(ThreadProgressEvent.PROGRESS, thread_progressHandler);\r\n        _thread.addEventListener(ThreadResultEvent.RESULT, thread_resultHandler);\r\n        _thread.addEventListener(ThreadFaultEvent.FAULT, thread_faultHandler);\r\n\r\n        _thread.start(new TermsVo(1, 2));\r\n    }\r\n\r\n    private function thread_faultHandler(event:ThreadFaultEvent):void {\r\n\r\n    }\r\n\r\n    private function thread_resultHandler(event:ThreadResultEvent):void {\r\ntrace(event.result);\r\n    }\r\n\r\n    private function thread_progressHandler(event:ThreadProgressEvent):void {\r\n\r\n    }\r\n}\r\n}\r\n\r\n\r\n//Worker class:\r\n\r\n/**\r\n * Created by varadig on 10/29/15.\r\n */\r\npackage workers {\r\nimport com.doublefx.as3.thread.api.CrossThreadDispatcher;\r\nimport com.doublefx.as3.thread.api.Runnable;\r\n\r\nimport model.TermsVo;\r\n\r\npublic class ComplexWorker implements Runnable {\r\n    // Mandatory declaration if you want your Worker be able to communicate.\r\n    // This CrossThreadDispatcher is injected at runtime.\r\n    public var dispatcher:CrossThreadDispatcher;\r\n\r\n    public function run(args:Array):void {\r\n        const values:TermsVo = args[0] as TermsVo;\r\n        dispatcher.dispatchResult(add(values));\r\n    }\r\n\r\n    private function add(obj:TermsVo):Number {\r\n        return obj.v1 + obj.v2;\r\n    }\r\n}}\r\n\r\n\r\n//TermsVO class\r\n\r\n/**\r\n * Created by varadig on 10/29/15.\r\n */\r\npackage model {\r\npublic class TermsVo {\r\n    public var v1:Number;\r\n    public var v2:Number;\r\n\r\n    public function TermsVo(v1:Number, v2:Number) {\r\n        this.v1 = v1;\r\n        this.v2 = v2;\r\n    }\r\n}\r\n}\r\n```\r\n\r\nSDK: ![GitHub Logo](http://go2design.hu/sdk.png)"}}