A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Error 1009 & embedded SWF.

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    11

    Question Error 1009 & embedded SWF.

    Hi,

    I'm working on a school project, which is to say I'm still pretty new to AS3.
    I had to design an interactive program, and one of my elements is an embedded swf video.

    On one hand, I keep receiving error 1009 which seems to point to the problematic "theory" section. I've checked my label & instance names numerous times- everything looks fine. What else might it be?

    Code:
    stop();
    
    theory_btn.addEventListener(MouseEvent.CLICK,playtheory);
    
    function playtheory(event:MouseEvent):void{
    	gotoAndStop("theory");
    }
    Also, with respect to the embedded swf.. When I debug, this is what I get-

    Code:
    Attemping to launch and connect to Player using URL /Users/Alex/Desktop/school/edesign/3. teaching with digital media/Untitled-1.swf
    [SWF] Users:Alex:Desktop:school:edesign:3. teaching with digital media:Untitled-1.swf - 2477530 bytes after decompression
    [UnloadSWF] Users:Alex:Desktop:school:edesign:3. teaching with digital media:Untitled-1.swf
    Debug session terminated.
    I feel like it might be an easy fix, I'm just not sure what to do.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    When you get the 1009 error you need to check all the objects, for example
    trace(theory_btn);
    When you get null, you know what it is. Also I would check all the variables not just where you suspect.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Jun 2010
    Posts
    11
    So, I decided to address one issue at a time- I removed the embeded video and all mention of it from my project.

    Now, this is what I'm getting with respect to my nav buttons-

    Code:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at Untitled_fla::MainTimeline/frame70()
    The buttons fade into view over the course of 5 frames.. so they are on the stage but invisible starting at frame 65, and by 70 they are in the same spot and fully visible & supposed to be functional.

    I have the actionscript on a separate layer on frame 70, this is what I have-

    Code:
    stop();
    
    theory_btn.addEventListener(MouseEvent.CLICK,playtheory);
    
    function playtheory(event:MouseEvent):void{
        gotoAndPlay("theory");
    }
    
    history_btn.addEventListener(MouseEvent.CLICK,playhistory);
    
    function playhistory(event:MouseEvent):void{
        gotoAndPlay("history");
    }
    
    future_btn.addEventListener(MouseEvent.CLICK,playfuture);
    
    function playfuture(event:MouseEvent):void{
        gotoAndPlay("future");
    }
    
    credits_btn.addEventListener(MouseEvent.CLICK,playcredits);
    
    function playcredits(event:MouseEvent):void{
        gotoAndPlay("credits");
    }
    I've checked all of my labeling mulitple times- all names and instances are correct and in their proper places.. Unless it's a mindblowingly obvious mistake and I'm just not catching it.

    I'd like to upload my .fla, but it's too large of a file. I will happily email it if anyone is willing to take a peek.

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Did you test
    trace(future_btn);
    etc? If you don't find the error, then send me a private message. I will look at the fla once.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Junior Member
    Join Date
    Jun 2010
    Posts
    11
    how do i trace?

  6. #6
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Trace is trace.
    stop();
    trace(future_btn);
    theory_btn.addEventListener(MouseEvent.CLICK,playt heory);

    This trace gave null for all buttons. The reason is that you named the buttons in only the last frame of the tween. You have to give the name in the first frame. So go to the first frame of each tween and give the same name to each button.
    - The right of the People to create Flash movies shall not be infringed. -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center