Hi, I have this problem. I try to execute a code on my Stage, the problem is when I declare my own class on which they load the file (xml) the code start in the background.
I tried to add a listener in the custom class for Event.COMPLETE but it doesn't work because it only affect the custom class, not the whole movie.
I tried something like this:
XMLLoadData have a constructor to load an XML file and have an event listener for COMPLETE. The problem is on Stage code, it ignored, it go to line 2 (var menuBox:...) instantly. My code work, but badly because handleSelect require the XML datas but it incapable of it because the XMLLoadData was not complete during the execution.Code:var xmlLoad: XMLLoadData = new XMLLoadData("navigation.xml"); var menuBox:MenuBox = new MenuBox(); menuBox.addEventListener("selected", handleSelect); function handleSelect(e:Event):void { //dosomething(); }
It like if I need to add a listener at the top level too, but I am now too confused to figure what I should do.
How I can get around this??




Reply With Quote