FORUMS: list search recent posts

Flash Photo Gallery problem

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
cynthia hokr
Flash Photo Gallery problem
on Dec 14, 2010 at 4:47:18 pm

I have created a gallery in Flash and I keep getting this error in the output tab:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at gallery_fla::MainTimeline/frame1()[gallery_fla.MainTimeline::frame1:2]
at flash.display::MovieClip/gotoAndStop()
at gallery_fla::MainTimeline/play1()[gallery_fla.MainTimeline::frame1:4]

The below is my code, please tell me what I am doing wrong here!!
Thank you,

function play1(event:MouseEvent):void{
gotoAndStop ("image1a")
function play2(event:MouseEvent):void{
gotoAndStop ("image2a")
function play3(event:MouseEvent):void{
gotoAndStop ("image3a")
function play4(event:MouseEvent):void{
gotoAndStop ("image4a")
function play5(event:MouseEvent):void{
gotoAndStop ("image5a")

function play6(event:MouseEvent):void{
gotoAndStop ("image6a")
function play7(event:MouseEvent):void{
gotoAndStop ("image7a")
function play8(event:MouseEvent):void{
gotoAndStop ("image8a")
function play9(event:MouseEvent):void{
gotoAndStop ("image9a")

Return to posts index

Brodd Nesset
Re: Flash Photo Gallery problem
on Dec 15, 2010 at 8:36:16 am

Apart from a missing chunk of code for btn10a :

Either: there is a typing error somewhere. Perhaps one button instance is called Btn10a (capital B), for instance.

Or: all of the buttons haven't appeared on the stage before the script tries to access them. The simple and crude solution to this is to move the script one frame later in the Timeline. I.e. place the buttons in frame 1 (and extend them to at least frame 2), then place the script in frame 2. Flash won't move it's playhead the frame 2 before all elements are drawn on Stage in frame 1. A simple insurance.

Not everything that can be counted counts, and not everything that counts can be counted.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved