Hello,
cocos creator version is 2.4.4
I have checked this documentation
this is my code
@property(cc.Sprite)
profile: cc.Sprite = null;
let iconUrl = “http://www.something.com/something.png”;
cc.assetManager.loadAny({url: iconUrl, type: ‘png’}, function (err, texture) {
this.profile.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
});
But this produce error as
Uncaught TypeError: Cannot read property ‘getComponent’ of undefined
I’m not sure what is wrong with code.
Thank you