hello all
in this swishmax file
When the button is pressed, the text value is incremented by 1 and the value is saved to SharedObject
i create only button 1 and button 2PHP Code:onSelfEvent (load) {
var kofa1:SharedObject = SharedObject.getLocal("file1");
var kofa2:SharedObject = SharedObject.getLocal("file2");
if(kofa1.data.chk ==undefined){
kofa1.data.chk =0 ;
}
if(kofa2.data.chk ==undefined){
kofa2.data.chk =0 ;
}
}
onFrame (1) {
stop();
t1.text = kofa1.data.chk ;
t2.text = kofa2.data.chk ;
kofa1.flush ();
kofa2.flush ();
}
How to do a loop to create many SharedObject for all buttons easily
swishmax file : https://app.box.com/s/0xcvfv8ib32fm82kbruuh1sv679hiq1t





Reply With Quote