24/10/2010, 05:07
|
| | Fecha de Ingreso: junio-2008
Mensajes: 7
Antigüedad: 16 años, 4 meses Puntos: 0 | |
Insertar Check box en flash Hola, necesito añadir una función de check box a mi formulario para se tenga que marcar obligatoriamente para poder continuar al pulsar el "Play". Un check del tipo "He leido y acepto las condiciones". No necesito el check ejecute ninguna orden ni nada en php.
He intentado de varias maneras pero no lo consigo, agradeceria cualquier tipo de ayuda, les dejo el código:
function sendData(){
createEmptyMovieClip("sendVar", 1000);
if(user.data.name != undefined){
sendVar.Name = user.data.name;
sendVar.email = user.data.email;
} else {
sendVar.Name = nameTxt.text;
sendVar.email = email.text;
}
sendVar.address = "";
sendVar.phone = "";
sendVar.loadVariables("generatecard.php", "POST");
sendVar["onData"] = function (){
gotoAndStop(3);
if(this.error != 1){
prizeWon = this.prizeWon;
id = this.id;
link = this.link;
redirectURL = this.looserRedirect;
if(this.alreadyPlayed == 1){
gotoAndStop(4);
trace("Already Played");
return undefined;
}
var prizes = this.availablePrizes.split(",");
i = 0;
while(i < 9){
sc = attachMovie("scratcharea", ("sa" + i), i);
if(prizes[i] != 0){
sc.img.loadMovie(("images/prize_th_" + prizes[i]) + ".jpg");
}
if((i % 3) == 0){
sc._x = 12;
if(i < 3){
sc._y = 12;
} else {
sc._y = (eval("sa" + (i - 1))._y + eval(("sa" + (i - 1)))._height) + 12;
}
} else {
sc._y = eval("sa" + (i - 1))._y;
sc._x = (eval("sa" + (i - 1))._x + eval(("sa" + (i - 1)))._width) + 12;
}
sc["onPress"] = function (){
count++;
this.swapDepths(this._parent.getNextHighestDepth() );
this.play();
delete this.onPress;;
if(count == 9){
if(prizeWon > 0){
won._visible = true;
return;
}
lose._visible = true;
if(redirectURL != undefined || redirectURL != ""){
myRedirect = setInterval(redirect, 5000);
}
}
}
i++;
}
trace(this.prizeWon);
trace(this.availablePrizes);
trace(this.id);
trace(this.link);
}
}
}
function redirect(){
getURL(redirectURL, "");
clearInterval(myRedirect);
}
function isValid(){
val = true;
if(nameTxt.text == "" || nameTxt.text == "Enter Name"){
nameTxt.text = "Aqui su nombre";
val = false;
}
if(((email.text == "" || email.text.indexOf("@") < 3) || email.text.lastIndexOf(".") < 7) || email.text == "Enter Valid Email"){
email.text = "Aqui su email";
val = false;
}
return val;
}
stop();
won._visible = false;
lose._visible = false;
count = 0;
user = SharedObject.getLocal("user_profile");
nextPlay = 0;
if(user.data.name != undefined){
nameTxt.text = user.data.name;
email.text = user.data.email;
}
playbtn["onRelease"] = function (){
Selection.setFocus(myTxt);
if(!isValid()){
return undefined;
}
user.data.name = nameTxt.text;
user.data.email = email.text;
user.flush();
sendData();
}
nameTxt["onSetFocus"] = function (oldFocus){
if(this.text == "Enter Name"){
this.text = "";
}
}
email["onSetFocus"] = function (oldFocus){
if(this.text == "Enter Valid Email"){
this.text = "";
}
} |