Professional Web Applications Themes

How to see the .AS file that .MXML file is translated tobefore being compiled to SWF? - Macromedia Flex General Discussion

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.0.x\frameworks\projects\framework\src\mx\ ...

Sponsored Links
  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!


    Sponsored Links
    ???? Guest

  2. #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

  3. #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

  4. #4

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

    Thanks a lot ?
    ???? Guest

  5. #5

    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

Similar Threads

  1. CSS file compiled into SWF...
    By -BoNzO- in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: May 15th, 08:58 AM
  2. How to get swf file of any mxml file in flex1.5
    By ckshah in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: April 24th, 01:02 AM
  3. How to link a .mxml file and a .as file ?
    By bendev in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: April 11th, 06:10 AM
  4. how to load external html file into mxml file
    By ckshah in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 4th, 06:24 PM
  5. Can I embed external MXML in another MXML file?
    By daveobbie in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: March 21st, 02:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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