4 Replies Latest reply on Jun 3, 2009 7:41 AM by RossRitchey

    UIScrollBar not appearing

    RossRitchey Level 4

      I have a dynamic text field that I create and populate with code, and a UIScrollBar that goes along with it.

       

      When I Test Movie, it works correctly, the scroll-bar appears no problem.

       

      The issue comes in when I load the SWF into another project.

       

      I have a SWF interface that loads other pages (SWF, FLV, etc).  When the SWF with the scrollbar is loaded into the interface, the scrollbar does not display at all.

       

      Any ideas?

       

      Here is the code for the scrollbar SWF, if it helps:

       

      import fl.controls.UIScrollBar; 
      
      var myTxt:TextField = new TextField(); 
      myTxt.border = false; 
      myTxt.wordWrap = true; 
      myTxt.multiline = true;
      myTxt.width = 633; 
      myTxt.height = 201.7; 
      myTxt.x = 65; 
      myTxt.y = 213; 
      
      var tf:TextFormat = new TextFormat();
      tf.font = "Calibri";
      tf.color = 0x000000;
      tf.size = 15;
      
      myTxt.text = "Hello,\n\nCan you please help me out with the below e-mail request from Quick-n-Ready?\n\nI've never been asked for this information before and this is a great opportunity for us to begin doing business with a new customer.\n\nThanks for your help.\n\nMark Manager\nSC 999\n\n----- Forwarded by Mark Manager/AppliedIT\nR.D. Buy/Quick-n-Ready\n1 June 11:01 AM\n\n               To: Mark MManager@applied.com\n          Subject: NAFTA Certificate Request\n\nDear Mark,\n\nRegarding your quote for the six Timken bearings (Quote #31-111 28 May) would you be able to provide NAFTA certificates of origins for these products?\n\nR.D. Buy\nPurchasing Agent\nQuick-n-Ready Manufacturing";
      
      myTxt.setTextFormat(tf);
      
      var mySb:UIScrollBar = new UIScrollBar(); 
      mySb.direction = "vertical"; 
      // Size it to match the text field. 
      mySb.setSize(myTxt.width, myTxt.height); 
      
      // Move it immediately right the text field. 
      mySb.move(myTxt.x + myTxt.width, myTxt.y); 
      
      // put them on the Stage 
      addChild(myTxt); 
      addChild(mySb); 
      
      mySb.scrollTarget = myTxt; 
       
      

        • 1. Re: UIScrollBar not appearing
          kglad Adobe Community Professional & MVP

          your component needs to be in your _level0 swf.  add one to its library and retest.

          • 2. Re: UIScrollBar not appearing
            RossRitchey Level 4

            Thanks, kglad.  I thought I had a UIScrollBar in the interface because I have a lot of interface-components that scroll.  Turns out I was using a bunch of components that implement the scroll bar (ScrollPane, TextArea, List, Tree).

             

            Though, I do wonder about something.

             

            I created a test project that only has a UILoader in it.  The UILoader loads the SWF directly, and the scrolling works correctly.  Any ideas why the test SWF I built doesn't need to have the UIScrollBar in it?

            • 3. Re: UIScrollBar not appearing
              kglad Adobe Community Professional & MVP

              no, never heard that.  what if you use a non-component to load your swf?

               

              and in your problem project that you just fixed, were you using a uiloader to load your swf?

              • 4. Re: UIScrollBar not appearing
                RossRitchey Level 4

                Yes, I use a UILoader to load the content in both the interface and the test.

                 

                Here is the code for the test.  It is the minimum necessary to load the SWF, and is fairly representational of how the interface loads the SWF.

                 

                import fl.containers.UILoader;
                
                var simulation:UILoader = new UILoader();
                simulation.setSize(735,600);
                simulation.scaleContent = false;
                simulation.maintainAspectRatio = true;
                
                simulation.source = "4800_065.swf";
                
                addChild(simulation);
                

                 

                I even added a ScrollPane, and edited it to get the ScrollBar assets in the library without the UIScrollBar object to make the situation as similar as possible.