263 posts
  • 7 Years of Membership
  • Antarctica
  • Author Level 2
  • Collector Level 1
+2 more
x360c
says

This is the listener (AS3) I am trying to call from inside a package that is throwing a null object error:

stage.addEventListener (MouseEvent.MOUSE_UP,video02_scrubBar_hitarea_onRelease);

What is wrong?

563 posts
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 2
  • Brazil
+2 more
LuizZak
says

Check the name of the function ‘video02_scrubBar_hitarea_onRelease’, it must be it.

263 posts
  • 7 Years of Membership
  • Antarctica
  • Author Level 2
  • Collector Level 1
+2 more
x360c
says

If I remove the word ‘stage.’ it works. Why?

6231 posts
  • Exclusive Author
  • Elite Author
  • Author Level 8
  • 7 Years of Membership
+13 more
VF
says
If I remove the word ‘stage.’ it works. Why?

This shows that “stage” is not considered as a target name for root.

trace(stage.name); will ouptput null
6231 posts
  • Exclusive Author
  • Elite Author
  • Author Level 8
  • 7 Years of Membership
+13 more
VF
says
If I remove the word ‘stage.’ it works. Why?

Oops, it works even if I use “stage”. It seems we need to mouseUp over an object on stage to trigger the function. If there is no object in the stage to hit, it doesn’t calls the function.

940 posts
  • Affiliate Level 3
  • Author Level 5
  • Collector Level 2
  • Top Monthly Author
+5 more
michelsteege
says

the stage is only avaible on the root, you can send it from there though

3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says
call the stage like this:
 this.stage.addEventListener(...)
 .. or...
 some_clip.stage.addEventListener(...
263 posts
  • 7 Years of Membership
  • Antarctica
  • Author Level 2
  • Collector Level 1
+2 more
x360c
says

Still no luck. Remember that it’s in a package.

by
by
by
by
by
by