Be a Supporter!

Hw do I access the stage?

  • 254 Views
  • 0 Replies
New Topic Respond to this Topic
dercheezle
dercheezle
  • Member since: Sep. 8, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Hw do I access the stage? 2009-04-17 16:05:54 Reply

Gah, Flex is really annoying.

I have a flex actionscript project that I need to now port over to running in AIR. The problem is, I can't just change the compile settings to do so. So I had to create a new Flex mxml project in order to be able to compile an AIR app.

So now I have to import my main document .as file (The one that would have access to the stage) and place it in the main mxml file.

The problem is, how on earth do I access the stage of the mxml file, so I can pass it through my main .as file and use it for adding children to the display list from there?

My problem is basically:

<Blah blah blah, mxmxl crap>
    <mx:Script>
        <![CDATA[
              var documenty:docClass = new docClass(stage); // DESN'T WORK, GRRRRRRRRRRR >:E
              addChild(documenty);
        ]]>
    </mx:Script>
</mxml crap>