What is required on form to execute this code?

Hi,

I have downloaded this code and pasted it on frame1 (using FLASH AS3). Getting the error: [COLOR=#ff0000]1114: The public attribute can only be used inside a package.[/COLOR]

What is required to get this code working without errors?

import flash.net.FileReference;

public function saveXmlHandler(event:Event):void
        {
            var designType:String = "cover or inside page";
            var pageType:String = "Hard or Soft";
            var pageSize:String= "A4 ,SL, B5, DVD, A5, A4, Lands";
            var ImageData:String = "image data";
            var designBackground:String = "Back Image";

            var TypeR:String = "Rectangle";
            var pointsR:String = "x,y,w,h";

            var TypeC:String = "Circle";
            var pointsC:String = "r,c";

            var FooterPoints:String = "x,y,w,h";
            var FooterImage:String = "image data";

            //<?xml version="1.0" encoding="UTF-8"?>
            var xm:XML =<SharakuDesign>
                            <DesignType>designType </ DesignType >
                            <PageType>pageType</ PageType >
                            <PageSize>pageSize</ PageSize >
                            <DesignIcon>
                                ImageData
                            </DesignIcon >
                            <DesignBackGround>
                                designBackground
                            </DesignBackGround>
                            <Object>
                                <type> TypeR</type>
                                <Points> pointsR</Points>
                            </Object>

                            <Object>
                                <type> TypeC</type>
                                <Points > pointsC</Points >
                            </Object>

                            <Object>
                                <type> TypeC</type>
                                <Points> pointsC</Points>
                            </Object>

                            <Footer>
                                <Points> FooterPoints</Points>
                                <Data> FooterImage </Data>
                            </Footer>
                        </SharakuDesign >;
            xm.xmlDecl = <?xml version="1.0" encoding="UTF-8"?>;


            //var ba:ByteArray = new ByteArray();
            //ba.writeUTFBytes(xm);

            var fr:FileReference = new FileReference();

            fr.addEventListener(Event.SELECT, _onRefSelect);
            fr.addEventListener(Event.CANCEL, _onRefCancel);
            fr.save(xm, "Saraku.xml");
        }