It is generally a good idea to store data such as what you're describing in a document class to track information. If you need to use Framescripts, those should generally be limited to tasks that cannot be performed reasonably from the document class/other classes, such as timeline events, MovieClip event listeners, and state changes.
The easiest way to approach this is to have a class that stores the food selections, with functions that can set and retrieve this data. Then, when you load the instance of your button, use the data stored in your class to set the state of the button.
Here's an oversimplified example, using a single flag boolean. I'd recommend using another system for storage, such as XML, an array, or a custom object. In that case, you'd also want to change the class functions to work will ALL possible entries, not just one.
package
{
public class food
{
var pizza:Boolean = false;
public function addFood():void
{
pizza = true;
}
public function removeFood():void
{
pizza = false;
}
public function checkFood():Boolean
{
return pizza;
}
}
}
Then, you can have a function that sets the state of your button, which would probably be placed on your stage. I'm assuming, since you're using MovieClips, that you have different frames for the different states. I'll assume "1" is unchecked and "2" is checked, and the MovieClip is "pizzaButton".
Again, you'll want to expand this function to work on multiple buttons, not just one.
import food;
function updateButton():void
{
var flag:Boolean = food.checkFood();
if(flag)
{
pizzaButton.gotoAndStop(2);
}
else
{
pizzaButton.gotoAndStop(1);
}
}
BTW, adaam is absolutely correct in the comments. SimpleButtons may work better for this purpose than MovieClips, though that depends on the nature of the buttons you have. I'd look into it. This method would work for the most part with SimpleButtons, except your code would change the object's state, instead of its frame.