Skip navigation
Currently Being Moderated

Tacking this preloader on almost working - what's missing?

Jun 8, 2009 5:54 AM

Hi

 

I found a cool preloader tutorial with a free preloader which I added onto my flash project.  I did it by creating a new scene before my project scene, and adding the preloader to it.

 

The pre loader works fine, and my project all worked fine before I put the preloader on, but now after the preloader finishes, my site's buttons won't work and in Flash CS4 there is a compiler error:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at website_fla::MainTimeline/frame2()

 

Take the preloader scene away, and my site works fine again.

 

Any idea what I need to do to make them work together?

 

Cheers

 

Shaun

 
Replies
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 8, 2009 5:57 AM   in reply to billygoatkaraoke

    show the code you added.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 8, 2009 6:58 AM   in reply to billygoatkaraoke

    you need a movieclip named:  preloaderMC

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 8, 2009 7:01 AM   in reply to kglad

    actually, it looks like the problem is in frame 2.

     

    click file/publish settings/flash and tick permit debugging.  retest.  note the frame/line number of the error.  find that object that's causing the error.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 8, 2009 7:37 AM   in reply to billygoatkaraoke

    there's something on your main timeline frame 2, line 18.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 8, 2009 7:33 PM   in reply to billygoatkaraoke

    there's only one main timeline.

     

    if your first scene is the preloader scene and that has only one frame, then frame 1 of the next scene is the frame containing the problematic code.  whatever's on line 18 in that frame is the problem.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 8, 2009 11:31 PM   in reply to billygoatkaraoke

    no, i didn't think that added any info.

     

    here this may help you help yourself.  scenes don't exist when you publish/test your swf.  flash arranges the timeline of each scene from the last frame of the previous scene followed immediately by the first frame of the next scene.

     

    so, that's why we know the error is in your 2nd scene's frame 1.  the first scene only has 1 frame so the next frame will be the first frame of the 2nd scene.  if you post the line of code that matches the number in the error message, we should be able to pinpoint the object reference causing the problem.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 9, 2009 6:55 AM   in reply to billygoatkaraoke

    what happens if you comment out all your preloader code?  do you see the same error?

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 9, 2009 7:31 AM   in reply to billygoatkaraoke

    post a link to your fla or zip it and attach it here.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 9, 2009 10:02 PM   in reply to billygoatkaraoke

    here's your corrected file:  www.kglad.com/Files/website.zip

     

    the problem was your use of movieclips in your buttons.  those buttons weren't instantiated when your frame2 first played and the code executed.  the objects on-stage needed to "render" before they were referencable.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 9, 2009 11:18 PM   in reply to billygoatkaraoke

    the duplicate objects in your preloader scene is what you sent me.  just remove all 3 duplicates.

     

    add:

     

    stage.invalidate();

     

    // just before the render listener.  retest.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 10, 2009 7:48 AM   in reply to billygoatkaraoke

    that's all i did and it's working for me:

     

    www.kglad.com/Files/website.zip

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 10, 2009 7:10 PM   in reply to billygoatkaraoke

    when i run it the gilbert buttons opens the gilbert page (complete with tainted love!).  and then if i click anything else the video keeps playing (and if i click gilbert again i hear tainted love playing over tainted love in an awful cacophony that all flashers know too well).

     

    are you sure it's not working for you?  is the website.fla dated 6/10 at 7:47 am?

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 10, 2009 7:44 PM   in reply to billygoatkaraoke

    i see that problem on your site.  but not on mine:   http://www.kglad.com/Files/website.html

     

    i zipped the fla, html and swf and reupped:  http://www.kglad.com/Files/website.zip

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points