Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: stage.addEventListener Custom Class  (Read 11631 times)
almogdesign
Newbie
*
Posts: 3


View Profile Email
« 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
« Last Edit: October 24, 2009, 12:19:13 by almogdesign » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: October 25, 2009, 10:36:23 »

What errors are you getting and where?

-=Cliff>
Logged
almogdesign
Newbie
*
Posts: 3


View Profile Email
« Reply #2 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()
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 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>
Logged
almogdesign
Newbie
*
Posts: 3


View Profile Email
« Reply #4 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
Logged
Pages: [1]
Print