How to see the .AS file that .MXML file is translated tobefore being compiled to SWF?

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

  1. #1

    Default How to see the .AS file that .MXML file is translated tobefore being compiled to SWF?

    I am trying to dynamically load some other Applications in one Application, use
    ActionScript but not SWFLoader tag, it looks like:

    <mx:Application>
    <mx:Script>
    <![CDATA[
    private var loader:SWFLoader = new SWFLoader();
    private function loadSWF(url:String):void{
    var baseURL:String = this.url.substr(0, this.url.lastIndexOf("/"));
    var url = baseURL + "/"+ name;
    //even if I did not add any event listener!
    loader.load(url);
    }
    ]]>
    </mx:Script>
    <mx:Button label="B" click="loadSWF('Top_2.swf');" y="10" x="58"/>
    </mx:Application>

    then when me click the button, always occured an error like this:(even if
    every method I add try...catch... )

    TypeError: Error #1009: Cannot access a property or method of a null object
    reference.
    at
    mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::updateCallbacks
    ()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:5043]
    at mx.core::UIComponent/set
    nestLevel()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.a
    s:2522]
    at
    mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::addingChi
    ld()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\SystemManager.as
    :1583]
    at
    mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.0.x\frameworks\pr
    ojects\framework\src\mx\managers\SystemManager.as: 2481]
    at
    mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameH
    andler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\SystemManage
    r.as:2330]


    however, if I use <mx:SWFLoader source="Top_2.swf" /> tag, there is no such
    problem! So I think it must be I didn't init SWFLoader correctly!

    I hope someone can tell me how to crrect this mistake directly, but I more
    wish someone to tell me how to view the .as file that the .mxml file translated
    to before being compiled to a SWF( If there is a such step!)

    Thanks!


    ???? Guest

  2. Similar Questions and Discussions

    1. CSS file compiled into SWF...
      Hello, I have a problem with all my css files in my Flex project. I need them to be compiled into SWF because its the only way to load and switch...
    2. How to get swf file of any mxml file in flex1.5
      hi all, can anybody tell i have one mxml file now when i run this i file server generate swf file dynemically ....now my requirement is i...
    3. How to link a .mxml file and a .as file ?
      Hello, I don't like so much the idea about mixing action Script ( processing code ) and form description ( end user presentation) even if the...
    4. how to load external html file into mxml file
      hi all plz tell me how i can load external html file in mcml file just like say when we receive mail in inbox and see our mail data .. i have...
    5. Can I embed external MXML in another MXML file?
      Hi - I'm new to this so please bear with me. I'm trying to do something like you do in JSP's with a JSP include where I can import prewritten code...
  3. #2

    Default Re: How to see the .AS file that .MXML file istranslated to before being compiled to SWF?

    Maybe the SWFLoader must be one child of one DisplayObject!??
    I found when the swfloader is been added to some DisplayObject in actionScript
    like below, the problem didn't occure any more.

    swfloader.visible = false;
    this.addChild(swfloader); // 'this' is current Application
    swfloader.addEventListener(".....", someHandler);
    swfloader.load("someurl");

    Why? Is this a bug or not?

    I am still waiting someone to tell me where a .mxml file can be translated to
    a .as file which could be visited!

    ???? Guest

  4. #3

    Default Re: How to see the .AS file that .MXML file istranslated to before being compiled to SWF?

    add this para: -keep-generated-actionscript to the compiler options and you'll be able to see all the action script that flex generate for your app.
    mab_bond Guest

  5. #4

    Default Re: How to see the .AS file that .MXML file is translated tobefore being compiled to

    Thanks for providing the option... it's cool.
    Suneel Saguturu 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