Yes it is the scope. You declared the variable as static, so you can't use this to access it.
Cheers,
Ralf.

On 10/7/06, akash < [EMAIL PROTECTED]> wrote:

HI Steve,

                            Even if  I remove this from that line ,then also the problem is as it is..Actually may be its problem with  the scope of the variable .

 

Regards,

Akash,

 

From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Steve Kellogg @ Project SOC
Sent: Saturday, October 07, 2006 5:02 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Variable Initialization Problem

 

Akash,

 

Maybe I'm misreading your code, but it looks like you're getting an undefined on  this.title.  What is THIS in this context, and does it HAVE a TITLE parameter?

 

Just a thought.

 

 

Steve

 

 


From: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] On Behalf Of akash
Sent: Saturday, October 07, 2006 12:01 AM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] Variable Initialization Problem

 

Hi all,

 

              This is my action script file. Here I am initializing the variable with some value..but I find it outside that particular code block it is showing undefined even tthough the variable is global. Can anybody suggest me how to resolve this problem?

 

import mx.core.UIObject;

                                    import de.richinternet.utils.Dumper;

            public static var pageItem,printItem : Object;

            public static var reportItem1,reportItem2 : Object;

                                    public static var title: String=null;

                                    var pages:Number=0;

                                    var loanTermArray=[1,2,3,4,5,6,7,8,9];

                                    var interestRateArray=[1,2,3,4,5,6,7,8,9];

                                    var pointsPurchasedArray=[0,1,2,3,4,5,6,7,8,9];

                                   

                                    function createUI( pageUI:String , parentComp:Object):Void {

                                               

                if( pageUI == "formatToolbar" )

                                                {

                                                     pageItem = parentComp.createChild( formatToolbar, undefined );

                                                           

                                                }

                if( pageUI == "pointsCalci" )

                                                {

                    pageItem = parentComp.createChild( PointsCalculator, undefined);

                                                            title='Calculators : Should I Pay Points?';

                                                            Dumper.dump("title   "+title);//here its ok.

                                                }

                                                if(pageUI == "viewPointCalci")

                                                pageItem=parentComp.createChild(ViewCalculator,undefined);

                                                           

                                                if(pageUI == "viewPointReport")

                                                {

                                                            pageItem=parentComp.createChild(mx.containers.VBox,undefined,{ x:8, y:21, width:465, height:445});

                                                            reportItem1=pageItem.createChild(PointCalciReport1,undefined);

                                                            pages++;

                                                            reportItem2=pageItem.createChild(PointCalciReport2,undefined);

                                                            pages++;

                                                            printItem=pageItem;

                                                }          

                                               

            }

 

            public function destroyUI(parentComp:Object):Void {

                                                parentComp.destroyChild( UIObject( pageItem ) );

            } 

                                                                              

       

                                    public function doPrint()

                                    {

                                    var pj : PrintJob = new PrintJob();

                                               

                                    //Save the current vertical scroll position of the DataGrid control.

                                    var prev_vPosition:Number = printItem.vPosition;

                                                Dumper.dump("vPosition "+prev_vPosition);

                                    if(pj.start() != true)           

                                                {

                        delete pj;

                        return;

                                    }

 

                           //Scroll down each page of rows, then call addPage() once for each page.

                        for (var i:Number=0;i<pages;i++)

                                                {

                        //newItem.vPosition = i*rowsPerPage;

                                                var obj1 : Object = printItem.getChildAt(i);

                                               

                        pj.addPage(printItem.getChildAt(i));  //{xMin:-100,xMax:400,yMin:-150,yMax:560});

                        }

                                                pj.send();

                                    delete pj;

 

                        // Restore vertical scroll position.

                                    //newItem.vPosition = prev_vPosition;

                                    }

                                   

                                    public function setTitle(titleparam:Object)

                                    {

                                                Dumper.dump("title   "+this.title);// here title is coming out to be undefined?

                                                titleparam.text=title;

                                    }

 

Thanks&Regards,

Akash Chander,

 

Disclaimer

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this communication in error, please immediately notify the [EMAIL PROTECTED]ness.com and destroy the original message. The recipient should check this email and any attachments for the presence of viruses. Ness has taken every reasonable precaution to minimize this risk, and accepts no liability for any damage caused by any virus transmitted in this email. Ness reserves the rights to monitor and review the content of all messages sent to or from this E-mail address, and store them on the Ness E-mail system.




--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany __._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to