Looks like the USER_SUBMIT variable or constant in your UserEvents class is not static, but you're accessing it in a static way.
They should be static, so add they keyword static before the var keyword when you declare USER_SUBMIT and it should all work. On 5/5/09, Alan Rother <alan.rot...@gmail.com> wrote: > Hey All, > I'm playing around with a super simple demo Simeon Bateman posted on his > blog > (http://blog.simb.net/2009/05/01/flex-101-back-to-the-basics/)<http://blog.simb.net/2009/05/01/flex-101-back-to-the-basics/> > > It's just a little tool designed to teach basic MVC / OO principles to newbs > like me. I've get what it's doing and why it works, now I'm trying to extend > on it. > > > I'm trying to take this custom component and instead of displaying it in the > main app, open it in a pop up window. > > <view:UserForm userSubmit="onSubmit(event)"/> > > > I can get it to do that just fine, but I cannot get the custom event > registered with the addEventListener. I get the following error message: > > 1119: Access of possibly undefined property USER_SUBMIT through a reference > with static type Class. > > > > Any thoughts? It works properly when I use it as is in MXML form, but not > when I try to create the object using AS. > > > private function openWindow():void { > win = view.UserForm(PopUpManager.createPopUp(this, UserForm, false)); > PopUpManager.centerPopUp(win); > win.addEventListener(UserEvents.USER_SUBMIT, onSubmit); > } > > -- > Alan Rother > Adobe Certified Advanced ColdFusion MX 7 Developer > Manager, Phoenix Cold Fusion User Group, AZCFUG.org > -- Sent from my mobile device