otie
Gebruiker
- Lid geworden
- 1 dec 2008
- Berichten
- 313
Hallo, ik heb de volgende tutorial helemaal gevolgd, alleen bij stap 6, loop ik vast, ik weet namelijk niet waar ik dat moet neerzetten, het moet in de "root", ik heb net flash trail er op gezet en snap er niks van, maar waar is de ROOT van een flash bestand?
Hele tutorial:http://www.jor-on.com/blog/2008/01/15/how-to-create-your-own-xbox-live-gamercard/
Step 6: Grand finale
Using Actionscript we can get the contents of the JSON file and parse the data directly using the JSON class for Actionscript. Place the following code in the first frame of the root of your Flash file (not in the gamercard_mc MovieClip).
Hele tutorial:http://www.jor-on.com/blog/2008/01/15/how-to-create-your-own-xbox-live-gamercard/
Step 6: Grand finale
Using Actionscript we can get the contents of the JSON file and parse the data directly using the JSON class for Actionscript. Place the following code in the first frame of the root of your Flash file (not in the gamercard_mc MovieClip).
Code:
import JSON;
var feed:String = "http://www.jor-on.com/xboxlive.php";
var json:JSON = new JSON();
var xboxLive:LoadVars = new LoadVars();
xboxLive.onLoad = function(success:Boolean):Void
{
if (success)
{
var xl:Object = json.parse(this.xboxlive);
gamertag_mc.gamertag_txt.text = xl.xlnapi.coreinfo.gamertag;
gamertag_mc.details_txt.text = xl.xlnapi.coreinfo.score + "\n" + xl.xlnapi.coreinfo.zone + "\n" + xl.xlnapi.coreinfo.lastplayed;
var pic_mcl:MovieClipLoader = new MovieClipLoader();
var tile:String = xl.xlnapi.coreinfo.tile;
var tileArray = tile.split(" ");
tile = tileArray.join("+");
pic_mcl.loadClip(tile, gamertag_mc.picture_mc.image_mc);
gamertag_mc.picture_mc.link = xl.xlnapi.coreinfo.liveurl;
gamertag_mc.picture_mc.onPress = function():Void
{
getURL(this.link);
}
}
}
xboxLive.load("http://www.jor-on.com/xboxlive.php?r=" + Math.random());