Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7076165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:15:56+00:00 2026-05-28T06:15:56+00:00

Ok so i have this dyanamic textbox called logtxt and i have a UIScrollbar

  • 0

Ok so i have this dyanamic textbox called logtxt and i have a UIScrollbar attached to it. It works, but only if i add it through typing/pasting it into the textbox. I need it to work when i add the text through the code. (it is linked correctly through the components inspector)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:15:56+00:00Added an answer on May 28, 2026 at 6:15 am

    I made the movieclips drag_mc and track_mc and put them in a movie clip called scroll_mc. Then i have a class for making the scroll bar:

    package {
        import flash.display.Stage;
        import flash.display.MovieClip;
        import flash.events.*;
        import flash.geom.Rectangle;
    
    class MakeScrollBar {
        private var host_mc:MovieClip;
        private var call_back:Function;
    
        private var drag_mc:MovieClip;
        private var track_mc:MovieClip;
    
        private var scroll_rect:Rectangle;
        private var upper_limit:Number;
        private var range:Number;
    
        public function MakeScrollBar( _mc:MovieClip, cb:Function ) {
            host_mc = _mc;
            call_back = cb;
    
            drag_mc = host_mc.drag_mc; // 
            drag_mc.buttonMode = true;
            drag_mc.mouseChildren = false
            drag_mc.addEventListener( MouseEvent.MOUSE_DOWN, press_drag );
            track_mc = host_mc.track_mc;
            track_mc.buttonMode = true;
            track_mc.mouseChildren = false
            track_mc.addEventListener( MouseEvent.CLICK, click_track );
    
            set_limits();
    
        }
    
        private function press_drag( event:MouseEvent ):void {
            drag_mc.stage.addEventListener( MouseEvent.MOUSE_UP, release_drag, false, 0, true );
    
            drag_mc.startDrag( false, scroll_rect );
            drag_mc.addEventListener( Event.ENTER_FRAME, drag );
        }
    
        private function release_drag( event:MouseEvent ):void {
            drag_mc.removeEventListener( Event.ENTER_FRAME, drag );
            drag_mc.stage.removeEventListener( MouseEvent.MOUSE_UP, release_drag );
            drag_mc.stopDrag();
        }
    
        private function click_track( event:MouseEvent ):void {
            trace( "Click track" );
        }
    
        private function set_limits():void {
            scroll_rect = new Rectangle( track_mc.x, track_mc.y, 0, track_mc.height - drag_mc.height );
            upper_limit = track_mc.y;
            range = track_mc.height - drag_mc.height;
        }
    
        private function drag( event:Event ):void {
            var p = ( drag_mc.y - track_mc.y ) / range;
            call_back( p );
        }
    }
    }
    

    and a document class

    package {
        import flash.display.Sprite;
        import flash.display.MovieClip;
        import flash.text.TextField;
        import flash.events.MouseEvent;
    
        public class ScrollBarAS3 extends Sprite {
            public var my_scrollbar:MakeScrollBar;
    
            public function ScrollBarAS3() {
                my_scrollbar = new MakeScrollBar( scroll_mc, scroll_text );
            }
    
            public function scroll_text( n:Number ) {
                scroll_txt.scrollV = Math.round( ( scroll_txt.maxScrollV - 1 ) * n ) + 1;
            }
        }
    }
    

    scroll_txt is the textbox

    got it from http://www.webdevils.com/2007/10/13/as3-version-of-scrollbar-class/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have dynamic content in a div called txtresults like this: <div id=txtresults></div> This
I have problems running a dynamic LIKE statement in my project: this query works
Ok so i have a character_mc that moves on mouse click, a logtxt dyanamic
I have used the following code to generate some dynamic checkboxes. This works for
What I have is button that should open another page only if textbox length
I have a textbox whose id is other and I want to populate this
I've already seen this post: Changing the size of Html.TextBox But I cannot change
In this page there's a way to dynamic add html (textbox,input button and radio
I have this repeater where i have added some validation to a textbox. However,
i have this dynamic textbox, and i want to get value by using class.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.