Skip navigation
Currently Being Moderated

works by itself but wont when loaded

Oct 26, 2010 9:43 AM

ah, i cant figure this out

i have a slide to control the volume of a song it links to that autoplays when it starts

its a blank .fla with the class Volume and an as3 file called Volume with all the codes

 

by itself, it works perfect, but when i go to my index.fla where i try to use a UILoader to load the blank swf called volume

it says:

 

" TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at Volume() "

 

what do you think could be happening?

 
Replies
  • Currently Being Moderated
    Oct 26, 2010 9:47 AM   in reply to kriz_cortes

    Go into your Publish Settings and in the Flash section select the option to Permit Debugging.  Run the file and the error message should include a line number for the offending code.  The 1009 error indicates that whatever object is being targeted on that line does not exist as far as the code sees it.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2010 11:11 AM   in reply to kriz_cortes

    It's hard to say without the code.

     

    So please show your code (from index.fla)

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2010 11:38 AM   in reply to kriz_cortes

    Show the complete error message you get after you've slected that option.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 27, 2010 9:30 AM   in reply to kriz_cortes

    You'll have to do some tracing to try to locate which object is being determined as MIA in your Volume class code.  The 1009 error indicates that something being targeted by your code does not exist when that code executes.  o if the error message is not indicating a line number for you, then you'll have to gradually trace your way thru the functions in the class to see when the error occurs.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 27, 2010 10:30 AM   in reply to kriz_cortes

    "but i dont understand if it's in the Volume class document's code the problem, why does it play perfect ?

    it only gives me a problem when i try to load it to the other stage"

     

    The error is pointing to the Volume class, and since that appears to be the only thing with any length of code... there's your suspect. There may be something in the code that is stage dependent, and you've just switched that point of reference.

     

    "how do i do some tracing to locate wich object is determined as MIA in the code?"

     

    This will be a good exercise for you if you have little familiarity with troubleshooting with the trace function.  You place a trace in each function just to see if you can isolate which function is failing.  You could try putting a trace at the start and end within each function and see if any one of them fails to produce both traces or if the error message occurs between them.  Once you have the function narrowed down, you can go line by line tracing any object the code is trying to target.  If a trace produces a null or an undefined value, then you've likely found the problem.

     

    "how would you load the volumecontrol swf that has the Volume class on to the index stage?

    would you use the UILoader like i am using ?"

     

    I would use the Loader class... I avoid using components as much as possible.  But that has no bearing on your problem.

     

     

     

     

     

     
    |
    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