[Flashcoders] Shared variable scope between mxml and ActionScript classes

2008-09-30 Thread steve linabery
Hello Flashcoders, Let's say I have two files, myApp.mxml: ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; applicationComplete=EntryClass.main() mx:Panel mx:VBox id=myChart width=900 height=300 / /mx:Panel /mx:Application and EntryClass.as: package {

Re: [Flashcoders] Shared variable scope between mxml and ActionScript classes

2008-09-30 Thread Glen Pike
Hi, Here is my 2c EntryClass.main is a static function, but you cannot guarantee that mxml is going to compile your chart to a static variable - you can't access non-static variables from a static function if I remember rightly... What you probably want to do here, which would be a

Re: [Flashcoders] Shared variable scope between mxml and ActionScript classes

2008-09-30 Thread Ian Thomas
Hi Steve, It's because the MXML file myApp.mxml is equivalent to a class file. So what you're really saying is: myApp.as: (roughly translated from myApp.mxml, omitting imports) package { public class myApp extends Application { public var myChart:VBox; public function myApp() {

Re: [Flashcoders] Shared variable scope between mxml and ActionScript classes

2008-09-30 Thread steve linabery
Ian, Excellent explanation. Knowing that mxml files are really just class files...well, it's like turning on a light. Thank you! Incidentally, it turns out that Application.application.myChart.graphics...etc. works fine as well. I was copying the use of Application(Application.application) from