FLASHで外部ファイルを読み込むのに1番簡単な方法は、LoadVars()を使用する方法かな?
FLASHで動的パラメータ処理でも触れたように読み込みたい値をURLパラメータに似た形式「変数名A=値A&変数名B=値B&・・・」でテキストファイルを用意しておけば良い。
1 2 3 4 5 6 7 8 |
on(click) { var myLoad = new LoadVars(); myLoad.onLoad = function(result) { trace("NAME:"+this.name); trace("MAIL:"+this.mail); }; myLoad.load("profile.txt"); } |
profile.txtは次のような内容で用意しておく。
1 |
mail=hoge@example.com&name=foo |
XMLの読み込みは次の課題としましょう。
No comments yet. You should be kind and add one!
By submitting a comment you grant typista a perpetual license to reproduce your words and name/web site in attribution. Inappropriate and irrelevant comments will be removed at an admin’s discretion. Your email is used for verification purposes only, it will never be shared.