mardi 23 septembre 2008
Tween AS2/AS3
Par Ivan solart, mardi 23 septembre 2008 à 02:29 :: flash Action Script 2
http://blog.greensock.com/
Aller au contenu | Aller au menu | Aller à la recherche
mardi 23 septembre 2008
Par Ivan solart, mardi 23 septembre 2008 à 02:29 :: flash Action Script 2
jeudi 24 janvier 2008
Par Ivan solart, jeudi 24 janvier 2008 à 09:43 :: flash Action Script 2
mercredi 23 janvier 2008
Par Ivan solart, mercredi 23 janvier 2008 à 17:06 :: flash Action Script 2
mercredi 7 novembre 2007
Par Ivan solart, mercredi 7 novembre 2007 à 16:54 :: flash Action Script 2
var chaineATraiter = 'Cœur';
chaineATraiter = str_replace('œ', 'Œ', chaineATraiter);
trace("chaineATraiter : "+chaineATraiter);
function str_replace(search, replace, string):String {
var array = string.split(search);
return array.join(replace);
}
jeudi 6 septembre 2007
Par Ivan solart, jeudi 6 septembre 2007 à 10:50 :: flash Action Script 2
Utiliser le debugger de la version 9 du Flash Player
Télécharger le player sur le site d'adobe
Installer la version debug du player
Télécharger Flash Tracer sur mozilla.org et installer le.
Ouvrir Flash Tracer dans l'onglet outils>Flash Tracer (ALT + A) de Firefox
Configurer le chemin dans Flash Tracer afin d'afficher les sorties du Flash Player: Options>Select output file
Saisir le chemin C:\Documents and Settings\[mon profil]\Application Data\Macromedia\Flash Player\Logs\flashlog.txt (modifier [mon profil] par votre configuration)
mercredi 5 septembre 2007
Par Ivan solart, mercredi 5 septembre 2007 à 22:23 :: flash Action Script 2
var _validator = new EmailValidator(); _validator.validate(object_champ.text);
class EmailValidator extends String {
/*
Requires: ActionScript v. 2.0
Date: April 25, 2006
Contact: admin@flashmx.us
Created by: Nikolay Shishenkov
==============================
Idea: this class has 1 goal to allow you to verify email address string by basic email characteristics
it is based on the email standards information that can be found here:
http://www.remote.org/jochen/mail/info/chars.html
==============================
Usage:
//=> |START| copy from this line
//={ Boolean => email_validator.validate(String); }=
//Import class - in this example the class is located ubder the folder "classes" (relative to the project's FLA location)
import classes.EmailValidator;
//Create the validator object:
var email_validator = new EmailValidator();
trace(email_validator.validate("admin@flashmx.us")); // will return true
trace(email_validator.validate("admin#@flashmx.us")); // will return false - because the string contains invalid character(#)
trace(email_validator.validate("admin@flashmx.tooLong")); // will return false - because the domain name is invalid
//... basicly it will return true ONLY if the email is complaint to the standard email address requirements
//= final line to copy =| END |
*/
var ASCII_ALLOWED:Array = [[38,39],[42,43],[45,57],[61,61],[63,63],[65,90],[94,95],[97,123],[125,126]];
//The list of all allowed ASCII Chars ranges for standard email address
//(including some special chars that are allowed in some cases such as {'}` etc.)
var i:Number, j:Number, email_arr:Array, after_arr:Array, str_len:Number;
//
function validate(inputString:String):Boolean{
//
if(inputString.length<1)return false;
//@
email_arr = inputString.split("@");
if(email_arr.length!=2) return false; // Only one @ is allowed
//.
//trace("after_arr "+after_arr);
var after_arr = email_arr[1].split(".");
if(after_arr == undefined)
return false;
if(after_arr[after_arr.length-1].length<2 || after_arr[after_arr.length-1].length>4)
return false; // Only one . is allowed and after the . you can have between 2 and 4 chars
//
if(!ValidateString(email_arr[0].toString())||!ValidateString(email_arr[1].toString()))
return false; // the email contains invalid characters
//
return true; // this is a valid email
}
//
function ValidateString(_str:String):Boolean{
str_len = _str.length;
//
for(i=0;i=ASCII_ALLOWED[j][0] && _chr<=ASCII_ALLOWED[j][1])
return true; // the caracter falls into one of the allowed areas
//
return false; // The used character is not allowed.
}
}
Par Ivan solart, mercredi 5 septembre 2007 à 22:19 :: flash Action Script 2
function is_code_postal(zone){
var code_postal = "0123456789";
var resultat = true;
if(zone.length < 5)
return false;
for (rang=0; rang<zone.length; rang++) {
var chaine = zone.charAt(rang);
trace("Chaine ! "+chaine+ " code_postal "+code_postal);
if (code_postal.indexOf(chaine) == -1) {
resultat = false;
break;
}
}
trace("res: "+resultat);
return resultat;
}