1 2 Previous Next 43 Replies Latest reply: Jan 4, 2013 7:43 AM by kglad RSS

    Can not figure out an error message

    nikolaig Community Member

      I made a test file where all elements seem to work. However when I apply the same set up in my real world complex file with other elements, something throws off the code. Here is the error message I have in the output panel. How do I go around testing what causes the problem?

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

          at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

          at flash.display::MovieClip/gotoAndPlay()

          at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame82:350]

       

      line 72:206 refers to this:

      holderMovieClip.holderMovieClip_Bckgrnd.visible = false;

       

      (which works in the test version)

       

      and line 82:350 refers to this:

      gotoAndPlay("prdctsPopUps");

       

      (this code works, and brings a user to "prdctsPopUps" section, which is frame 72. I guess in is listed in the output panel because this code activates the error, which appears when a user goes to frame 72)

        • 1. Re: Can not figure out an error message
          kglad CommunityMVP

          holderMovieClip.holderMovieClip_Bckgrnd doesn't exist when line 206 executes.

           

          use the trace function to debug.

          • 2. Re: Can not figure out an error message
            nikolaig Community Member

            It does exist. I manually checked for it on the screen and see that it is there and named properly.

            Maybe some code reneders it to null?

            What trace function would I use to debug and on what action do I apply it to?

            • 3. Re: Can not figure out an error message
              Ned Murphy CommunityMVP

              Does the object animate into place in the frames prior to frame 72?  If so, be sure to assign the instance name at the beginning.

              • 4. Re: Can not figure out an error message
                nikolaig Community Member

                no, it does not animate into place. It appears only on frame 72, and this is the code for it:

                 

                holderMovieClip.holderMovieClip_Bckgrnd.visible = false;

                • 5. Re: Can not figure out an error message
                  Ned Murphy CommunityMVP

                  As kglad already said, use the trace function to debug.

                   

                  Just before line 72 try using...

                   

                       trace(holderMovieClip, holderMovieClip.holderMovieClip_Bckgrnd)

                   

                  and see which of the two objects is coming up null.  I'd suspect it would be the first (holderMovieClip) since the 1009 error usually erupts for a directly targeted object rather than a parent.child referenced object.

                   

                  I will leave this to kglad to try to help you with further.  I just thought there might be something precluding the object in the timeline since the error occurs at a frame greater than 1.  Just as a matter of added info, here are a number of possible causes for a 1009 error...

                   

                  the null object....

                   

                  - is declared but not instantiated
                  - doesn't have an instance name (or the instance name is mispelled)
                  - does not exist in the frame where that code is trying to talk to it
                  - is animated into place but is not assigned instance names in every keyframe for it
                  - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).

                  • 6. Re: Can not figure out an error message
                    kglad CommunityMVP

                    the problem is holderMovieClip.holderMovieClip_Bckgrnd.

                     

                    put a trace(this.name,currentFrame) on the first frame of holderMovieClip.holderMovieClip_Bckgrnd, put a trace(holderMovieClip, currentFrame) on the first keyframe that contains holderMovieClip and put trace(this.name,currentFrame) just above line 206 in the frame that contains the error message.

                     

                    paste the trace output here.

                    • 7. Re: Can not figure out an error message
                      nikolaig Community Member

                      On frame 72, line 206 I have this code:

                       

                      holderMovieClip.holderMovieClip_Bckgrnd.visible = false;

                       

                      On line 205 I put this code:

                      trace(holderMovieClip, holderMovieClip.holderMovieClip_Bckgrnd);

                       

                       

                      Here is what I have in the output panel:

                       

                      TypeError: Error #1009: Cannot access a property or method of a null object reference.

                          at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:205]

                          at flash.display::MovieClip/gotoAndPlay()

                          at icysophistication_tl_fla::MainTimeline/onClickfloraLyte_btn()

                      ------------------------------------------------------------------------------------------ -------------

                      if on line 205 I put the code:

                      trace(holderMovieClip);

                       

                      then I have an error coming on line 206 (line 205 is clear of errors now):

                      TypeError: Error #1009: Cannot access a property or method of a null object reference.

                          at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                          at flash.display::MovieClip/gotoAndPlay()

                          at icysophistication_tl_fla::MainTimeline/onClickfloraLyte_btn()

                      ------------------------------------------------------------------------------------------ -------------

                      if on line 205 I put this code:

                      trace(holderMovieClip.holderMovieClip_Bckgrnd);

                       

                      I have an error again coming on line 205

                      TypeError: Error #1009: Cannot access a property or method of a null object reference.

                          at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:205]

                          at flash.display::MovieClip/gotoAndPlay()

                          at icysophistication_tl_fla::MainTimeline/onClickfloraLyte_btn()

                      ------------------------------------------------------------------------------------------ -------------

                       

                      I guess it means that somehow "holderMovieClip_Bckgrnd", which is inside "holderMovieClip" somehow disappears. I know it is there as I checked on it on the screen. It also works when I acess it from other pages. But somehow it "disappears" when I access it from my trouble page. How do I figure out what causes it?

                      • 8. Re: Can not figure out an error message
                        kglad CommunityMVP

                        put

                         

                        trace(this.name,currentFrame) on the first frame of holderMovieClip.holderMovieClip_Bckgrnd,

                         

                        put

                         

                        trace(holderMovieClip, currentFrame) on the first keyframe that contains holderMovieClip and

                         

                        put

                         

                        trace(this.name,currentFrame) just above line 206 in the frame that contains the error message.

                         

                        and paste the output here.

                        • 9. Re: Can not figure out an error message
                          nikolaig Community Member

                          Section/Page with the holderMovieClip.holderMovieClip_Bckgrnd spans from frames 72-81. Which means all of the code I was instructed to put is located on frame 72.

                          trace(this.name,currentFrame) - I put on line 203

                          trace(holderMovieClip, currentFrame) - I put on line 204

                          trace(this.name,currentFrame) - I put on line 205

                           

                          I have a set up where I can acsess frame 72 with the troubled holderMovieClip.holderMovieClip_Bckgrnd from two separate sections/pages of the site. Here is what I have on frame 72 when I acsess it from section/pageA

                          trace(this.name,currentFrame)


                          OUTPUT:

                          instance2 72

                           

                          -----

                           

                          trace(holderMovieClip, currentFrame)

                           

                          OUTPUT:

                          [object MovieClip] 72

                           

                          -----

                           

                          trace(this.name,currentFrame)

                           

                          OUTPUT:
                          instance2 72

                           

                          --------------------------------------

                           

                          Here is what I have on frame 72 when I acsess it from section/pageB. Section/pageB is on frame 82, which is referenced in the code.

                          trace(this.name,currentFrame)


                          OUTPUT:

                          instance2 72

                          TypeError: Error #1009: Cannot access a property or method of a null object reference.

                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                              at flash.display::MovieClip/gotoAndPlay()

                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame82:351]

                           

                           

                          -----

                           

                          trace(holderMovieClip, currentFrame)

                           

                          OUTPUT:

                          null 72

                          TypeError: Error #1009: Cannot access a property or method of a null object reference.

                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                              at flash.display::MovieClip/gotoAndPlay()

                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame82:351]

                           

                          -----

                           

                          trace(this.name,currentFrame)

                           

                          OUTPUT:

                          instance2 72

                          TypeError: Error #1009: Cannot access a property or method of a null object reference.

                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                              at flash.display::MovieClip/gotoAndPlay()

                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame82:351]

                          • 10. Re: Can not figure out an error message
                            kglad CommunityMVP

                            you're not following my suggestions.

                             

                            let's try one thing at a time:

                             

                            put

                             

                            trace(this.name,currentFrame) on the first frame of holderMovieClip.holderMovieClip_Bckgrnd,

                             

                            that means go to holderMovieClip_Bckgrnd's timeline.  on its first frame put that trace.

                            • 11. Re: Can not figure out an error message
                              nikolaig Community Member

                              Ah, did not realise that, I thought all of the code has to be on the main timeline.

                              O.K. one thing at the time. I went inside holderMovieClip, then inside holderMovieClip_Bckgrnd and on the time of holderMovieClip_Bckgrnd I put this trace:

                              trace(this.name,currentFrame)

                               

                              Here is what I have in the Output panel when I acsess it from page A:

                              holderMovieClip_Bckgrnd 1

                               

                              -----------------------------------------

                               

                              Here is what I have in the Output panel when I acsess it from page B (which starts from frame 82):

                              TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                  at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                                  at flash.display::MovieClip/gotoAndPlay()

                                  at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame82:351]

                              • 12. Re: Can not figure out an error message
                                kglad CommunityMVP

                                good.  leave that trace statement and add:

                                 

                                trace(holderMovieClip, currentFrame) on the first keyframe that contains holderMovieClip.

                                 

                                it's important the above trace be on the first keyframe that contains holderMovieClip.  that keyframe is on the same timeline as the timeline that contains your code.  it will only be in frame 206 IF that is the first keyframe that contains holderMovieClip.  if holderMovieClip exists in more than 1 keyframe, the trace will probably not be in frame 206.

                                • 13. Re: Can not figure out an error message
                                  nikolaig Community Member

                                  I left the trace statement. I also made sure that my labeled section where holderMovieClip exists is one frame only. So the code and the art and the holderMovieClip are all cosisting of only one key frame (which is #72).

                                  Here is what I have in the Output panel when I acsess it from page A:

                                  [object MovieClip] 72

                                  holderMovieClip_Bckgrnd 1

                                   

                                  -----------------------------------------

                                   

                                  Here is what I have in the Output panel when I acsess it from page B (which starts from frame 82):

                                  null 72

                                  TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                      at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                                      at flash.display::MovieClip/gotoAndPlay()

                                      at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame82:351]

                                  • 14. Re: Can not figure out an error message
                                    kglad CommunityMVP

                                    what do you mean by "page B" and are you showing two different trace results based on something related to "page B"?

                                    • 15. Re: Can not figure out an error message
                                      nikolaig Community Member

                                      Correct. I am showing two different trace results depending which page I am acsessing the page with holderMovieClip from.

                                      There is page A which gives me good results and then there is page B which gives me bad results. The code which leads to page with holderMovieClip seems to be identical on both pages A and B.

                                      Page B (bad results page) has a big code section which creates an xml loaded thumb scroller. If I apply block comment to this chunk of code then it works and I can have good working results from both pages.

                                      How do I go about and find out what line exactly causes the problem in the code?

                                      • 16. Re: Can not figure out an error message
                                        kglad CommunityMVP

                                        there should be 2 trace statements in your code.  one, on frame 1 of holderMovieClip_Bckgrnd - trace(this.name,currentFrame) and one, on the first keyframe that contains holderMovieClip - trace(this.name,currentFrame).

                                         

                                        add a third trace at the top of your pageB code: trace("xml").

                                         

                                        retest using pageB.  only show the trace results that are followed by the null object error.

                                        • 17. Re: Can not figure out an error message
                                          nikolaig Community Member

                                          There are trace statements trace(this.name,currentFrame) on the first frame of holderMovieClip_Bckgrnd and on the first keyframe that contains holderMovieClip(which is the main time line).

                                          I've added a third trace on top of my troubled page B (which is at frame 82 in the code sample below): trace("xml")

                                          Here are my results:

                                           

                                          xml

                                          instance2 72

                                          TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                                              at flash.display::MovieClip/gotoAndPlay()

                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame82:353]

                                           

                                          ------------------------------------------------------------------------------------------ ---------------------------------------------------

                                           

                                          At your previous suggestion you were instructing me to put the code

                                          trace(holderMovieClip, currentFrame) on the first keyframe that contains holderMovieClip, rather than trace(this.name,currentFrame), here are the results if the trace trace(holderMovieClip, currentFrame) is used:

                                           

                                          xml

                                          null 72

                                          TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                                              at flash.display::MovieClip/gotoAndPlay()

                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame82:353]

                                          • 18. Re: Can not figure out an error message
                                            kglad CommunityMVP

                                            when you use pageB, what you think is holderMovieClip_Bckgrnd is not being displayed.  some other movieclip (with instance name = instance2 - a name assigned by flash because you assigned none) probably looks to you like holderMovieClip_Bckgrnd but flash does not think it is the same.  that movieclip does not contain holderMovieClip_Bckgrnd.

                                             

                                            this problem is on frame 72 of the timeline that contains triggering the error message.

                                             

                                            is frame 72 the first keyframe (and therefore the first frame) that contains holderMovieClip on the timeline that's triggering the error message?  if not, what is the first keyframe and what other keyframes exist that contains holderMovieClip?

                                            • 19. Re: Can not figure out an error message
                                              nikolaig Community Member

                                              Frame 72 is the ONLY frame that contain holderMovieClip on the timeline. I made sure that that this page/section which contains the holderMovieClip consists of only one keyframe.

                                               

                                              Just a reminder that I have another pageA which also accesses frame 72 with the same set up and calls on holderMovieClip and everything is working.

                                               

                                              Major difference with pageB is that pageB has xml loader code for thumb image scroller. If I comment out that image scroller code then the pageB is working as well

                                              • 20. Re: Can not figure out an error message
                                                kglad CommunityMVP

                                                comment-out all the code in pageB and retest.  do you see the same, a different or no error message?

                                                 

                                                and, when you do that, does frame 72 play so the code in that frame executes?

                                                • 21. Re: Can not figure out an error message
                                                  nikolaig Community Member

                                                  I commented out all the code on pageB which has to do with building up an xml loading image scroller and it works with no problem I can access the frame 72 and everything works as expected. Here is what I see in theOutput panel when I go from pageB to frame 72:

                                                  xml

                                                  instance2 72

                                                  holderMovieClip_Bckgrnd 1

                                                  • 22. Re: Can not figure out an error message
                                                    kglad CommunityMVP

                                                    copy and paste you pageB code.

                                                    • 23. Re: Can not figure out an error message
                                                      nikolaig Community Member

                                                      Here is the entire pageB code:

                                                       

                                                       

                                                      stop();

                                                       

                                                      trace("xml")

                                                       

                                                      import com.greensock.*;

                                                      import com.greensock.easing.*;

                                                       

                                                      ////////////////////////////////////////////////////////////////////////////////////////

                                                      ////////////////////////////////////////////////////////////////////////////////////////

                                                      //thumb scroller////////////////////////////////////////////////////////////////////////

                                                       

                                                      //load xml

                                                      var xmlLoader:URLLoader = new URLLoader();

                                                      /////Parse XML

                                                      var xmlData:XML = new XML();

                                                      var xmlPath:String = "loadingAssets/appThumbnails/slideshow_image_scroller_ActiveTuts_mine/app_thmbs_imgs60x90 .xml";

                                                      xmlLoader.load(new URLRequest(xmlPath));

                                                      //trace("loading xml from: " + xmlPath);

                                                      xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

                                                       

                                                      function LoadXML(e:Event):void {

                                                          //trace("xml load complete");

                                                          xmlData = new XML(e.target.data);

                                                          //trace(xmlData.image); //we'll see each image xml element listed in the output panel with this xmlList

                                                          buildScroller(xmlData.image); //rather than trace the xmlList, we send it to our buildScroller function

                                                      }

                                                       

                                                       

                                                      /////Build Scroller MovieClip to Contain Each Image

                                                      var scroller:MovieClip = new MovieClip();

                                                      var padding:Number = 5;//creating a var for padding to be used later on in easier calculations

                                                       

                                                      //making the mask+boundaries

                                                      scroller.mask = maskRctngl;

                                                      var maskBorders:Number = 93;// distance from stage borders 88 px + padding 5 px

                                                       

                                                      this.addChild(scroller);

                                                      //scroller.y = scroller.x = padding;//original version//new (after padding var) positions scroller vertically on stage. Makes y and x = to padding distance

                                                      scroller.y = 645;//old (before padding var) positions scroller vertically on stage

                                                      scroller.x = maskBorders;

                                                       

                                                      var thumbSmall:Number = 1;//setting up scale Tween on rollover

                                                      var thumbLarge:Number = 1.05;//setting up scale Tween on rollover

                                                      /////

                                                       

                                                      /////Parse XML

                                                      //build scroller from xml

                                                      function buildScroller(imageList:XMLList):void{

                                                          //trace("build Scroller");

                                                         

                                                          //var scroller_x:int=0;

                                                         

                                                          for (var item:uint = 0; item<imageList.length();item++) {

                                                              var thisOne:MovieClip = new MovieClip();

                                                             

                                                              //thisOne.img_width=imageList[item].attribute("width");

                                                             

                                                              //outline

                                                              var thumbFadeOut:Number = .3;//setting Border Tweens//doesn't work with TweenMax transitions

                                                              var thumbFadeIn:Number = .7;//setting Border Tweens//doesn't work with TweenMax transitions

                                                             

                                                              var blackBox:Sprite = new Sprite();

                                                              blackBox.graphics.beginFill(0xFFFFFF);

                                                              blackBox.graphics.drawRect(-1, -1, 62, 92);//-1,-1 places rectangle 1px left and up.62, 92 draws rectangle 1px wider on all sides of placed image dimenstions of 60x90

                                                              blackBox.alpha = thumbFadeOut;//setting Border Tweens

                                                              thisOne.addChild(blackBox);

                                                              thisOne.blackBox = blackBox;//setting Border Tweens

                                                             

                                                              //scroller_x += thisOne.img_width + 20;

                                                             

                                                              //var currentX = currentImageWidth+spaceBetween;//modified line to adjust variable thumb widths

                                                       

                                                              //thisOne.x = (84 + padding) *item;//original placement//84 is the width of the loaded images and 15 (which was before paddign var) is the padding

                                                              thisOne.x = thisOne.myx = (60 + padding) *item;//replaces the line above for scale tweenw roll over calculation. "myx" is a made up term which defines the position. 61 is the width of the thumb

                                                              thisOne.itemNum = item;

                                                              thisOne.title = imageList[item].attribute("title");

                                                              thisOne.link = imageList[item].attribute("url");

                                                              thisOne.src = imageList[item].attribute("src");

                                                              thisOne.alpha = 0;//makes all thumb images at alpha=0 before they are fully loaded

                                                              //trace(thisOne.itemNum, thisOne.title, thisOne.link, thisOne.src);

                                                             

                                                              //Loading and Adding the Images

                                                              //image container

                                                              var thisThumb:MovieClip = new MovieClip();

                                                              //add image

                                                              var ldr:Loader = new Loader();

                                                              //var url:String = imageList[item].attribute("src");

                                                              var urlReq:URLRequest = new URLRequest(thisOne.src);

                                                              //trace("loading thumbnail "+item+" into Scroller: " + thisOne.src);//url

                                                              ldr.load(urlReq);

                                                              //assign event listeners for Loader

                                                              ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler_AppPopUps);//tells us when the loading is complete

                                                              ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler_AppPopUps);//tells us if there are any typo errors when the loading is complete

                                                              thisThumb.addChild(ldr);

                                                              thisOne.addChild(thisThumb);

                                                             

                                                              //create listeners for this thumb

                                                              thisOne.buttonMode = true;//makes boxes act as buttons

                                                              thisOne.addEventListener(MouseEvent.CLICK, clickScrollerItem_AppPopUps);//makes boxes act as buttons

                                                              thisOne.addEventListener(MouseEvent.MOUSE_OVER, overScrollerItem_AppPopUps);//traces the title when the mouse is over the bounding box in the Output Panel

                                                              thisOne.addEventListener(MouseEvent.MOUSE_OUT, outScrollerItem_AppPopUps);//traces the title when the mouse is out the bounding box in the Output Panel

                                                       

                                                             

                                                              //add item

                                                              scroller.addChild(thisOne);

                                                          }

                                                          scroller.addEventListener(Event.ENTER_FRAME, moveScrollerThumbs);//adding movement on mouse position

                                                          //trace("termination of build scroller");

                                                         

                                                      }

                                                       

                                                       

                                                      function clickScrollerItem_AppPopUps(e:MouseEvent):void{

                                                          //trace("clicked item " +e.currentTarget.itemNum + " - visit url: " +e.currentTarget.link);//traces the link put in xml file in the Output Panel

                                                          //loads BIG SWFs

                                                          loader_AppPopUpsLoader.url = MovieClip(e.currentTarget).link;//loads xml assigned SWF into the loader//url corresponds to the url in xml file

                                                          loader_AppPopUpsLoader.load(true);//loads xml assigned SWF into the loader

                                                          //loader_howToLoader.url = sourceVar;//will work if set up differently, need to make sure that whatever comes after the = is properly set up

                                                          //it can be a variable like sourceVar or the link property of a movieclip.  as long as the variable/property point to a valid url string, the loader will work.

                                                         

                                                          /////original set up if to open a linked jpg/////

                                                          //var urlRequest:URLRequest = new URLRequest(e.currentTarget.link);

                                                          //try {

                                                              //navigateToURL(urlRequest);

                                                          //}

                                                          //catch (e:Error) {

                                                              // handle error here

                                                              //trace(e);

                                                          //}

                                                          /////original set up if to open a linked jpg/////

                                                      }

                                                       

                                                      //scale Up on rollOver

                                                      function overScrollerItem_AppPopUps(e:MouseEvent):void{

                                                          //trace("over"+e.currentTarget.title);//traces the title when the mouse is over the bounding box in the Output Panel

                                                          TweenMax.to(e.currentTarget, .5, { scaleX:thumbLarge, scaleY:thumbLarge, x:e.currentTarget.myx - e.currentTarget.width * Math.abs(thumbSmall - thumbLarge)/2, y: -e.currentTarget.width * Math.abs(thumbSmall - thumbLarge)/2 });

                                                          TweenMax.to(e.currentTarget.blackBox, .5,{ autoAlpha:.5 } );//setting Border Tweens, originally { alpha:thumbFadeIn }

                                                         

                                                          TweenMax.to(e.currentTarget, .5, {alpha:1, colorMatrixFilter:{contrast:1, brightness: 1, saturation: 1}});

                                                      }

                                                       

                                                      //scale Down on rollOut

                                                      function outScrollerItem_AppPopUps(e:MouseEvent):void{

                                                          //trace("out"+e.currentTarget.title);//traces the title when the mouse is out the bounding box in the Output Panel

                                                          TweenMax.to(e.currentTarget, .5, { scaleX:thumbSmall, scaleY:thumbSmall, x:e.currentTarget.myx, y:0 } );

                                                          TweenMax.to(e.currentTarget.blackBox, .5, { autoAlpha:.3} ); //setting Border Tweens, originally { alpha:thumbFadeOut }

                                                         

                                                          TweenMax.to(e.currentTarget, .5, {alpha:.7, colorMatrixFilter:{contrast:1.1, brightness: .7, saturation: .5}});

                                                       

                                                      }

                                                       

                                                      function completeHandler_AppPopUps(e:Event):void{

                                                          //trace("thumbnail complete "+e.target.loader.parent.parent.name)//tells us when the loading is complete

                                                         

                                                          Bitmap(e.currentTarget.loader.content).smoothing=true;//makes loaded jpg's with smoothing rendition

                                                         

                                                          //size image into scroller (need only if I will have images at different sizes)

                                                          resizeMe(e.target.loader.parent, 60, 90, true, true, false);

                                                         

                                                          TweenMax.to(e.target.loader.parent.parent, .5, {alpha:.7});//makes all thumb images at alpha=.7 after they are fully loaded

                                                          //Tweener.addTween(e.target.loader.parent.parent, { alpha:1, time: .5 } );//caurina version

                                                         

                                                          TweenMax.to(e.target.loader.parent.parent, .5, {colorMatrixFilter:{contrast:1.1, brightness: .7, saturation: .5}});//makes all thumb images at brightness:0.5 after they are fully loaded

                                                       

                                                      }

                                                      ////////////////////////////////////////////////////////////////////////////////////////// ////

                                                      //The resizing function (need only if I will have images at different sizes)

                                                      // parameters

                                                      // required: mc = the movieClip to resize

                                                      // required: maxW = either the size of the box to resize to, or just the maximum desired width

                                                      // optional: maxH = if desired resize area is not a square, the maximum desired height. default is to match to maxW (so if you want to resize to 200x200, just send 200 once, or resizeMe(image, 200);)

                                                      // optional: constrainProportions = boolean to determine if you want to constrain proportions or skew image. default true.

                                                      // optional: centerHor = centers the displayObject in the maxW area. default true.

                                                      // optional: centerVert = centers the displayObject in the maxH area. default true.

                                                      function resizeMe(mc:DisplayObject, maxW:Number, maxH:Number=0, constrainProportions:Boolean=true, centerHor:Boolean=true, centerVert:Boolean=true):void{

                                                          maxH = maxH == 0 ? maxW : maxH;

                                                          mc.width = maxW;

                                                          mc.height = maxH;

                                                          if (constrainProportions) {

                                                              mc.scaleX < mc.scaleY ? mc.scaleY = mc.scaleX : mc.scaleX = mc.scaleY;

                                                          }

                                                          if (centerHor) {

                                                              mc.x = (maxW - mc.width) / 2;

                                                          }

                                                          if (centerVert){

                                                              mc.y = (maxH - mc.height) / 2;

                                                          }

                                                      }

                                                      //The resizing function

                                                      ////////////////////////

                                                       

                                                      //adding movement on mouse position

                                                      var speed:Number;

                                                      function moveScrollerThumbs(e:Event):void {

                                                          if ( mouseY > scroller.y && mouseY < scroller.y + scroller.height){//vertically over scroller

                                                              if (mouseX < stage.stageWidth/2 -maskBorders*2 && mouseX > 0) {//left half of stage explicitly. -padding*2(multiply by 2) gives a "no movement" padding at the center of the stage

                                                                  speed = -(mouseX - (stage.stageWidth/2 -maskBorders*2)) /8;//8 is the number which controls the speed (which is divided by this number). Higher number = slower speed. -padding*2(multiply by 2) gives a "no movement" padding at the center of the stage

                                                              }

                                                              else if (mouseX > stage.stageWidth/2 +maskBorders*2 && mouseX < stage.stageWidth) {//right half of stage explicitly. +padding*2(multiply by 2) gives a "no movement" padding at the center of the stage

                                                                  speed = -(mouseX - (stage.stageWidth/2 +maskBorders*2)) /8;//8 is the number which controls the speed (which is divided by this number). Higher number = slower speed. +padding*2(multiply by 2) gives a "no movement" padding at the center of the stage

                                                              }

                                                             

                                                              else{

                                                                  speed =0;//if in the center area, clear the speed to 0 so we don't have any roll over effect from the last frame

                                                              }

                                                              scroller.x += speed;

                                                             

                                                              //scroller limits// set to padding (could be any number specified numerically) to compliment an established spacing

                                                              if (scroller.x < -scroller.width + stage.stageWidth -maskBorders){//if scroller too far left

                                                                  scroller.x = -scroller.width + stage.stageWidth -maskBorders;

                                                              }

                                                              else if (scroller.x > maskBorders){ //if scroller to far right

                                                              scroller.x = maskBorders;

                                                              }

                                                          }

                                                      }

                                                       

                                                      //////////////////////////////

                                                       

                                                      function errorHandler_AppPopUps(e:IOErrorEvent):void{

                                                          trace("thumbnail error="+e);//tells us if there are any typo errors when the loading is complete

                                                      }

                                                       

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      ///arrowLeft/Right_mc///////////////////////////////////////////////////////////////////// /////////////////////

                                                      var _arrowLeft:MovieClip;

                                                      var _arrowRight:MovieClip;

                                                       

                                                      _arrowLeft = this.getChildByName("arrowLeft_mc") as MovieClip;

                                                      _arrowRight = this.getChildByName("arrowRight_mc") as MovieClip;

                                                       

                                                      //_arrowLeft.visible = _arrowRight.visible = false;

                                                       

                                                       

                                                      _arrowLeft.alpha = _arrowRight.alpha = 0.2;

                                                      //_arrowLeft.visible = _arrowRight.visible = true;

                                                      _arrowLeft.addEventListener(MouseEvent.ROLL_OVER, _rollOverArrowHandler);

                                                      _arrowLeft.addEventListener(MouseEvent.ROLL_OUT, _rollOutArrowHandler);

                                                      _arrowRight.addEventListener(MouseEvent.ROLL_OVER, _rollOverArrowHandler);

                                                      _arrowRight.addEventListener(MouseEvent.ROLL_OUT, _rollOutArrowHandler);

                                                             

                                                              function _rollOverArrowHandler(event:Event):void {

                                                                  TweenLite.to(event.currentTarget, 0.5, {alpha:1});

                                                                  TweenLite.to(event.currentTarget, 0.5, {glowFilter:{color:0xffffff, alpha:1, blurX:15, blurY:15}});

                                                              }

                                                             

                                                              function _rollOutArrowHandler(event:Event):void {

                                                                  TweenLite.to(event.currentTarget, 0.5, {alpha:.2});

                                                                  TweenLite.to(event.currentTarget, 0.5, {glowFilter:{remove:true}});

                                                              }

                                                             

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      ///loader and button/////////////////////////////////////////////////////////////////////////////////// ////////

                                                       

                                                      //import com.greensock.*;

                                                      //import com.greensock.easing.*;

                                                      import com.greensock.loading.*;

                                                      import com.greensock.events.LoaderEvent;

                                                      import com.greensock.loading.display.*;

                                                       

                                                      import flash.events.MouseEvent;

                                                       

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                       

                                                      //this hides the background in the MC container, allowing it to be present on the working screen but not live

                                                      holderMC_AppPopUps.holderMC_applicationsBckgrnd.visible = false;

                                                       

                                                      TweenMax.to(progressBar_AppPopUpsLoader_mc, 0, {blurFilter:{blurX:20, blurY:11}});

                                                      //makes sure that none of the barPopUp_mc is showing

                                                      progressBar_AppPopUpsLoader_mc.gradientbar_appLoader_mcPopUp_mc.scaleX = 0;

                                                      ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////

                                                      //sourceVar has to be specified before the loader set up

                                                      var sourceVar_AppPopUpsLoader:String;

                                                      //sourceVar_AppPopUpsLoader = "images/app_images/PnP/BubbleOasis.swf";//do not specify this if loading from multiple buttons from other pages

                                                      ////////////////////////////////////////////////////////

                                                       

                                                      var loader_AppPopUpsLoader:SWFLoader;

                                                       

                                                      if (loader_AppPopUpsLoader){

                                                      if(loader_AppPopUpsLoader.content){

                                                         loader_AppPopUpsLoader.unload();

                                                      }

                                                      }

                                                       

                                                      loader_AppPopUpsLoader = new SWFLoader(sourceVar_AppPopUpsLoader,

                                                                                              {

                                                                                              estimatedBytes:1500000,

                                                                                              container:holderMC_AppPopUps,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)

                                                                                                                              // if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,

                                                                                                                              // can be any size, can not be scaled as it distorts the content

                                                                                              onProgress:progressHandler_AppPopUpsLoader,

                                                                                              onComplete:completeHandler_AppPopUpsLoader,

                                                                                              centerRegistration:true,

                                                                                              //x:-260, y:-320, //no need for this is if used: centerRegistration:true,

                                                                                              alpha:1,

                                                                                              scaleMode:"none"

                                                                                              //scaleX:0, scaleY:0,

                                                                                              //vAlign:"top",

                                                                                              //width:825,

                                                                                              //height:575,//scales proportionally but I need to cut off the edges

                                                                                              //crop:true,

                                                                                              //autoPlay:false

                                                                                              });

                                                       

                                                      function progressHandler_AppPopUpsLoader(event:LoaderEvent):void{

                                                          progressBar_AppPopUpsLoader_mc.gradientbar_appLoader_mcPopUp_mc.scaleX = loader_AppPopUpsLoader.progress;

                                                      }

                                                       

                                                      function completeHandler_AppPopUpsLoader(event:LoaderEvent):void{

                                                          var loaded_AppPopUpsLoader:ContentDisplay = event.target.content;

                                                          //TweenMax.to(loaded_appLoader, 1.5, {alpha:1, scaleX:1, scaleY:1});//only need this line if corresponding values are changed in SWF loader constructor

                                                          TweenMax.to(progressBar_AppPopUpsLoader_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});

                                                          holderMC_AppPopUps.visible = true;

                                                          }

                                                       

                                                      loader_AppPopUpsLoader.load(true);

                                                       

                                                      //removing the scroller with the clcik//////////////////////////////////////////////////////////////////////////////////// ////////

                                                      //first.setting up the function which will remove the scroller and stop it from consuming resources//

                                                       

                                                      /*function removeScrollerFF():void{

                                                      if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                                                      scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                                                      removeChild(scroller);

                                                      scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                                                      }

                                                      }

                                                       

                                                      ///second. add listeners for navigation objects, i.e a button which will remove the scroller

                                                      testButton_mc.addEventListener(MouseEvent.CLICK, navF);

                                                       

                                                      //third.create the listener functions for navigation objects

                                                      function navF(e:MouseEvent):void{

                                                      //in each listener function call the function that removes the scroller

                                                      removeScrollerFF();

                                                      //trace("you tried to delete the scroller");

                                                      //add the navigation code

                                                      gotoAndPlay("howto");

                                                      }

                                                      */

                                                       

                                                      /////////////////////////

                                                      testButton_mc.buttonMode = true;

                                                      testButton_mc.addEventListener(MouseEvent.CLICK, gotoFrame2);

                                                       

                                                      function gotoFrame2(e:MouseEvent): void{

                                                              gotoAndPlay("prdctsPopUps");

                                                              //trace("you clicked testDelete_mc");

                                                       

                                                      }

                                                      ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////

                                                      /*dummy_mc.visible = false;

                                                      dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE, removeScrollerF);

                                                       

                                                       

                                                      function removeScrollerF(e:Event=null):void{

                                                      if(scroller){

                                                      trace(scroller);

                                                      if(scroller.stage){

                                                      trace(scroller.stage);

                                                      trace(scroller.parent);

                                                      scroller.parent.removeChild(scroller);

                                                      }

                                                      }

                                                      }*/

                                                      ////////////////////////////////////////////

                                                      /*dummy2_mc.visible = false;

                                                       

                                                       

                                                      function removeScrollerF2(e:Event=null):void{

                                                       

                                                      if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                                                      scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                                                      removeChild(scroller);

                                                      scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                                                       

                                                      }

                                                          trace("dummy2_mc works on null");

                                                       

                                                      }

                                                       

                                                      dummy2_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);*/

                                                      • 24. Re: Can not figure out an error message
                                                        kglad CommunityMVP

                                                        1.  comment out this line:

                                                         


                                                        buildScroller(xmlData.image); //rather than trace the xmlList, we send it to our buildScroller function

                                                         

                                                        and retest. 

                                                         

                                                        2.  if that prevents the error, uncomment the above and comment out:

                                                         

                                                        scroller.addEventListener(Event.ENTER_FRAME, moveScrollerThumbs);//adding movement on mouse position

                                                         

                                                        and retest.

                                                         

                                                        3.  if that prevents the error, uncomment the above and comment out the block shown below:

                                                         

                                                        function moveScrollerThumbs(e:Event):void {

                                                            if ( mouseY > scroller.y && mouseY < scroller.y + scroller.height){//vertically over scroller

                                                                if (mouseX < stage.stageWidth/2 -maskBorders*2 && mouseX > 0) {//left half of stage explicitly. -padding*2(multiply by 2) gives a "no movement" padding at the center of the stage

                                                                    speed = -(mouseX - (stage.stageWidth/2 -maskBorders*2)) /8;//8 is the number which controls the speed (which is divided by this number). Higher number = slower speed. -padding*2(multiply by 2) gives a "no movement" padding at the center of the stage

                                                                } else if (mouseX > stage.stageWidth/2 +maskBorders*2 && mouseX < stage.stageWidth) {//right half of stage explicitly. +padding*2(multiply by 2) gives a "no movement" padding at the center of the stage

                                                                    speed = -(mouseX - (stage.stageWidth/2 +maskBorders*2)) /8;//8 is the number which controls the speed (which is divided by this number). Higher number = slower speed. +padding*2(multiply by 2) gives a "no movement" padding at the center of the stage

                                                                } else {

                                                                    speed =0;//if in the center area, clear the speed to 0 so we don't have any roll over effect from the last frame

                                                                }

                                                        /*

                                                               scroller.x += speed;

                                                               if (scroller.x < -scroller.width + stage.stageWidth -maskBorders){//if scroller too far left

                                                                    scroller.x = -scroller.width + stage.stageWidth -maskBorders;

                                                                } else if (scroller.x > maskBorders){ //if scroller to far right

                                                                scroller.x = maskBorders;

                                                                }

                                                        */

                                                            }

                                                        }

                                                         

                                                        and retest.  let me know the results.

                                                        • 25. Re: Can not figure out an error message
                                                          nikolaig Community Member

                                                          1. Doesn't prevent the error. If I comment out the line

                                                          /*buildScroller(xmlData.image); //rather than trace the xmlList, we send it to our buildScroller function*/

                                                          I do not have a scroller appearing on pageB (which is frame 73) and the same message as before in output panel:

                                                          xml

                                                          instance2 72

                                                          TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                                                              at flash.display::MovieClip/gotoAndPlay()

                                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame73:353]

                                                           

                                                          2. With the line specififed previously in the section1 uncommented and this line commented out:

                                                          /*scroller.addEventListener(Event.ENTER_FRAME, moveScrollerThumbs);//adding movement on mouse position*/

                                                          I have a scroller appearing on pageB (which is frame 73), it doesn't move anymore on the mouseOver, and the same message as before in output panel:

                                                          xml

                                                          instance2 72

                                                          TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                                                              at flash.display::MovieClip/gotoAndPlay()

                                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame73:353]

                                                           

                                                          3. Both lines specified in sections 1 and 2 are uncommented.

                                                          This block is commented out:

                                                          /*

                                                                 scroller.x += speed;

                                                                 if (scroller.x < -scroller.width + stage.stageWidth -maskBorders){//if scroller too far left

                                                                      scroller.x = -scroller.width + stage.stageWidth -maskBorders;

                                                                  } else if (scroller.x > maskBorders){ //if scroller to far right

                                                                  scroller.x = maskBorders;

                                                                  }

                                                          */

                                                           

                                                          I have the same results as in section 2. I have a scroller appearing on pageB (which is frame 73), it doesn't move anymore on the mouseOver, and the same message as before in output panel:

                                                           

                                                          xml

                                                          you rolled over me

                                                          you rolled off me

                                                          instance2 72

                                                          TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame72()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame72:206]

                                                              at flash.display::MovieClip/gotoAndPlay()

                                                              at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51b_AppsPopUpsThumbs_f la.mainsite_mc_2::frame73:353]

                                                          • 26. Re: Can not figure out an error message
                                                            kglad CommunityMVP

                                                            just to clarify: commenting out all the code that you posted in message 23 prevents the error, correct?

                                                             

                                                            if yes, comment out:

                                                             

                                                            var xmlLoader:URLLoader = new URLLoader();

                                                            var xmlData:XML = new XML();

                                                            var xmlPath:String = "loadingAssets/appThumbnails/slideshow_image_scroller_ActiveTuts_mine /app_thmbs_imgs60x90.xml";

                                                            xmlLoader.load(new URLRequest(xmlPath));

                                                            //trace("loading xml from: " + xmlPath);

                                                            xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

                                                             

                                                            function LoadXML(e:Event):void {

                                                                //trace("xml load complete")

                                                                xmlData = new XML(e.target.data);

                                                                //trace(xmlData.image); //we'll see each image xml element listed in the output panel with this xmlList

                                                                buildScroller(xmlData.image); //rather than trace the xmlList, we send it to our buildScroller function

                                                            }

                                                             

                                                            var scroller:MovieClip = new MovieClip();

                                                            var padding:Number = 5;//creating a var for padding to be used later on in easier calculations

                                                            scroller.mask = maskRctngl;

                                                            var maskBorders:Number = 93;// distance from stage borders 88 px + padding 5 px

                                                            this.addChild(scroller);

                                                            scroller.y = 645;//old (before padding var) positions scroller vertically on stage

                                                            scroller.x = maskBorders;

                                                            var thumbSmall:Number = 1;//setting up scale Tween on rollover

                                                            var thumbLarge:Number = 1.05;//setting up scale Tween on rollover

                                                             

                                                            and test.  does that prevent the error?

                                                            • 27. Re: Can not figure out an error message
                                                              nikolaig Community Member

                                                              Correct, commenting out the entire code does prevent the error.

                                                              Just retested that with the entire code commented out from pageB. Have positive working results with this message in output panel:

                                                               

                                                              xml

                                                              instance2 72

                                                              holderMovieClip_Bckgrnd 1

                                                              ------------------------------------------------------------------

                                                              If I comment out section as you advised than the whole site does not work. As I understand due to the fact that a lot variables are being set up in this section which are used later on, but since commented out do not exist. Here is what I have in Compiler Errors :

                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 741120: Access of undefined property padding.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1051120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1071120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1361120: Access of undefined property thumbLarge.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1361120: Access of undefined property thumbLarge.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1361120: Access of undefined property thumbSmall.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1361120: Access of undefined property thumbLarge.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1361120: Access of undefined property thumbSmall.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1361120: Access of undefined property thumbLarge.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1451120: Access of undefined property thumbSmall.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1451120: Access of undefined property thumbSmall.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1951120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1951120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1951120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1961120: Access of undefined property maskBorders.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1971120: Access of undefined property maskBorders.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 1991120: Access of undefined property maskBorders.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2001120: Access of undefined property maskBorders.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2061120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2061120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2091120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2091120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2091120: Access of undefined property maskBorders.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2101120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2101120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2101120: Access of undefined property maskBorders.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2121120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2121120: Access of undefined property maskBorders.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2131120: Access of undefined property scroller.
                                                              Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 2131120: Access of undefined property maskBorders.

                                                               

                                                              Please let me know if you would like me to go deeper into the code and comment out functions which use all of these vars

                                                              • 28. Re: Can not figure out an error message
                                                                nikolaig Community Member

                                                                Through dumb blocking out every single line of code and retesting the movie I finaly found the line which causes the problem:

                                                                this.addChild(scroller);

                                                                If I block out this line I obviously have no scroller on the screen, but everything works and the rest of the scroller code remains on the screen.

                                                                Is there any fix for that?

                                                                -------------------------------------------------------------

                                                                Here is what I have in the output panel:

                                                                xml

                                                                instance2 72

                                                                holderMovieClip_Bckgrnd 1

                                                                • 29. Re: Can not figure out an error message
                                                                  kglad CommunityMVP

                                                                  uncomment the this.addChild(scroller), line and use these two trace statements above and below it:

                                                                   

                                                                  trace(holderMovieClip.name);

                                                                  this.addChild(scroller);

                                                                  trace(holderMovieClip.name);

                                                                  • 30. Re: Can not figure out an error message
                                                                    nikolaig Community Member

                                                                    When I use this set up I get errors in the pageB (which is frame 73)

                                                                    On PageB my loader doesn't work as well as the test button which should bring user to section that contain holderMovieClip.

                                                                    Here is what I get in the output panel

                                                                     

                                                                    xml

                                                                    TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                                                        at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame73()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame73:37]

                                                                        at flash.display::MovieClip/gotoAndPlay()

                                                                        at appimgCollage5F_1levelIn_fla::MainTimeline/ButterflyGlow_PopUp()

                                                                    ------------------------------------------------------------------------------------------ ---------------------------------------------------

                                                                    if I only comment out the line

                                                                    this.addChild(scroller);

                                                                    then I get a working loader, working test button as well.

                                                                    ------------------------------------------------------------------------------------------ ---------------------------------------------------

                                                                    I have the same error messages #1009 if I apply the trace statements only above or only below the line this.addChild(scroller);

                                                                    • 31. Re: Can not figure out an error message
                                                                      kglad CommunityMVP

                                                                      if holderMovieClip is not already in a layer by itself, create a new layer and move holderMovieClip to that layer.  that layer should have a keyframe at 72 where holderMovieClip first exists.  there should be no keyframe at frame 73.  retest.

                                                                      • 32. Re: Can not figure out an error message
                                                                        nikolaig Community Member

                                                                        holderMovieClip is on the layer by itself, no other items are on that layer.

                                                                        That layer is has a singular keyframe at 72.

                                                                         

                                                                        However there is a keyframe at frame 73 as this is where pageB begins and spans from frame 73 to 82.

                                                                        I have my main time line segmented out into labeled sections to which I refer as pages.

                                                                        How can I not have a key frame at 73 if this is a beginning of a new section?

                                                                        I have a singular keyframe on 72, then there is no singular keyframe on 73 but a segment from 73 to 82. Is this OK?

                                                                        Did you want me to have just a blank key frame at 73, i.e. a gap between these sections?

                                                                         

                                                                        I retested the movie with this set up, which is located at pageB:

                                                                        trace(holderMovieClip.name);

                                                                        this.addChild(scroller);

                                                                        trace(holderMovieClip.name);


                                                                        Here are the results from the output panel:

                                                                        TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                                                            at acolyte51b_AppsPopUpsThumbs_fla::mainsite_mc_2/frame73()[acolyte51b_AppsPopUpsThumbs_fla. mainsite_mc_2::frame73:37]

                                                                            at flash.display::MovieClip/gotoAndPlay()

                                                                            at appimgCollage5F_1levelIn_fla::MainTimeline/ButterflyGlow_PopUp()

                                                                        As before when I use this set up I get errors in the pageB (which starts at frame 73 and goes to frame 82)

                                                                        On PageB my loader doesn't work as well as the test button which should bring user to section that contain holderMovieClip.

                                                                         

                                                                        frame73:37 refers to the first (upper)
                                                                        trace(holderMovieClip.name);

                                                                        • 33. Re: Can not figure out an error message
                                                                          kglad CommunityMVP

                                                                          does the layer that contains holderMovieClip in frame 72 also have a non-keyframe at frame 73?

                                                                          • 34. Re: Can not figure out an error message
                                                                            nikolaig Community Member

                                                                            No, I removed all the frames (even thogh they were empty) after frame 72 on the layer which contains holderMovieClip. This way frame 73 starts empty (no frames) on the layer which contains holderMovieClip.

                                                                            • 35. Re: Can not figure out an error message
                                                                              kglad CommunityMVP

                                                                              you need a frame 73 in holderMovieClip's layer otherwise, holderMovieClip doesn't exist on frame 73 (when your pageB code executes).

                                                                              • 36. Re: Can not figure out an error message
                                                                                nikolaig Community Member

                                                                                Wow, it works! (but creates a bug)

                                                                                I now have holderMovieClip on frame 73. It has no other function as just to be present there, so I set its visible=false;

                                                                                holderMovieClip.holderMovieClip_Bckgrnd.visible = false;

                                                                                It works if I a user first goes to pageB and then navigates to frame 72 which contains holderMovieClip. This way there is nothing loaded in holderMovieClip and when a user goes to frame 72 there is an SWF Loader hosted in holderMovieClip which loads an swf file onto screen.

                                                                                However it doesn't work if I first access frame 72 from pageA which loads an SWF file as well using SWF loader which is hosted in holderMovieClip. Then I navigate to pageB from frame 72 -  suddenly I already have an SWF file which was previously loaded on frame72 from pageA. It doesn't go away because I now have holderMovieClip present on the screen on pageB.

                                                                                How do I keep it on the screen, yet at the same time make sure that a previously loaded SWF file dissapears?

                                                                                • 37. Re: Can not figure out an error message
                                                                                  kglad CommunityMVP

                                                                                  remove your swf loader from holderMovieClilp in frame 73.

                                                                                  • 38. Re: Can not figure out an error message
                                                                                    nikolaig Community Member

                                                                                    There is no SWF Loader in holderMovieClip in frame 73.

                                                                                    SWF loader is being constructed via  code on pageA and is being hosted in holderMovieClip.

                                                                                    Here is the code for SWF Loader on pageA:

                                                                                     

                                                                                    var sourceVar_ProductsPopUps:String;//has to be specified only once for the rest of all the buttons so individual SWFs may be loaded into LoaderMax or UILoader

                                                                                     

                                                                                    var loaderProductPopUps:SWFLoader;

                                                                                     

                                                                                    if (loaderProductPopUps){

                                                                                    if(loaderProductPopUps.content){

                                                                                       loaderProductPopUps.unload();

                                                                                    }

                                                                                    }

                                                                                     

                                                                                    loaderProductPopUps = new SWFLoader(sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the products page.

                                                                                                                            {

                                                                                                                            estimatedBytes:5000,

                                                                                                                            container:holderMovieClip,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)

                                                                                                                                                      // if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,

                                                                                                                                                      // can be any size, can not be scaled as it distorts the content

                                                                                                                            onProgress:progressHandler,

                                                                                                                            onComplete:completeHandler,

                                                                                                                            centerRegistration:true,

                                                                                                                            alpha:1,

                                                                                                                            scaleMode:"none",

                                                                                                                            width:540,

                                                                                                                            height:730,//scales proportionally but I need to cut off the edges

                                                                                                                            crop:true,

                                                                                                                            autoPlay:false

                                                                                                                            });

                                                                                     

                                                                                    function progressHandler(event:LoaderEvent):void{

                                                                                        progressBarPopUp_mc.gradientbar_appLoader_mcPopUp_mc.scaleX = loaderProductPopUps.progress;

                                                                                    }

                                                                                     

                                                                                    function completeHandler(event:LoaderEvent):void{

                                                                                        var loadedImage:ContentDisplay = event.target.content;

                                                                                        TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});

                                                                                        }

                                                                                     

                                                                                    loaderProductPopUps.load(true);

                                                                                    • 39. Re: Can not figure out an error message
                                                                                      kglad CommunityMVP

                                                                                      when you exit from pageA, execute:

                                                                                       

                                                                                      if (loaderProductPopUps){

                                                                                      if(loaderProductPopUps.content){

                                                                                         loaderProductPopUps.unload();

                                                                                      }

                                                                                      }

                                                                                      1 2 Previous Next