Ciao ragazzi, ho un grosso problema.. ho aggiunto una pulsante "area riservata" in questo sito (www.mega-srl.com), il pulsante richiama un movie esterno che all'interno contiene nel primo frame il seguente codice :
codice:
// This is a global function that checks the input boxes are not just all spaces. String.prototype.isWhiteSpace = function() { return ((this != undefined && this.length>0) ? (this.split(" ").join("").length == 0 ? b=true : b=false) : (b=false)); }; // This clears the user name and password input box’s. // With Out this you would see " _level0.UserName " and " _level0.Password " when you fist run the flash movie. // This is because any empty dynamic or input box with an instance name automatically gets set default text put in them. // This text is always " _level0. " and the instance name that you gave it like: " _level0.UserName " and " _level0.Password ". // To stop this happening you must clear the input box or dynamic box of any text box that has an instance name. // To do this you simply set each dynamic and input box’s instance name as a variable and set the text of that box as “” // which means the text box will appear empty when you first run the movie. Examples : var MyDynamicBoxInstanceName = “”; or var MyInputBoxInstanceName = “”; var UserName = ""; var Password = ""; // This sets the default starting message when the movie fist loads var Guide = "Inserire username e password"; // Declares a global function which can be called any time from any where in the flash movie _global.nextcheck = function() { // Checks the password to see if any thing has been typed in or if it is empty if (_root.Password.length == 0 | _root.Password.length == "" | _root.Password eq "") { // Alerts the user that their password is incorrect _root.Guide = "Non hai inserito una password!"; // Stops the movie from going to the next frame stop(); // Checks to see if the password is only full of spaces } else if (_root.Password.isWhiteSpace()) { // Alerts the user that their password is incorrect _root.Guide = "Password invalida!"; // Stops the movie from going to the next frame stop(); // Checks to see if the password is right or not } else if (_root.Password == "Megasrl") { // If the password is correect move on to the next frame of the movie nextFrame(); } else { // If the password is wrong then alert the user that it's wrong _root.Guide = "Password invalida!"; // Stops the movie from going to the next frame stop(); } }; // Stops the movie from going to the next frame stop();
Ora quando avvio il sito e richiamo il movie esterno, tutto il codice non funziona. Se invece lo avvio singolarmente e non dal sito funziona.
Non capisco quale sia il problema, può essere la sintassi "_root." sbagliata??
Vi sarei grato se mi aiutaste.