Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Create a set function in “Customizing Guides Using Flash Builder ”


Level 1

When I copy this code to my mxml.

<?xml version="1.0" encoding="utf-8"?>
<gc:Wrapper width="100%" height="100%"
    xmlns:gc="ga.controls.*" >

            Wrapper.instance.bindSetter("Services.employee.empName", empNameSetter);

            private function empNameSetter(value:Object):void
                var empName:String = value as String;  // cast to appropriate type
                if ( empName == "Tony Blue" ) {
                    // do something here


    <mx:VBox width="100%" height="100%">
        <gc:PanelContent width="100%" height="100%" />
            <gc:PreviousPanelButton label="Back" />
            <gc:NextPanelButton label="Forward" />
            <gc:SubmitButton label="Submit Data" />

then get a error "visit attribute 'empNameSetter' is undefined"

Who can help me,thanks.

0 Replies


Level 2

Hi Rowan,

I don't know whether or not you're still active, but for anyone else looking for a solution to a similar problem I'll break down the solution.

In this line :   Wrapper.instance.bindSetter("Services.employee.empName", empNameSetter);

You are calling the empNameSetter function but aren't passing an object.

private function empNameSetter(value:Object):void{

//code goes here


You should either pass an object to your function in the function call like so:
Wrapper.instance.bindSetter("Services.employee.empName", empNameSetter(ObjectGoesHere));


Modify your declaration not to take any parameters.


Level 1

Thank you very much!

I have solved this problem by anonymous function.



          //code gose here