Created
October 21, 2013 06:12
-
-
Save phi-jp/7079366 to your computer and use it in GitHub Desktop.
[tmlib.js] AssetManager で json 読み込み & type 指定 ref: http://qiita.com/phi/items/3c816dce3c1fad518d93
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tm.asset.AssetManager.load({ | |
// 普通に読み込む | |
"image_data": "./kenkyo.jpg", | |
// type を省略しているので tmss として読み込まれる | |
"tmss_data": "./crash.tmss", | |
// tmss だけど type で json を指定しているので json で読み尾込まれる | |
"json_data00": { url: "./crash.tmss", type: "json" }, | |
// url にオブジェクトを渡しているけど type が json なので File としてかえってくる | |
"json_data01": { url: {hoge:100, foo:200}, type: "json" }, | |
}); | |
tm.asset.AssetManager.onload = function() { | |
console.log('読み込み終わったよ♪'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ver 0.1.8 で
tm.asset.AssetManager.load({
"json_data01": { src: {hoge:100, foo:200}, type: "json" },
});
と書くと
Uncaught TypeError: Object # has no method 'split'
というエラーが出るんですが
どう対処すればいいでしょうか?