been a while since i used flash…
the minor problem im having is that, i have a button called ” btninviz ”
when this button is clicked, i want it to play a movieclip called ” bannerRoll “.
the banner consists of a simple animation of images going back n forth etc…now,
for testing purposes, i want it so that on click, it goes and stops on the last frame (651)
ive created a function for it like so:
btninviz.addEventListener(MouseEvent.CLICK,playBnnr);
function playBnnr(e:Event):void{
bannerRoll.gotoAndStop(651);
trace("working");
}
when i click the button, i get this error which i dont know how to interpret:
*TypeError: Error #1009: Cannot access a property or method of a null object reference.
at jaro_fla::wholesect_2/playBnnr()[jaro_fla.wholesect_2::frame159:4]*
to make sure my function is working, i took out the bannerRoll part and just did a simple
btninviz.addEventListener(MouseEvent.CLICK,playBnnr);
function playBnnr(e:Event):void{
//bannerRoll.gotoAndStop(651);
gotoAndPlay(1);
trace("working");
}
and it works. so i know the function is working.
the MC DOES exist…matter of fact to make 100% sure, i took the button code and put it on the same frame where the MC exists and still nothing.
any ideas?
thanks in advance.
Your call to
bannerRollis failling which means it is ether at another location or under a different name.As you just typed it’s instance name make sure you are on the same frame as it. (Have you given it an instance name? Not just a movieclip name).
try
trace(bannerRoll)if it traces undefined, you aren’t accessing the movieclip correctly.