0

So I have a Main .Fla/.SWF File which contains buttons to load in external SWF files using a LoadSWF class.

My Main class save/load code is:

private function saveData(): void {
    // savedData can now take any number of properties of any type
    // playerGameData is the variable name in which data is saved
    savedGameData.data.savedPlayerData = playerData;
    savedGameData.flush();
    loadData();
    tracePlayerData();
}

private function loadData(): void {
    // gets the data stored in the SharedObject
    playerData = savedGameData.data.savedPlayerData;
}

Assuming a set of saved data can be traced as: trace("Player Name:", playerData.playerName);

How can I load in the saved data, "playerData.playerName" into one of my externally loaded SWF files, so I can give a personalized message such as msgDisplay.text = playerData.playerName + "You Win!"

Pimgd
  • 5,983
  • 1
  • 30
  • 45
Elementxo
  • 27
  • 7

1 Answers1

0

What you want to do is to pass data from a swf to another.

The simplest way to do it is to pass them using the URL parameters, for instance :

swf2.swf?params=lol

You can pass JSON or such inside that types of parameters, so you'll be able to pass full objects with any number or property.

Document yourself on how to generate, parse, and send json through URL parameters.

blue112
  • 52,634
  • 3
  • 45
  • 54