Hi dear community,
I created one event but when i just put cc.systemEvent.on(‘somEventName’, this.someFunction, this) it generates an error in the editor console.
When i execute the code it works perfectly.
Sorry, this looks like a bug in the editor. Your code looks correct, and if it executes than it’s purely in the editor. Which version of CC are you using?
@Big_Bear really thank you.
No, it’s really peculiar because i have done this in other parts of the project. I can give u some code but i need to get the office. About 2 hours you have the code for sure.
@Big_Bear, @jare
As I see, If u extends any cc.component. onload() and start() fucntions are called even in the editor. Is that normal?
So, for example:
if i want to add some spriteframes to toggle the sprite when some entity is clicked. My way would be extend cc.sprite create 2 cc.SpriteFrame and then change the cc.Sprite.spriteFrame property to one of this spites frames.
the bug cause by the cc.system is not init in the editor when you extends to engine component(like cc.Label,cc.Sprite).
we fixed it and it will update in version 2.0.7