Results 1 to 2 of 2

Thread: TypeError: Error #1010: A term is undefined and has no properties.

  1. #1
    61
    posts
    Registered User

    TypeError: Error #1010: A term is undefined and has no properties.

    Hi i am currently designing a site an i am having a strage issue with the code. The way the site works is on the main SWF is an empty movieclip and all content is loaded into that, now i have designed some code to control the events, as it stands the program loads up the main section into the swf, then the code controls the buttons on that main SWf and looks for when they are clicked, if they are clicked it will execute another function and load that section up, at the moment i have only created 3 section as i have run into a coding error. When the main code is loaded it runs fine but as soon as i click on the "swf.paper2.websiteBttn" button i get this error:

    TypeError: Error #1010: A term is undefined and has no properties.
    at MethodInfo-5()


    and the Web section doesnt load up 1st time always sometimes it take 2 or 3 clicks until it loads and with each click i get that error. However i have tried to see if it is just the SWF section wthat is causing it by loading different SWF files in but the same error occurs, i dont understand where "MethodInfo-5()" is to solve the proble, my code is below and i hope someone can help??! thanks


    homeBttn.addEventListener(MouseEvent.CLICK, loadWeb);

    function loadWeb(evt:MouseEvent):void {
    var pageLoader:Loader = new Loader();
    var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Main.swf");
    var swf:MovieClip;
    pageLoader.load(pageURLReq);
    pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);

    function imageLoaded(evt:Event):void {
    holder.addChildAt(pageLoader.content, 1 );
    holder.removeChildAt(2);
    swf = evt.target.content;

    var button:MovieClip = swf.paper2.websiteBttn;
    button.addEventListener(MouseEvent.CLICK, openWeb);

    }
    function openWeb(e:Event):void {
    var pageLoader:Loader = new Loader();
    var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Web.swf");
    var swf:MovieClip;
    pageLoader.load(pageURLReq);
    pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);


    function imageLoaded(evt:Event):void {
    trace("Content Loaded");
    holder.addChildAt(pageLoader.content, 1 );
    //trace("Content Loaded 2");
    holder.removeChildAt(2);
    //trace("Content Loaded 3");
    swf = evt.target.content;

    var button:MovieClip = swf.web2.pacBttn;
    button.addEventListener(MouseEvent.CLICK, openPac);

    }
    function openPac(evt:MouseEvent):void {
    var pageLoader:Loader = new Loader();
    var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Pac Images.swf");
    var swf:MovieClip;
    pageLoader.load(pageURLReq);
    pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);

    function imageLoaded(evt:Event):void {
    holder.addChildAt(pageLoader.content, 1 );
    holder.removeChildAt(2);
    }
    }
    }
    }



  2. #2
    61
    posts
    Registered User
    I solved it thanks anyway!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012