Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Error 1119 When Trying to Load Movie Clips

    Kind of a newbie, so bear with me, please. I'm setting up a minisite and have a navigation menu (functioning as a movie clip) that's meant to launch other movie clips. Code on the parent file:

    Code:
    var myLoader:Loader = new Loader();
    myLoader.load(new URLRequest("main.swf"));
    addChild(myLoader);
    Code on the child movie clip:

    Code:
    stop();
    
    function buttonClick(event:MouseEvent):void
    {
        gotoAndStop(event.target.name);
        
        tyes.enabled = true;
        winterpassing.enabled = true;
        otherwork.enabled = true;
        author.enabled = true;
        
        event.target.enabled = true;
        this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
    }
    
    tyes.addEventListener(MouseEvent.CLICK, buttonClick);
    winterpassing.addEventListener(MouseEvent.CLICK, buttonClick);
    otherwork.addEventListener(MouseEvent.CLICK, buttonClick);
    author.addEventListener(MouseEvent.CLICK, buttonClick);
    I've yanked this practically straight out of a book and have no idea why I keep getting this error message:

    1119: Access of possibly undefined property myLoader through a reference with static type flash.display:DisplayObjectContainer.
    this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
    Any ideas? Let me know if you need clarification...not sure I explained this too well.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    This thread deals with a UILoader but I think you are having a similar issue.
    http://www.codingforums.com/showthread.php?t=138242
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    coffeebeans (05-12-2008)

  • #3
    New to the CF scene
    Join Date
    May 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you! That did the trick. Changed one line from

    Code:
    this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
    to

    Code:
    (root as MovieClip).myLoader.load(new URLRequest(event.target.name + ".swf"));
    Unfortunately, a new problem came up. Whenever I click on a button in the navigation, none of my other SWFs are showing up and I end up with this error message:

    TypeError: Error #1009: Cannot access a property or method of a null object reference. at rapp_fla::mcMenu_1/buttonClick()
    All of my SWFs are in the same directory as the parent SWF, are named correctly, and all work perfectly on their own, but just won't load within the main SWF.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    trace this and see what you get
    PHP Code:
    trace(event.target.name ".swf"); 
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New to the CF scene
    Join Date
    May 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ack, sorry, haven't been working in Flash for too long (as if that weren't obvious already). Where am I supposed to add or replace the trace line? I've tried a few different spots and haven't been able to figure it out.

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    function buttonClick(event:MouseEvent):void
    {
        gotoAndStop(event.target.name);
        
        tyes.enabled = true;
        winterpassing.enabled = true;
        otherwork.enabled = true;
        author.enabled = true;
        
        event.target.enabled = true;
    trace(event.target.name + ".swf");
        (root as MovieClip).myLoader.load(new URLRequest(event.target.name + ".swf"));
    }
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did you ever get this fixed? I am having the same problem. I think we used the same book. Any help?


  •  

    Posting Permissions

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