var result : Boolean = Pattern.matches("a*b", "aab");
In this particular case result equals true in Flash, but either false or undefined in Flex.
Logged In: YES user_id=1494052
I spent 4 hours and I have just fixed that bug! :)
So it doesn't work in Flex because, of this (org.as2lib.regexp.Pattern):
static var ACCEPT:Node = new Node(); static var LASTACCEPT:Node = new LastNode();
A classes instance variables may only be initialized to compile-time constant expressions!!!
And Flex compiler doesn't give us that error when we use "static" variables. BUG?
So to fix this we just need to initialize this variables at constructor for example, like this:
static var ACCEPT:Node; static var LASTACCEPT:Node
public function myConstructor() : Void { if(!ACCEPT) { ACCEPT = new Node(); }
if(!LASTACCEPT) { LASTACCEPT= new LastNode(); } }
Say Thanks to me by email if that helps : )
By the way you should check all your code for this.
Logged In: YES user_id=922171
Assigned the bug to isadovskiy.
Sergey: Thanks for the huge help, we'll check the code for other occurrences of this.
Log in to post a comment.
Logged In: YES
user_id=1494052
I spent 4 hours and I have just fixed that bug! :)
So it doesn't work in Flex because, of this
(org.as2lib.regexp.Pattern):
static var ACCEPT:Node = new Node();
static var LASTACCEPT:Node = new LastNode();
A classes instance variables may only be initialized to
compile-time
constant expressions!!!
And Flex compiler doesn't give us that error when we
use "static"
variables. BUG?
So to fix this we just need to initialize this variables at
constructor for example, like this:
static var ACCEPT:Node;
static var LASTACCEPT:Node
public function myConstructor() : Void {
if(!ACCEPT) {
ACCEPT = new Node();
}
if(!LASTACCEPT) {
LASTACCEPT= new LastNode();
}
}
Say Thanks to me by email if that helps : )
By the way you should check all your code for this.
Logged In: YES
user_id=922171
Assigned the bug to isadovskiy.
Sergey: Thanks for the huge help, we'll check the code for
other occurrences of this.