ESTO ESTÁ EN EL FOTOGRAMA 1:
Código ActionScript :
//Conexion a la base de datos var databaseFile:String = "kilimajaro.mdb"; var databasePassword:String = ""; var path:String = mdm.Application.path+databaseFile; mdm.Database.MSAccess.connect(databaseFile, databasePassword); var success = mdm.Database.MSAccess.success(); if (success == false) { var msg:String = "No se puede conectar a la bbdd"; mdm.Dialogs.prompt(msg); } function ActivProg_consulta() { mdm.Database.MSAccess.select("SELECT activado FROM activar"); var dataSet:Array = mdm.Database.MSAccess.getData(); var datos:Object; var newItemsArray:Array = new Array(); for (var i = 0; i<dataSet.length; i++) { datos = {}; datos.activado = dataSet[i][0]; newItemsArray.push(datos); } var activado1:String = datos.activado; _global.activado2 = activado1; } ActivProg_consulta(); if (_global.activado2 == 1) { mdm.Dialogs.prompt("el programa ya está activado"); stop(); } else { gotoAndPlay("2"); }
Y ESTO EN EL FOTOGRAMA 2:
Código ActionScript :
var databaseFile:String = "kilimajaro.mdb"; var databasePassword:String = ""; var path:String = mdm.Application.path+databaseFile; mdm.Database.MSAccess.connect(databaseFile, databasePassword); var success = mdm.Database.MSAccess.success(); if (success == false) { var msg:String = "No se puede conectar a la bbdd"; mdm.Dialogs.prompt(msg); } if (mdm.Application.Trial.usesLeft<0) { myCode = mdm.Dialogs.inputBox("Trial Expired", "Trial period has expired - Enter your serial to continue using this application"); if (mdm.Application.Trial.activate(myCode)) { mdm.Dialogs.prompt("Serial validated! Trial protection removed."); _root.ActivProg_consulta(); mdm.Database.MSAccess.runQuery("UPDATE activar SET activado = 0 WHERE id = 1"); activate.enabled = false; indicator.text = "unlimited"; } else { mdm.Dialogs.prompt("A correct serial was not entered. Application will now exit"); mdm.Application.exit(); indicator.text = "X"; } } else if (isNaN(mdm.Application.Trial.usesLeft)) { activate.enabled = false; indicator.text = "unlimited"; } else { reset.enabled = false; indicator.text = mdm.Application.Trial.usesLeft; } activate.onRelease = function() { myCode = mdm.Dialogs.inputBox("Serial Validation", "Enter your serial"); if (mdm.Application.Trial.activate(myCode)) { mdm.Dialogs.prompt("Serial validated! Trial protection removed."); _root.ActivProg_consulta(); mdm.Database.MSAccess.runQuery("UPDATE activar SET activado = 0 WHERE id = 1"); activate.enabled = false; indicator.text = "unlimited"; } else { mdm.Dialogs.prompt("A correct serial was not entered"); } }; reset.onRelease = function() { mdm.Application.Trial.resetTimer(); reset.enabled = false; mdm.Dialogs.prompt("Trial Protection reset"); indicator.text = "limited"; }; stop();