Title: stage.addEventListener Custom Class Post by: almogdesign on October 23, 2009, 04:43:11 Hello everyone I'm a bit stuck on something and I hope someone can help.
I have my PureMVC view all set up and everything is working fine however I'm importing a custom class Which is a scroll bar it has a stage.addEventListener but I'm getting errors because of the event listener. I'm trying to access the stage via a class and not the view could this be done? This is how I have everything set up in my PureMVC view I create and add the scroll bar class var scrollBox:ScrollBox = new ScrollBox(); which has the stage.addEventListener(MouseEvent.MOUSE_UP, sliderThumbUp); How do I access the stage via custom class. Thanks Almog Title: Re: stage.addEventListener Custom Class Post by: puremvc on October 25, 2009, 10:36:23 What errors are you getting and where?
-=Cliff> Title: Re: stage.addEventListener Custom Class Post by: almogdesign on October 25, 2009, 10:25:22 Hi I' getting the following error message
Its from ScrollBar.as class due to the stage.addEventListener(MouseEvent.MOUSE_UP, sliderThumbUp); I could send you the files thanks for taking the time to help Almog TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.sortfix.ui::ScrollBar() at flash.display::Sprite/constructChildren() at flash.display::Sprite() at flash.display::MovieClip() at com.sortfix.ui::ScrollBox() at com.sortfix.SortFixSearchApp.view.component::MainViewBasic() at com.sortfix.SortFixSearchApp.view::MainViewBasicMediator/onRegister() at org.puremvc.as3.core::View/registerMediator() at org.puremvc.as3.patterns.facade::Facade/registerMediator() at com.sortfix.SortFixSearchApp.view::ApplicationMediator/onRegister() at org.puremvc.as3.core::View/registerMediator() at org.puremvc.as3.patterns.facade::Facade/registerMediator() at com.sortfix.SortFixSearchApp.controller::StartupCommand/execute() at org.puremvc.as3.core::Controller/executeCommand() at Function/http://adobe.com/AS3/2006/builtin::apply() at org.puremvc.as3.patterns.observer::Observer/notifyObserver() at org.puremvc.as3.core::View/notifyObservers() at org.puremvc.as3.patterns.facade::Facade/notifyObservers() at com.sortfix.SortFixSearchApp::ApplicationFacade/sendNotification() at com.sortfix.SortFixSearchApp::ApplicationFacade/startup() at App/init() at App() Title: Re: stage.addEventListener Custom Class Post by: puremvc on October 26, 2009, 09:41:20 This doesn't appear to have anything to do with PureMVC. Looks like a view component implementation problem. You could do a trace in ScrollBar.as just before it does the addEventlistener call to see what's going on. There are 2 possibilities: stage is null OR sliderThumbUp doesn't exist. Are you sure it isn't the latter?
-=Cliff> Title: Re: stage.addEventListener Custom Class Post by: almogdesign on October 26, 2009, 10:07:20 you were you the stage was null, I went ahead and put the EventListerner on the thump on press
Thanks Almog |