I'm currently running a fresh install of MAMP on my Mac and when I start a new flex project, add a php data service that pulls from a mysql database I have. Everything works fine until I try to compile. The error I'm getting is 'uid' being the primary key which is a bigint(20). The file _Super_Users.as (auto-gen based on the user table below) reports 2 errors: [Managed] requires uid to be of type 'String'. (same error on 2 lines of code) Now the MySQL table wants it to be a int, the auto gen code seems to want it to be an int as well but for some reason its putting in these requires for String on the getter and setters for 'uid'. The is before I even add any of my own code, just auto-gen then compile.
* data/source property getters
public function get uid() : int /*error line*/
* data/source property setters
public function set uid(value:int) : void /*error line*/
var oldValue:int = _internal_uid;
if (oldValue !== value)
_internal_uid = value;
This is what my database looks when I export it:
CREATE TABLE `users` (
`uid` bigint(20) unsigned NOT NULL,
`name` varchar(150) NOT NULL,
`first_name` varchar(50) NOT NULL,
`middle_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`gender` tinyint(1) NOT NULL,
`locale` varchar(5) NOT NULL,
`link` varchar(255) NOT NULL,
`username` varchar(50) NOT NULL,
`email` varchar(255) NOT NULL,
`picture` varchar(255) NOT NULL,
`friends` text NOT NULL,
`created` datetime NOT NULL,
`updated` datetime NOT NULL,
PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
It's empty right now...
I tried to give as much info as possible, if you need more let me know...
I discovered my problem was uid seems to be a built in global or something and was filling in that data field with a bunch of letters and number, like the device id. Because of the letters flex was throwing a fit. So if you're using Facebook API in flex be sure to not go with uid for the user id, which is was facebook api calls it.