Skip to main content
Inspiring
March 2, 2010
Question

Issues w/ ScollPane Component

  • March 2, 2010
  • 3 replies
  • 1022 views

Good Day folks ... hope one can point me in the right direction

Using ScrollPane .. all is well in IDE or as standalone movie ..

When I load the movie containing the SP Component into another movie I get the following error ..

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.containers::ScrollPane/drawBackground()
at fl.containers::ScrollPane/draw()
at fl.core::UIComponent/callLaterDispatcher()

========================================= Below is what's on stage as standalone

[object MainTimeline] root1
     [object MovieClip] instance1
         [object Shape] instance2
         [object MovieClip] instance3
             [object Shape] instance4
     [object MovieClip] Back
         [object Shape] instance5
     [object MovieClip] Instructions
         [object Shape] instance6
         [object TextField] Text
     [object TextField] Title
     [object TextField] SubTitle
     [object SimpleButton] EXit
     [object MovieClip] Pop
         [object MovieClip] instance7
             [object Shape] instance8
         [object TextField] Text
     [object MovieClip] pLdr
         [object Shape] instance9
     [object TextField] LdrText
     [object MovieClip] instance10
         [object Shape] instance11
     [object MovieClip] instance37
     [object MovieClip] instance39
     [object ScrollPane] instance16
         [object ScrollBar] instance19
             [object BaseButton] instance22
             [object LabelButton] instance23
                 [object TextField] instance24
             [object BaseButton] instance25
             [object BaseButton] instance26
         [object ScrollBar] instance27
             [object BaseButton] instance30
             [object LabelButton] instance31
                 [object TextField] instance32
             [object BaseButton] instance33
             [object BaseButton] instance34
         [object Sprite] instance36
             [object Loader] instance41

====================================================== this is whats on stage when loaded into another movie

[object MainTimeline] root1
     [object MainTimeline] instance62
         [object MovieClip] instance63
             [object Shape] instance64
         [object MovieClip] Road
             [object Shape] instance65
             [object MovieClip] instance66
                 [object Shape] instance67
             [object MovieClip] instance68
                 [object Shape] instance69
             [object MovieClip] instance70
                 [object Shape] instance71
             [object MovieClip] instance72
                 [object Shape] instance73
             [object MovieClip] instance74
                 [object Shape] instance75
             [object MovieClip] instance76
                 [object Shape] instance77
             [object MovieClip] instance78
                 [object Shape] instance79
         [object TextField] Title
         [object TextField] SubTitle
         [object MovieClip] Nav
             [object MovieClip] instance80
                 [object Shape] instance81
             [object SimpleButton] toPrev
             [object SimpleButton] toNext
             [object SimpleButton] toNav
         [object MovieClip] instance82
             [object Shape] instance83
         [object TextField] TranScript
         [object UIScrollBar] Scroll
             [object BaseButton] instance105
                 [object ScrollTrack_skin] instance129
                     [object Shape] instance130
             [object LabelButton] instance106
                 [object ScrollThumb_upSkin] instance131
                     [object Shape] instance132
                 [object ScrollBar_thumbIcon] instance133
                     [object Shape] instance134
                 [object TextField] instance107
             [object BaseButton] instance108
                 [object ScrollArrowDown_upSkin] instance122
                     [object Shape] instance123
                     [object Shape] instance124
             [object BaseButton] instance109
                 [object ScrollArrowUp_upSkin] instance125
                     [object Shape] instance126
                     [object MovieClip] instance127
                         [object Shape] instance128
         [object SimpleButton] Exercise
         [object MovieClip] slider
             [object Shape] instance86
         [object MovieClip] Knob
             [object Shape] instance87
         [object MovieClip] Warning
             [object MovieClip] instance88
                 [object Shape] instance89
             [object MovieClip] Sign
                 [object Shape] instance90
         [object MovieClip] Curves
             [object Shape] instance91
             [object TextField] Text
         [object MovieClip] pLdr
             [object Shape] instance92
         [object TextField] LdrText
         [object TextField] Frames
         [object MovieClip] TransPort
             [object MainTimeline] instance120
                 [object Symbol1_1] Pause
                     [object TextField] Text
         [object MovieClip] Aud_Ctl
             [object MainTimeline] instance121
                 [object Symbol1_1] Pause
                     [object TextField] Text
         [object MovieClip] instance118
         [object MainTimeline] instance195
             [object MovieClip] instance196
                 [object Shape] instance197
                 [object MovieClip] instance198
                     [object Shape] instance199
             [object MovieClip] Back
                 [object Shape] instance200
             [object MovieClip] Instructions
                 [object Shape] instance201
                 [object TextField] Text
             [object TextField] Title
             [object TextField] SubTitle
             [object SimpleButton] EXit
             [object MovieClip] Pop
                 [object MovieClip] instance202
                     [object Shape] instance203
                 [object TextField] Text
             [object MovieClip] pLdr
                 [object Shape] instance204
             [object TextField] LdrText
             [object MovieClip] instance205
                 [object Shape] instance206
             [object MovieClip] instance232
             [object MovieClip] instance234
             [object ScrollPane] instance211
                 [object ScrollBar] instance214
                     [object BaseButton] instance217
                     [object LabelButton] instance218
                         [object TextField] instance219
                     [object BaseButton] instance220
                     [object BaseButton] instance221
                 [object ScrollBar] instance222
                     [object BaseButton] instance225
                     [object LabelButton] instance226
                         [object TextField] instance227
                     [object BaseButton] instance228
                     [object BaseButton] instance229
                 [object Sprite] instance231
                     [object Loader] instance236

