how come this is throwing a error

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

  1. #1

    Default how come this is throwing a error

    I am trying to put a view stack function in this example in a class


    [url]http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&product[/url]
    Id=2&postId=5782

    Here is my class code

    its giving me a error


    A file found in a source-path can not have more than one externally visible
    definition.



    package FlexScriptlets
    {
    import components.dashboard;

    public var actualView:Class = components.dashboard;

    public class flxScript
    {
    public function flxScript()
    {
    }

    //Get the view and change it in the stack//
    public function getView(viewClass:Class):int
    {
    var descriptors:Array = views.childDescriptors;
    for (var i:int=0; i<descriptors.length; i++)
    {
    var descriptor:ComponentDescriptor = descriptors[i];
    if(viewClass==descriptor.type) return i;
    }
    throw new Error( "View of " + viewClass + " not found.");
    }


    }//End Class
    }//End Package

    realtime158 Guest

  2. Similar Questions and Discussions

    1. Acrobat Standard 9 : app.viewerVersion is throwing error.
      I'm using Acrobat 9 standard in Windows platform. I have a vb 6.0 application and I have to find the version of Acrobat installed on the user...
    2. AVConversionConvertFromPDFWithHandler is throwing exceptions
      AVConversionConvertFromPDFWithHandler is throwing the below exceptions in debug output. I face some DDE timeout issues after this. Could you please...
    3. PayPal Extension throwing and error
      I just installed the PayPal extension into Dreamweaver 8. I upgraded from MX recently, but just installed this extension today. It is throwing an...
    4. Throwing out 5 boxes Sol 7 still wrapped
      Hate to throw these away if someone can use them. Just make it worth my time to box/ship -rj
    5. Dreamweaver MX Template/Page Update Keeps Throwing an Error
      I'm having the same problem as Stephan, but in the US Version of Dreamweaver MX 6.1. I did not have this problem previously. Not sure what is...
  3. #2

    Default Re: how come this is throwing a error

    Put your var inside the class declaration.
    Tracy
    ntsiii Guest

  4. #3

    Default Re: how come this is throwing a error

    Now it gives me a error on this line

    var descriptors:Array = views.childDescriptors;

    this is because views isn't defined. What object should i define views as.

    here is the error it gives me

    Type was not found or was not a compile-time constant: ComponentDescriptor



    Thanks..

    realtime158 Guest

  5. #4

    Default Re: how come this is throwing a error

    You may need to import the ComponentDescriptor class in your imports in this class.
    Greg Lafrance Guest

  6. #5

    Default Re: how come this is throwing a error

    It fixed the one error now it has troubles on this line

    var descriptors:Array = views.childDescriptors;

    its complaining about the views

    what would i have to declare views but what object is views declared as.

    realtime158 Guest

  7. #6

    Default Re: how come this is throwing a error

    Maybe you need to import views as well.
    Greg Lafrance 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