Static variable/method

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Static variable/method

    Hi!!

    need help here..how can i access static variable and methods in a class?

    tnx.
    eztaburnak Guest

  2. Similar Questions and Discussions

    1. #39852 [NEW]: static variable shows abnormal performence
      From: eingmarra at hotmail dot com Operating system: windowsxp sp2 PHP version: 5.2.0 PHP Bug Type: Class/Object related Bug...
    2. #39664 [NEW]: Invokation of non-static method as static issue
      From: john dot hargrove at sellingsource dot com Operating system: Gentoo Linux 2.6 kernel PHP version: 5.2.0 PHP Bug Type: ...
    3. #39057 [NEW]: Documented static method isn't
      From: nickj-phpbugs at nickj dot org Operating system: Ubuntu Linux PHP version: 5CVS-2006-10-06 (snap) PHP Bug Type: DOM XML...
    4. #38992 [NEW]: ReflectionMethod::invoke() and ::invokeArgs() static method calls should match
      From: matthew at zend dot com Operating system: Debian SID on i686 PHP version: 5.1.6 PHP Bug Type: Feature/Change Request...
    5. static method and $this
      hello php-general, i found this thread in the mailing-list archive: http://marc.theaimsgroup.com/?l=php-general&m=104182777004472&w=2 to...
  3. #2

    Default Re: Static variable/method

    Hey, please can you specify your problem in detail.

    But normally you have access to public static variables and public static
    methods outside your class with the following structur.

    <YourClassName>.<YourVariableName>

    e.g.

    Math.PI //Where Math is your Class and PI is your public static variable

    and the same for methods

    dietmar.paulus Guest

  4. #3

    Default Re: Static variable/method

    tnx for the reply..I want to access the treeData under the
    hierarchicalCollectionView property of advanceDatagrid.

    what i did is

    private var myGrid:AdvancedDataGrid = new AdvancedDataGrid();

    myGrid.hierarchicalCollectionView.treeData;

    and i got this error

    1119: Access of possibly undefined property treeData through a reference with
    static type mx.collections:IHierarchicalCollectionView. advancedgrid/src

    well!! im sure treeData is existing i run debug and its there. So it came up
    that it might be a static variable of method. I tried to do some experiments
    and i found out static methods and variables are not accessible outside the
    class.

    tnx.

    eztaburnak Guest

  5. #4

    Default Re: Static variable/method

    Yeah, but if you look in the debugger you will see that the icon before the treeData is yellow, this means that this property is protected and not public
    dietmar.paulus Guest

  6. #5

    Default Re: Static variable/method

    A question,

    why don't you use

    myGrid.hierarchicalCollectionView.source??
    dietmar.paulus Guest

  7. #6

    Default Re: Static variable/method

    yes...exactly!!! is there any ways i could access the protected property? tnx i will that one.. : )
    eztaburnak Guest

  8. #7

    Default Re: Static variable/method

    About protected variables and methods have a look at the Dokumentation, in the
    section LanguageElements and then search for protected.

    For short: You only have access to protected properties and methods only in
    subclasses.

    dietmar.paulus Guest

  9. #8

    Default Re: Static variable/method

    tnx.you're a big help.... :) i am new in flex.
    eztaburnak Guest

  10. #9

    Default Re: Static variable/method

    You are welcome
    dietmar.paulus Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139