Building a dynamic map that displays State Senate districts for a US State. Each district is a movie clip that I want to manipulate from a ColorTransform perspective on the flash map. The data that drives the map is being pulled from a php/mysql script. I have built out the actionscript up to the point of being able to trace the name and desired highlight color of the Senate district passed from the php (the passed name corresponds to the movie clip instance name of the district on the flash map). The traces work fine as far as the values of the data passed, one field is the district and the other is the color for the transform. The .as file compiles on the test, but will not treat the variable name used for the passed district as anything other than a String. I get an Error #1069: Property transform not found on String… Have gone through adobe reference pages and have tried every method of type conversion I could find to no avail. I get coerce errors on most attempts to force the String to be an Object.
Relevant code is below. Any direction is greatly appreciated. -David
private function completeHandler(event:Event):void
var district = event.target.data.district;
var districtColor = event.target.data.districtcolor; var colorInfo:ColorTransform = district.transform.colorTransform; // FAILS HERE colorInfo.color = districtColor; district.transform.colorTransform = colorInfo; }
One more note, if I hard code the district for example to, mcSenate_10 in both uses above, the .swf highlights Senate District 10 as planned.