Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
??? > error in string prototype function (MX)

??? > error in string prototype function (MX)

2004-03-08       - By Brajeshwar

 Back
Reply:     1     2     3     4     5     6  

check the utf-8 encoding for your as file

Regards
Brajeshwar
http://brajeshwar.com/
http://oinam.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---


-- -- Original Message -- --
From: "L A I V E R D" <john.mulder@(protected)>
To: <flashcoders@(protected)>
Sent: Monday, March 08, 2004 09:55 PM
Subject: [Flashcoders] ???> error in string prototype function (MX)


error message: H:\marketing\conferences\travel technology show\Sell-It
CD\string_fieldIsNotEmpty.as: Line 1: ';' expected
    ???

I have never been able to figure out why this error keeps coming up in a
String protoype function I created. Especially the last part "???. This
error pops up when publishing from Flash MX for Flash Player 6. I have
not been able to reproduce this error using FlashMX2004. The code is
part of some tutorial I wrote that can be found here:

http://home.hccnet.nl/john.mulder/flash/tutorials/flash_php_mailform.zip

Here the complete code (sorry for all the comments also, but as I am
really without a clue ...)


// NOTE > ALWAYS MAKE SURE THE LINE ABOVE THIS ONE IS EMPTY !!
// CLASS string_fieldIsNotEmpty.as
// VERSION 1.0 (compatible with Flash MX)
// MODIFIED 28-09-2003
// AUTHOR Laiverd.COM - John Mulder 2003
// SUMMARY Function that checks for empty textfields and takes
spaces into account. This function
// elaborates on the more common check for "", as is also
checks " " (which obviously is a
// string containing a space). The function uses a loop
that breaks as soon as a valid character
// is encountered. I did this to avoid a situations in
which "   the string" and "the string    "
// would lead to errors.
//
// PARAMETERS NONE
// RETURNS true/false
//++++++++++++++++++++++++ EXAMPLE USAGE ++++++++++++++++++++++++++
//
// myString1 = "This is my string";
// myString2 = "                 ";
// myString1.fieldIsNotEmpty() would return TRUE
// myString2.fieldIsNotEmpty() would return FALSE
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

String.prototype.fieldIsNotEmpty = function() {
// first check if the field is filled at all; so we check for
the "" situation
if (this.length == 0) {
return false;
} else {
// if the string has length we check if it's not only
spaces
// where we okay it as soon there's any character thas
is NOT a space
// 32 is returned for SPACE by charCodeAt
// this loop will stop as soon as an alfanumerical char
is encountered
for (c = 0; c < this.length; c++) {
if (this.charCodeAt(c) != 32) {
return true;
break;
}
}
}
return false;
};


Really hope that someone can shed some light.

Thanks,

John


=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106339
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)




=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106352
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)




Earn $52 per hosting referral at Lunarpages.