This topic has been closed for replies.

3 replies

Inspiring
March 3, 2010

Hey Ned .. I REALLY appreciatte your efforts .. and I sense

your getting frustrated w/ me .. but I think you may have missed the point ...

Just so we're clear ..

I added via the IDE a scrollpane component to the stage ..

the ONLY code referencing the SP is ..

imgRegst = new URLRequest(thePath + xml.ImgFile.toString())
spA.load(imgRegst)
spA.addEventListener(ProgressEvent.PROGRESS,function(evt:Event){preLoader(evt,"IMG")})
spA.setSize(615,575)

// Not shown the removeListener

// the preLoader function starts play on completed load ..

If this movie is run as "parent" .. all is fine ..

as soon as I make it child of another movie which is stopped in the frame I load this into .. I get the error ..

the component is fully drawn (instanciated ????) and begins to load (approx a 10th ) when the error occurs ..

if you note the compiler report ..

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.containers::ScrollPane/drawBackground()
at fl.containers::ScrollPane/draw()
at fl.core::UIComponent/callLaterDispatcher()

it's protesting about references internal to the component ..

I suppose there is something I am doing .. this is a modest sized project .. when time allows I'll just try this w/ SP as only object and see if I can replicate in a simple environment ..

I just find it rather bizarre that adding a SP component that does nothing to the parent movie resolves the error ...

As I use this component .. I'm discovering other odd "features" e.g. if it's height > 575 . it fails to listen to any mouse events that occur at Y > 575 ..

THANKS Again for your assist ... Dave

Inspiring
March 2, 2010

Appreciate it Ned.. but the last thing you want to look at is MY code ... ;-)

The error seems to be a referencing error to a property internal to the component ..

     in this instance its in the child object ..

1. It shouldn't happen whether this comp resides in parent or child (assuming there are no other improper references, which in this case there are not)

2. The solution certainly shouldn't be to add a "null" instance of the component in the parent ?????????

if you'd really like to see code ...

Ned Murphy
Legend
March 3, 2010

The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....

- is not in the display list
- doesn't have an instance name (or the instance name is mispelled)
- does not exist in the frame where that code is trying to talk to it
- that you animate the object into place but do not assign instance names in every keyframe for it
- you have consecutive keyframes of instances of the same objects with different names assigned.

If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

Inspiring
March 2, 2010

OK You might call this an answer .. well at least a

solution .. THOUGH I would appreciate some insights as to why ...

adding a SP component w/ no content to the parent movie resolved the issue (don't ask me found it on the web) .. THOUGHTS ????

Ned Murphy
Legend
March 2, 2010

It's hard to offer any feedback since you don't provide any code to look at.  But if you have code that is attempting to target an object, and that object doesn't exist, you will get that error.