Help wth combobox scrollbar color

I'm using Flash 8 and actionscript.
How do I customize the combobox scrollbar? I've managed to
change other parts of the combobox but not the combobox scrollbar.
It would be really cool if I could change the combobox
scrollbar track color and slider grip thing . . .
Any help would be greatly appreciated!
Peace,
Hondo311
Here's my actionscript for the combobox:

scrollTrackColor is a property of the ScrollPane and should
work, just the same way you already did.
But not everything is customizable with styles. For many
things you have to edit the skins.
The documentation for components could be much better...
here is how to edit the skin of the scrollpane:
http://livedocs.macromedia.com/flash/8/main/00004225.html

Similar Messages

  • Change scrollbar color

    I am trying to figure out away to modify the appearance of scrollbars. Ideally I would like to do this just for one particular VI, but temporarily changing the LabVIEW options would also be acceptable.
    According to this page http://zone.ni.com/reference/en-XX/help/371361E-01/lvdialog/color_options/, I should be able to change the scrollbar color from the Options Dialog Box. However, the Colors category is not present for me. (I'm using version 9.0 and the article was written for 8.6. Maybe something changed?)
    Any help would be greatly appreciated, thanks in advance! 

    That setting in the Options page actually refers to the scrollbar of the VI's front panel and block diagram scrollbar, and not to the scrollbar control. The scrollbar controls are "system" controls, and hence adapt to the operating system. If you try to customize the scrollbar in the Control Editor, you can't change to customization mode, and hence there is no method for changing the color. I know one suggestion that I've heard in the past is to use an alternate control, like a slider, which can be customized.

  • Help with ComboBox, datasource from database

    Hi there,
    i am new to Flex technology and desperately need help with
    combobox.
    I have a combobox in my app and the datasource comes from
    MySQL database. I use a PHP script to populate the combobox. Say in
    the datatabse table, I have the following result:
    id name
    1 dog
    2 cat
    3 horse
    In the app, the combobox will have the list as the name of
    the animals: dog, cat, horse. But when the user selects dog, how do
    I get the selected id 1 instead of the label "dog".
    Any help/suggestion will be appreciated.

    Hi again,
    the xml for the combobox datasource is as follows
    <animals>
    <animal>
    <id>1</id>
    <name>dog</name>
    </animal>
    <animal>
    <id>2</id>
    <name>cat</name>
    </animal>
    <animal>
    <id>3</id>
    <name>horse</name>
    </animal>
    </animals>
    and my <mx:HTTPService> is:
    <mx:HTTPService id="dropDown" useProxy="false" url="
    http://localhost/~ronnyk/combobox.php"
    resultFormat="e4x" result="get_drop_down(event)" />
    public function get_drop_down(e:ResultEvent):void{
    var dropArr:XML = e.result as XML;
    cb.dataProvider = dropArr.animal;
    cb.labelField = "name";
    cb.data = "id";
    public function clickme():void{
    txtinput.text = cb.selectedItem as String;
    I can't figure out which part I did wrong, in order to get
    the id instead of the name when the user clicks the button

  • Changing scrollbar color on list widget.

    Good Afternoon,
    I need to know if its possible to change the scrollbar color of the list widget. If so, where can I find information covering this.
    Thank you.

    Repost.

  • Target ComboBox label color on MouseOver or RollOver

    I am having a hard time figuring out how to change the label color of a combobox on rollover prior to clicking the combobox to make a new selection. I understand how to set the color of the label, how to change the textRollOverColor, textSelectedColor, etc, but setting the current label color for a combobox is stumping me.
    Thanks in advance.

    I'm not sure how this could be done using style tag.. if possible then ignore this solution..
    Well, you need a custom ComboBox that extends from the base ComboBox.. as below..
    package src
    import flash.events.MouseEvent;
    import mx.controls.ComboBox;
    public class ExtendedCombo extends ComboBox
    public function ExtendedCombo()
    super();
    protected override function createChildren():void
    super.createChildren();
    textInput.addEventListener(MouseEvent.ROLL_OVER, onTextMouseOver);
    textInput.addEventListener(MouseEvent.ROLL_OUT, onTextMouseOut);
    private function onTextMouseOver(event:MouseEvent):void
    textInput.setStyle("color", "0xff0000");
    private function onTextMouseOut(event:MouseEvent):void
    textInput.setStyle("color", "0x0B333C");
    hope this helps,
    BaBo,

  • Help with ComboBox Selection Update

    Hello,
    I am trying to make this application display all its labels in a different language depending on which locale the user picks from the ComboBox. The variables are being read from the ResourceBundles correctly (see command-line debugging statements) but I cannot get the pane to 'refresh' when the item is selected. I've tried everything I can think of! Please help! :)
    (This assignment was to internationalize a program we wrote for a previous assignment, so this program wasn't originally written to do this. I am trying to add this functionality to my existing project, so it's not ideal).
    Thank you for any advice, help or hints you can give!
    Program(PrjGUI)
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ItemEvent;
    import java.awt.event.ItemListener;
    import javax.swing.*;
    import java.text.DateFormat;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import java.util.Locale;
    import java.util.ResourceBundle;
    import java.util.TimeZone;
    public class PrjGUI extends JFrame
       //**** Instance Variables for both classes
       private JRadioButton optGram, optOz;
       private JTextField txtWeightEnter, txtResult, txtDateTime;
       private JButton cmdConvert;
       private JComboBox comboSelectLocale;
            //arrays--one for combo box list, and the other for values to use when a particular list item is selected
       private String[] localeList = {"English, USA", "Fran\u00E7ais, France", "Espag\u00F1ol, M\u00E9xico"};
       private Locale[] localeCode = {(new Locale("en", "US")), (new Locale("fr", "FR")), (new Locale("es", "MX"))};
       private JLabel lblChoose, lblWeightEnter;
       protected String titleTxt, enterTxt, btnTxt, gramTxt, ozTxt, resultDisplayTxt, localeTimeZone, dateFormat;
       protected ResourceBundle res;
       protected Locale currentLocale;
       //declare Handler Object
       private CmdConvertWeight convertWeight;
       //**************main method******************
       public static void main(String[] args)
          PrjGUI convertWeight1 = new PrjGUI();
       }//end of main******************************
       //constructor
       public PrjGUI()
          //create panel for components
          Container pane = getContentPane();
          //set the layout
          pane.setLayout(new GridLayout(0, 1, 5, 5));
          //set the color
          pane.setBackground(Color.GREEN);
          //make a font to use in components
          Font font1 = new Font("SansSerif", Font.BOLD, 16);
          /**New calendar object to display the date and time*/
          GregorianCalendar calendar = new GregorianCalendar();
          DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.US);
          /**currentLocale = localeCode[comboSelectLocale.getSelectedIndex()];
          DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, currentLocale); //uses key for ResourceBundle*/
          TimeZone timeZone = TimeZone.getTimeZone("CST");
          //TimeZone timeZone = TimeZone.getTimeZone(localeTimeZone); //uses key for resourceBundle
          formatter.setTimeZone(timeZone);
          //***create UI objects***
          /**NEW OBJECTS FOR prjInternational:
           * a drop-down combobox, a label, and a txt field
          txtDateTime = new JTextField(formatter.format(calendar.getTime()));
          //txtDateTime = formatter.format(calendar.getTime());
          lblChoose = new JLabel("Please choose your language.");
          lblChoose.setFont(font1);
          lblChoose.setBackground(new Color(0, 212, 255)); //aqua blue
          comboSelectLocale = new JComboBox(localeList);
          comboSelectLocale.setFont(font1);
          comboSelectLocale.setBackground(new Color(0, 212, 255)); //aqua blue
          //comboSelectLocale.setSelectedIndex(0);
          //add a listener to the combo box to get the selected item
          /**default values for variables so I can debug--at the moment
           * I can't get the resouceBundle to work--it can't locate the
           * file.  So I will hard code these in for now.
          /*titleTxt="Food Weight Converter";
          enterTxt="Please enter the Weight you wish to convert.";
          btnTxt="Convert this weight!";
          gramTxt="grams";
          ozTxt="oz";
          resultDisplayTxt="Result will display here.";*/
          comboSelectLocale.addItemListener(new ItemListener()
               public void itemStateChanged(ItemEvent e)
                    res = setCurrentLocale(comboSelectLocale.getSelectedIndex());
                    System.out.println(res.getString("enterTxt"));
                    updateItems(res);
                  //set variables from Resource Bundle
                  /* titleTxt = res.getString("titleTxt");
                   System.out.println(res.getString("enterTxt")); //debug
                   enterTxt = res.getString("enterTxt");
                   btnTxt = res.getString("enterTxt");
                   gramTxt = res.getString("gramTxt");
                   ozTxt = res.getString("ozTxt");
                   resultDisplayTxt = res.getString("resultDisplayTxt");*/
          //2 radio buttons
          //optGram = new JRadioButton("grams", true);
          optGram = new JRadioButton(gramTxt, true);
          //optOz = new JRadioButton("oz.");
          optOz = new JRadioButton(ozTxt);
          optGram.setBackground(Color.GREEN);
          optGram.setFont(font1);
          optOz.setBackground(Color.GREEN);
          optOz.setFont(font1);
          //button group so only one can be chosen
          ButtonGroup weightUnit = new ButtonGroup();
          weightUnit.add(optGram);
          weightUnit.add(optOz);
          //label and text field for weight
          //JLabel lblWeightEnter = new JLabel("Please enter the weight you wish to convert:");
          JLabel lblWeightEnter = new JLabel(enterTxt);
          lblWeightEnter.setFont(font1);
          txtWeightEnter = new JTextField("20.05", 6);
          txtWeightEnter.setBackground(new Color(205, 255, 0)); //lime green
          txtWeightEnter.setFont(font1);
          //button to make conversion
          //cmdConvert = new JButton("Convert this weight!");
          cmdConvert = new JButton(btnTxt);
          cmdConvert.setFont(font1);
          //textfield to display result
          //txtResult = new JTextField("Result will display here");
          txtResult = new JTextField(resultDisplayTxt);
          txtResult.setBackground(new Color(205, 255, 0)); //lime green
          txtResult.setFont(font1);
          //register the handler
          convertWeight = new CmdConvertWeight();
          cmdConvert.addActionListener(convertWeight);
          //add content to pane
          pane.add(txtDateTime);
          pane.add(lblChoose);
          pane.add(comboSelectLocale);
          pane.add(lblWeightEnter);
          pane.add(txtWeightEnter);
          pane.add(optGram);
          pane.add(optOz);
          pane.add(cmdConvert);
          pane.add(txtResult);
          //create window for object
          setTitle(titleTxt);
          setSize(400, 300);
          setVisible(true);
          setLocationRelativeTo(null);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
       }//end of constructor
       /**  ACTION LISTENER CLASS TO RESPOND TO USER'S INPUT (EVENTS) **/
       private class CmdConvertWeight implements ActionListener
          public void actionPerformed(ActionEvent e)
             //System.out.println("we made it to the Action Listener"); //debug
             //get info from fields
             double weight = Double.parseDouble(txtWeightEnter.getText());
             double weightConvert = 0;
             String weightConvertString;
             if (optGram.isSelected())//if user's weight is in grams, converting to oz
             weightConvert = weight/28.35;
             weightConvertString = Double.toString(weightConvert);
             txtResult.setText(txtWeightEnter.getText() + " grams is equal to " + weightConvertString + " oz.");
             }//end if gram select
             else if (optOz.isSelected())//if user's weight is in oz, converting to grams
             weightConvert = weight*28.35;
             weightConvertString = Double.toString(weightConvert);
             txtResult.setText(txtWeightEnter.getText() + " oz. is equal to " + weightConvertString + " grams.");
             }//end if oz select
         }//end actionPerformed
      }//end CmdConvertWeight
       /**setCurrentLocale method from combo box listener*/
       public ResourceBundle setCurrentLocale(int index)
            Locale currentLocale = localeCode[index];
            System.out.println(currentLocale); //debug
            System.out.println("MyResource_" + currentLocale); //debug
            ResourceBundle res = ResourceBundle.getBundle("MyResource_" + currentLocale);
            return res;
       }//end setCurrentLocale
       public void updateItems(ResourceBundle res)
            //convertWeight1.setTitle(res.getString(titleTxt));
            System.out.println(res.getString(btnTxt));//debug
            lblWeightEnter.setText(res.getString(enterTxt));
            optGram.setText(res.getString(gramTxt));
            optOz.setText(res.getString(ozTxt));
            cmdConvert.setText(res.getString(btnTxt));
            txtResult.setText(res.getString(resultDisplayTxt));
       }//end updateItems
    }//end of class PrjGUIResourceBundles(each in a different file)
    public class MyResource_fr_FR extends java.util.ListResourceBundle
         static final Object[][] contents =
              {"titleTxt", "Convertisseur de poids de nourriture"},
              {"enterTxt", "Veuillez \u00E9crire le poids que vous souhaitez convertir."},
              {"btnTxt", "Convertissez ce poids!"},
              {"gramTxt", "grammes"},
              {"ozTxt", "onces"},
              {"resultDisplayTxt", "Le r\u00E9sultat montrera ici."},
              {"localeTimeZone", "CET"},
              {"dateFormat", "Locale.FR"}
         public Object[][] getContents()
              return contents;
    public class MyResource_es_MX extends java.util.ListResourceBundle
         static final Object[][] contents =
              {"titleTxt", "Convertidor del peso del alimento"},
              {"enterTxt", "Incorpore por favor el peso que usted desea convertir."},
              {"btnTxt", "\u00F1convierta este peso!"},
              {"gramTxt", "gramos"},
              {"ozTxt", "onzas"},
              {"resultDisplayTxt", "El resultado exhibir\u00E1 aqu\u00ED."},
              {"localeTimeZone", "CST"},
              {"dateFormat", "Locale.MX"}     
         public Object[][] getContents()
              return contents;
    public class MyResource_en_US extends java.util.ListResourceBundle
         static final Object[][] contents =
              {"titleTxt", "Food Weight Converter"},
              {"enterTxt", "Please enter the weight you wish to convert."},
              {"btnTxt", "Convert this weight!"},
              {"gramTxt", "grams"},
              {"ozTxt", "oz"},
              {"resultDisplayTxt", "Result will display here."},
              {"localeTimeZone", "CST"},
              {"dateFormat", "Locale.US"}
         public Object[][] getContents()
              return contents;
    }Edited by: JessePhoenix on Nov 2, 2008 8:30 PM

    catman2u wrote:
    does anyone from Lenovo actually read this forum?
    From the Communiy Rules in the Welcome section....
     Objectives of Lenovo Discussion Forums
    These communities have been created to provide a high quality atmosphere in which users of Lenovo products and services may share experiences and expertise. While members from Lenovo may participate at intervals to engage in the discussions and offer advice and suggestions, this forum is not designed as a dedicated and staffed support channel. This is an informal and public forum, and Lenovo does not guarantee the accuracy of information and advice posted here -- see important Warranty information below.
    No amount of ranting is going to get you anything more than you will achieve with a clear exposition of your issue... so you might want to try doing that instead of ranting and assuming that everyone already knows what you know etc etc.
    Cheers,
    Bill
    I don't work for Lenovo

  • Changing scrollbar color in textarea

    I would like to change the color of the scrollbar that
    appears in a textarea. I have tried various methods and nothing
    seems to work. I would appreciate any help on this.
    Thanks,
    Jothishankar

    textarea has an insert method therefore you may be able to change the text color and insert it at the same position to obtain the different color. i haven't tried it just a suggestion.

  • Combobox rendering color choice

    I would like to display a list of colors in a ComboBox, if possible ordered from brighter to darkest, but I haven't find any working example
    How to render a combobox in order to display a list of color?
    Any help really appreciated
    Thanks

    Should be pretty similar to the tutorial sample for displaying a list of colors in a ListView.

  • IE10 Scrollbar color issue

    I have installed IE10 and I am wondering if there is a way to change the color of the scrollbar.  The light grey is so light it's hard to see.  I have tried a few things and searched around and come up with nothing.  I love the preview otherwise
    and would like to keep it but this one thing might make me use another as I swap back and forth between IE and Comodo Dragon.
    Thanks in advance,
    ~Artt

    Microsoft has degraded our Windows 7 experience
    on purpose by drop-loading this Windows 8-looking IE10 bullshit on our systems via Windows Update.  I've held back for few weeks to give it an honest try, but here I come tonight to complain
    and lo and behold there's already a thread here, right on top.  
    These flat, gray scroll thumbs cause a serious reduction in usability.  When it's difficult to see something it's difficult to see it, no matter how much you practice trying to get used to it. 
    There's no getting used to this.  It causes a long-term, albeit small, reduction in usability.
    It isn't about the color, it's about the style, which of course includes the color.  But those few little extra pixels that define the edge, and the lines within, are
    useful for helping us all spot that control, visually.  That's why they were put there.
    Microsoft, who said it's okay to remove the proper, conformant visual styles from controls in applications you provide for Windows 7 users?  If I'd have wanted Windows 8 I'd have bought it.  You're breaking your own published standards!
    Now we have flat, unrecognizable scrollbar thumbs in IE10 on Windows 7 that depart from standards and are barely visible instead of scrollbars that have the style of all the other applications, as defined by the theme of the
    desktop.  It's clearly a move designed to degrade the user experience for millions of Windows 7 users.
    Do you children on the IE10 team think it's great fun to play "hide the scroll thumb" from all the old Windows 7 users?
    I hope this offends you retards who put extra effort into the coding to specifically avoid adhering to the desktop standards of Windows 7 in order to try to make Windows 7 users like it less, because you sure as hell don't deserve any
    praise for making my computer work day a little more difficult.  If some executive forces you to do stuff like this, you need to tell him or her to kiss your shiny metal...
    You're going to drive your company into the ground trying to manipulate people, instead of just engineering a good and proper product.
    -Noel
    Detailed how-to in my eBooks:  
    Configure The Windows 7 "To Work" Options
    Configure The Windows 8 "To Work" Options
    Yep! IE browser use is on a serious decline. A cool commercial, yet the browser still sucks, unfortunately. Here's hoping IE has the same fate as Netscape. Scrollbars.. uggg!

  • Help with getting button color.

    I'm trying to make a little paint program. i want to be able to click on a color button and then assign the color of that button to a variable Color brushColor.
    funny thing is, when i compile this, it tells me that
    C:\java\javaprograms\TryPainting.java:21: getBackground() in java.awt.Component cannot be applied to (java.awt.Button)
              brushColor = paintTheBrush(getBackground(source));
    strange, getBackground is explicitly listed as a method that Button inherits from Component in the API.
    any suggestions on a way to accomplish this?
    thanks in advance,
    jason
    ------code follows-------
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;
    //colored buttons of "paint"
    class OilPaint extends Button{
    Color brushColor = Color.white;
    OilPaint(String label, Color color) {
         setLabel(label);
         setForeground(color);
         setBackground(color);
         addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
         Button source = (Button)e.getSource();
         brushColor = getBackground(source);
         public Color paintTheBrush(Color color) {
              return color;
    // canvas to paint on - this isn't working yet. can't even get the
    // setSize to work, though it does compile.
    class Canvas extends JPanel{
         Canvas(){
              setBackground(Color.white);
              Dimension canSize = new Dimension(300,300);
              setSize(canSize);
    // displays the lsit of color button choices in a small panel at bottom
    // of window
    class ColorChoices extends JPanel{
         ColorChoices() {
              setBackground(new Color(220,255,255));
              add(new OilPaint("paint",Color.blue));
              add(new OilPaint("paint",Color.red));
              add(new OilPaint("paint",Color.green));
              add(new OilPaint("paint",Color.white));
              add(new OilPaint("paint",Color.black));
    //this is the main class of the program TryPainting.java
    class TryPainting {
         public static void main(String[] args) {
              JFrame window = new JFrame();
              Toolkit toolkit = window.getToolkit();
              Dimension winSize=toolkit.getScreenSize();
              window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              window.setBounds(5,5,winSize.width/2,winSize.height/2);
              Container content = window.getContentPane();
              content.setLayout(new BorderLayout());
              content.add("North",new Canvas());
              content.add("South",new ColorChoices());
              window.setVisible(true);

    duh.. thanks man, that did the trick. i'm pretty new at this. i really appreciate the help. i got stuck thinking of the getBackground() as a function, rather than a method. this oop stuff is wacky weird fun!
    jason

  • Help Needed With Scrollbar and Content

    I'm having a difficult time with the Scrollbar component. I'm trying to have a scrollbar set up to navigate a text field or a MC of a text field. I managed to get it functioning within the desired frame, however when I jump to another frame, that very same content appears on the other frame, despite the fact that said frame did not have the scrollbar nor the content pasted within.
    The bar seems to do what I want it to do save for the unwelcomed presence outside of the frame of choice. Here's the code I'm using. This is the keyframe code:
    import boppreh.ui.Scrollbar
    var scrollbar1:Scrollbar = new Scrollbar(boomboom, 500, true, false, 293, bar, slider, arrowUp, arrowDown)
    addChild(scrollbar1)
    scrollbar1.x = 50
    scrollbar1.y = 50
    And this is the code found in the AS file:
    package boppreh.ui
        import flash.display.*
        import flash.events.*
        import flash.geom.Rectangle;
        import flash.utils.Timer
        import flash.ui.Keyboard
         * Scrollbar to handle single display objects.
         * Author: Lucas Boppre Niehues ([email protected])
         * Date: 09/02/2010
        public class Scrollbar extends Sprite {
            /// The default width for the default slider, bar and arrows, as well as the default arrows' height
            public static const DEFAULT_SIDE:Number = 20
            /// The delay (in milliseconds) between clicking and holding an arrow and the slider moving continously
            public static var SCROLL_DELAY:Number = 300
            /// The number of lines to be scrolled every second during continous scrolling
            public static var LINES_PER_SECOND:Number = 1.5
            /// Number of pixels to be scrolled for each mouse wheel line (default lines per wheel tick is 3)
            public static var PIXELS_PER_LINE:Number = 16
            protected var windowSize:Number
            protected var contentPadding:Number
            protected var isVertical:Boolean
            /// Stored movement to be applied on the next "scroll()" call
            protected var movement:Number
            /// Timer used to control the delay before continous scrolling
            protected var timer:Timer
            protected var content:DisplayObject
            protected var contentBounds:Rectangle
            protected var bar:InteractiveObject
            protected var arrowUp:InteractiveObject
            protected var arrowDown:InteractiveObject
            protected var slider:InteractiveObject
            protected var partHold:InteractiveObject
            protected function get eventOrigin():String {
                if (partHold == arrowUp)
                    return ScrollEvent.ARROW_UP
                else if (partHold == arrowDown)
                    return ScrollEvent.ARROW_DOWN
                else if (partHold == bar)
                    return ScrollEvent.BAR
                throw new Error("Unkown event origin.")
            private var mouseOffset:Number
            protected function get maxContentPos():Number {
                if (isVertical)
                    return -(contentBounds.height - windowSize) - 1
                else
                    return -(contentBounds.width - windowSize) - 1
            /// The content's current position, in a scale from 0 to 1
            public function get position():Number {
                if (isVertical)
                    return contentBounds.y / maxContentPos
                else
                    return contentBounds.x / maxContentPos
            public function set position(value:Number) {
                value = Math.min(1, Math.max(value, 0))
                var newContentPos:Number = value * maxContentPos
                setPosition(content, isVertical ? null : newContentPos, isVertical ? newContentPos : null, false, false)
                contentBounds = content.getBounds(this)
                if (isVertical) {
                    bar.height = windowSize - (arrowUp.height + arrowDown.height)
                    slider.height = (windowSize / Math.max(contentBounds.height, windowSize)) * bar.height
                    var newSliderY:Number = arrowUp.height + (-newContentPos / contentBounds.height) * bar.height
                    setPosition(slider, null, newSliderY, false, false)
                } else {
                    bar.width = windowSize - (arrowUp.width + arrowDown.width)
                    slider.width = (windowSize / Math.max(contentBounds.width, windowSize)) * bar.width
                    var newSliderX:Number = arrowUp.width + (-newContentPos / contentBounds.width) * bar.width
                    setPosition(slider, newSliderX, null, false, false)
                updatePartsPositions()
             * Creates a new Scrollbar object to scroll a single Display Object.
             * @param    content    the object to be scrolled
             * @param    windowSize    the height or width of the scrollbar, depending if it's vertical or not; i.e.: the dimension of the content's visible part
             * @param    isVertical    defines if the scrollbar's parts should be placed on the right or bottom of the content, and if the content should be scrolled upways or to the right
             * @param    autoUpdate    automatically checks for dimensions changes in any part and updates accordingly. Use only if the content will be resized
             * @param    contentPadding    the distance between the content and all the other parts
             * @param    bar    the bar object to be used; if null, a default one will be used
             * @param    slider    the slider object to be used; if null, a default one will be used
             * @param    arrowUp    the arrow up/left object to be used; if null, a default one will be used
             * @param    arrowDown    the arrow down/right object to be used; if null, a default one will be used
            public function Scrollbar(content:DisplayObject, windowSize:Number, isVertical:Boolean=true, autoUpdate:Boolean=false, contentPadding:Number=5, bar:InteractiveObject=null, slider:InteractiveObject=null, arrowUp:InteractiveObject=null, arrowDown:InteractiveObject=null) {
                this.content = content
                this.windowSize = windowSize
                this.contentPadding = contentPadding
                this.isVertical = isVertical
                this.bar = bar || createDefaultBar()
                this.arrowUp = arrowUp || createDefaultArrow(false)
                this.arrowDown = arrowDown || createDefaultArrow(true)
                this.slider = slider || createDefaultSlider()
                timer = new Timer(SCROLL_DELAY)
                timer.addEventListener(TimerEvent.TIMER, startScrolling)
                addParts()
                if (autoUpdate)
                    this.addEventListener(Event.ENTER_FRAME, update)
                configureListeners()
                update()
                position = 0
            protected function scroll(e:*= null):void {
                // This nested if forbids the slider to continue moving if the user is
                // "holding" the bar and the slider already reached the mouse position
                if (e && (e is Event) && (Event(e).type == Event.ENTER_FRAME)) {
                    if (partHold == bar) {
                        var sliderBounds:Rectangle = slider.getBounds(this)
                        if (isVertical) {
                            if (mouseY > sliderBounds.top && mouseY < sliderBounds.bottom) {
                                stopScrolling()
                                return
                        } else {
                            if (mouseX > sliderBounds.left && mouseX < sliderBounds.right) {
                                stopScrolling()
                                return
                scrollPixels(movement)
             * Scrolls the content by the specified ammount.
             * @param    number    number of pixels to be scrolled
            protected function scrollPixels(number:Number):void {
                position += number / -maxContentPos
            protected function configureListeners():void {
                slider.addEventListener(MouseEvent.MOUSE_DOWN, startSliderDrag)
                for each (var part:InteractiveObject in [arrowUp, arrowDown, bar]) {
                    part.addEventListener(MouseEvent.MOUSE_DOWN, fixedPart_onMouseDownHandler)
                addEventListener(MouseEvent.MOUSE_WHEEL, mouse_onWheelScrollHandler)
                addEventListener(KeyboardEvent.KEY_DOWN, keyboard_onKeyDownHandler)
            protected function fixedPart_onMouseDownHandler(event:MouseEvent):void
                partHold = InteractiveObject(event.currentTarget)
                if (partHold == arrowUp) {
                    movement = -PIXELS_PER_LINE
                } else if (partHold == arrowDown) {
                    movement = PIXELS_PER_LINE
                } else if (partHold == bar) {
                    var sliderBounds:Rectangle = slider.getBounds(this)
                    if (isVertical) {
                        if (mouseY > (sliderBounds.top + sliderBounds.height / 2))
                            movement = windowSize
                        else
                            movement = -windowSize
                    } else {
                        if (mouseX > (sliderBounds.left + sliderBounds.width / 2))
                            movement = windowSize
                        else
                            movement = -windowSize
                scroll()
                dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, eventOrigin))
                stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling)
                partHold.addEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
                timer.start()
            protected function keyboard_onKeyDownHandler(event:KeyboardEvent):void {
                switch (event.keyCode) {
                    case Keyboard.UP:
                    case Keyboard.LEFT:
                        movement = -PIXELS_PER_LINE
                        break
                    case Keyboard.DOWN:
                    case Keyboard.RIGHT:
                        movement = PIXELS_PER_LINE
                        break
                    case Keyboard.SPACE:
                    case Keyboard.PAGE_DOWN:
                        movement = windowSize
                        break
                    case Keyboard.PAGE_UP:
                        movement = -windowSize
                        break
                    case Keyboard.HOME:
                        movement = 0
                        position = 0
                        break
                    case Keyboard.END:
                        movement = 0
                        position = 100
                        break
                    default:
                        return
                scroll()
                dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.KEYBOARD))
            protected function startScrolling(e:*=null):void {
                timer.reset()
                this.addEventListener(Event.ENTER_FRAME, scroll)
                movement = (movement * (LINES_PER_SECOND * PIXELS_PER_LINE)) / stage.frameRate
                dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_START, eventOrigin))
            protected function stopScrolling(e:*=null) {
                timer.stop()
                this.removeEventListener(Event.ENTER_FRAME, scroll)
                stage.removeEventListener(KeyboardEvent.KEY_UP, stopScrolling)
                stage.removeEventListener(MouseEvent.MOUSE_UP, stopScrolling)
                dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_STOP, eventOrigin))
                if (partHold) {
                    partHold.removeEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
                    partHold = null
            protected function mouse_onWheelScrollHandler(event:MouseEvent) {
                // The mouse wheel delta arrives inverted
                var delta:int = -event.delta
                movement = delta * PIXELS_PER_LINE
                scroll()
                dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.MOUSE_WHEEL))
            //{ region Slider Drag functions
            protected function startSliderDrag(event:MouseEvent) {
                if (isVertical)
                    mouseOffset = slider.getBounds(this).y - this.mouseY
                else
                    mouseOffset = slider.getBounds(this).x - this.mouseX
                stage.addEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
                stage.addEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
                dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_START, ScrollEvent.SLIDER))
            protected function stopSliderDrag(event:MouseEvent) {
                stage.removeEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
                stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
                dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_STOP, ScrollEvent.SLIDER))
            protected function onSliderDrag(event:MouseEvent) {
                if (isVertical) {
                    if (bar.height == slider.height)
                        return
                } else {
                    if (bar.width == slider.width)
                        return
                if (isVertical)
                    position = (this.mouseY + mouseOffset - arrowUp.height) / (bar.height - slider.height)
                else
                    position = (this.mouseX + mouseOffset - arrowUp.width) / (bar.width - slider.width)
            //} endregion
            //{ region Visual functions
            /// Adds all required parts to the scrollbar's display list
            protected function addParts():void {
                setPosition(content, 0, 0, false, false)
                addChild(this.bar)
                addChild(this.arrowUp)
                addChild(this.arrowDown)
                addChild(this.slider)
                addChild(this.content)
             * Updates all parts to fit the new dimensions and positions.
            public function update(e:*= null):void {
                contentBounds = content.getBounds(this)
                updatePartsPositions()
                // Ugly, but updates everything that was not update in the above call based on the content's position and size
                position = position
            protected function updatePartsPositions(event:Event = null):void {
                if (isVertical) {
                    // The parts width is divided by 2 because they will be center aligned
                    var newX:Number = contentBounds.width +
                                contentPadding +
                                Math.max(slider.width, arrowUp.width, arrowDown.width, bar.width) / 2
                    setPosition(arrowUp, newX, 0, true, false)
                    setPosition(bar, newX, arrowUp.height, true, false)
                    setPosition(arrowDown, newX, arrowUp.height + bar.height, true, false)
                    setPosition(slider, newX, null, true, false)
                } else {
                    var newY:Number = contentBounds.height +
                                contentPadding +
                                Math.max(slider.height, arrowUp.height, arrowDown.height, bar.height) / 2
                    setPosition(arrowUp, 0, newY, false, true)
                    setPosition(bar, arrowUp.width, newY, false, true)
                    setPosition(arrowDown, arrowUp.width + bar.width, newY, false, true)
                    setPosition(slider, null, newY, false, true)
                updateMask()
            private function updateMask():void {
                if (content.mask && this.contains(content.mask))
                    removeChild(content.mask)
                var contentMask:Sprite = createWindowMask()
                addChild(contentMask)
                content.mask = contentMask
            protected function setPosition(part:DisplayObject, newX:Object=null, newY:Object=null, alignHorizontal:Boolean=false, alignVertical:Boolean=false):void {
                var bounds:Rectangle = part.getBounds(this)
                if (newX is Number)
                    part.x = int(newX) + (part.x - bounds.x) - ((alignHorizontal) ? bounds.width / 2 : 0)
                if (newY is Number)
                    part.y = int(newY) + (part.y - bounds.y) - ((alignVertical) ? bounds.height / 2 : 0)
            //} endregion
            //{ region Functions to draw parts
            private function createDefaultBar():Sprite {
                var image:Sprite = new Sprite()
                image.graphics.lineStyle(1)
                image.graphics.beginFill(0xFFFFFF)
                if (isVertical)
                    image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
                else
                    image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
                image.graphics.endFill()
                //image.buttonMode = true
                return image
            private function createDefaultArrow(inverted:Boolean):Sprite {
                var image:Sprite = new Sprite()
                image.graphics.lineStyle(1)
                image.graphics.beginFill(0xBFBFBF)
                image.graphics.drawRect(0, 0, DEFAULT_SIDE, DEFAULT_SIDE)
                image.graphics.endFill()
                image.graphics.lineStyle(3)
                if (isVertical) {
                    if (inverted) {
                        image.graphics.moveTo(4, 4)
                        image.graphics.lineTo(10, 16)
                        image.graphics.lineTo(16, 4)
                    } else {
                        image.graphics.moveTo(4, 16)
                        image.graphics.lineTo(10, 4)
                        image.graphics.lineTo(16, 16)
                } else {
                    if (inverted) {
                        image.graphics.moveTo(4, 4)
                        image.graphics.lineTo(16, 10)
                        image.graphics.lineTo(4, 16)
                    } else {
                        image.graphics.moveTo(16, 4)
                        image.graphics.lineTo(4, 10)
                        image.graphics.lineTo(16, 16)
                image.buttonMode = true
                return image
            private function createDefaultSlider():Sprite {
                var image:Sprite = new Sprite()
                image.graphics.lineStyle(1)
                image.graphics.beginFill(0xBFBFBF)
                if (isVertical)
                    image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
                else
                    image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
                image.graphics.endFill()
                image.buttonMode = true
                return image
            private function createWindowMask():Sprite {
                var image:Sprite = new Sprite()
                image.graphics.lineStyle(0)
                image.graphics.beginFill(0x000000, 1)
                if (isVertical)
                    image.graphics.drawRect(0, 0, content.width + 1, windowSize)
                else
                    image.graphics.drawRect(0, 0, windowSize, content.width + 1)
                image.graphics.endFill()
                image.alpha = 0
                return image
            //} endregion
    And this is the ScrollEvent AS file:
    package boppreh.ui
        import flash.events.Event;
         * Events related to the Scrollbar class.
         * Author: Lucas Boppre Niehues ([email protected])
         * Date: 09/02/2010
        public class ScrollEvent extends Event
            /// Dispatched when a scroll movement occurs
            public static const SCROLL:String = "scroll"
            /// Dispatched when the user has clicked and is holding an arrow or the bar
            public static const CONTINOUS_SCROLL_START:String = "continous scroll start"
            /// Dispatched when the user has clicked and dropped an arrow or the bar
            public static const CONTINOUS_SCROLL_STOP:String = "continous scroll stop"
            /// Dispatched when the user starts dragging the slider part
            public static const SLIDER_DRAG_START:String = "slider drag start"
            /// Dispatched when the user stops dragging the slider part
            public static const SLIDER_DRAG_STOP:String = "slider drag stop"
            /// Origin type representing the arrow up part
            public static const ARROW_UP:String = "arrow up"
            /// Origin type representing the arrow down part
            public static const ARROW_DOWN:String = "arrow down"
            /// Origin type representing the bar part
            public static const BAR:String = "part"
            /// Origin type representing the slider part
            public static const SLIDER:String = "slider"
            /// Origin type representing the keyboard
            public static const KEYBOARD:String = "keyboard"
            /// Origin type representing the mouse wheel
            public static const MOUSE_WHEEL:String = "mouse wheel"
            public var origin:String
             * Creates a new ScrollEvent object.
             * @param    type    the object type (first group of declared constants)
             * @param    origin    the object that originated the event (second group of declared constants)
            public function ScrollEvent (type:String, origin:String, bubbles:Boolean = false, cancelable:Boolean = false) {
                this.origin = origin
                super(type, bubbles, cancelable)
    Any help would be appreciated. I've been stuck here all day.

    I'm having a difficult time with the Scrollbar component. I'm trying to have a scrollbar set up to navigate a text field or a MC of a text field. I managed to get it functioning within the desired frame, however when I jump to another frame, that very same content appears on the other frame, despite the fact that said frame did not have the scrollbar nor the content pasted within.
    The bar seems to do what I want it to do save for the unwelcomed presence outside of the frame of choice. Here's the code I'm using. This is the keyframe code:
    import boppreh.ui.Scrollbar
    var scrollbar1:Scrollbar = new Scrollbar(boomboom, 500, true, false, 293, bar, slider, arrowUp, arrowDown)
    addChild(scrollbar1)
    scrollbar1.x = 50
    scrollbar1.y = 50
    And this is the code found in the AS file:
    package boppreh.ui
        import flash.display.*
        import flash.events.*
        import flash.geom.Rectangle;
        import flash.utils.Timer
        import flash.ui.Keyboard
         * Scrollbar to handle single display objects.
         * Author: Lucas Boppre Niehues ([email protected])
         * Date: 09/02/2010
        public class Scrollbar extends Sprite {
            /// The default width for the default slider, bar and arrows, as well as the default arrows' height
            public static const DEFAULT_SIDE:Number = 20
            /// The delay (in milliseconds) between clicking and holding an arrow and the slider moving continously
            public static var SCROLL_DELAY:Number = 300
            /// The number of lines to be scrolled every second during continous scrolling
            public static var LINES_PER_SECOND:Number = 1.5
            /// Number of pixels to be scrolled for each mouse wheel line (default lines per wheel tick is 3)
            public static var PIXELS_PER_LINE:Number = 16
            protected var windowSize:Number
            protected var contentPadding:Number
            protected var isVertical:Boolean
            /// Stored movement to be applied on the next "scroll()" call
            protected var movement:Number
            /// Timer used to control the delay before continous scrolling
            protected var timer:Timer
            protected var content:DisplayObject
            protected var contentBounds:Rectangle
            protected var bar:InteractiveObject
            protected var arrowUp:InteractiveObject
            protected var arrowDown:InteractiveObject
            protected var slider:InteractiveObject
            protected var partHold:InteractiveObject
            protected function get eventOrigin():String {
                if (partHold == arrowUp)
                    return ScrollEvent.ARROW_UP
                else if (partHold == arrowDown)
                    return ScrollEvent.ARROW_DOWN
                else if (partHold == bar)
                    return ScrollEvent.BAR
                throw new Error("Unkown event origin.")
            private var mouseOffset:Number
            protected function get maxContentPos():Number {
                if (isVertical)
                    return -(contentBounds.height - windowSize) - 1
                else
                    return -(contentBounds.width - windowSize) - 1
            /// The content's current position, in a scale from 0 to 1
            public function get position():Number {
                if (isVertical)
                    return contentBounds.y / maxContentPos
                else
                    return contentBounds.x / maxContentPos
            public function set position(value:Number) {
                value = Math.min(1, Math.max(value, 0))
                var newContentPos:Number = value * maxContentPos
                setPosition(content, isVertical ? null : newContentPos, isVertical ? newContentPos : null, false, false)
                contentBounds = content.getBounds(this)
                if (isVertical) {
                    bar.height = windowSize - (arrowUp.height + arrowDown.height)
                    slider.height = (windowSize / Math.max(contentBounds.height, windowSize)) * bar.height
                    var newSliderY:Number = arrowUp.height + (-newContentPos / contentBounds.height) * bar.height
                    setPosition(slider, null, newSliderY, false, false)
                } else {
                    bar.width = windowSize - (arrowUp.width + arrowDown.width)
                    slider.width = (windowSize / Math.max(contentBounds.width, windowSize)) * bar.width
                    var newSliderX:Number = arrowUp.width + (-newContentPos / contentBounds.width) * bar.width
                    setPosition(slider, newSliderX, null, false, false)
                updatePartsPositions()
             * Creates a new Scrollbar object to scroll a single Display Object.
             * @param    content    the object to be scrolled
             * @param    windowSize    the height or width of the scrollbar, depending if it's vertical or not; i.e.: the dimension of the content's visible part
             * @param    isVertical    defines if the scrollbar's parts should be placed on the right or bottom of the content, and if the content should be scrolled upways or to the right
             * @param    autoUpdate    automatically checks for dimensions changes in any part and updates accordingly. Use only if the content will be resized
             * @param    contentPadding    the distance between the content and all the other parts
             * @param    bar    the bar object to be used; if null, a default one will be used
             * @param    slider    the slider object to be used; if null, a default one will be used
             * @param    arrowUp    the arrow up/left object to be used; if null, a default one will be used
             * @param    arrowDown    the arrow down/right object to be used; if null, a default one will be used
            public function Scrollbar(content:DisplayObject, windowSize:Number, isVertical:Boolean=true, autoUpdate:Boolean=false, contentPadding:Number=5, bar:InteractiveObject=null, slider:InteractiveObject=null, arrowUp:InteractiveObject=null, arrowDown:InteractiveObject=null) {
                this.content = content
                this.windowSize = windowSize
                this.contentPadding = contentPadding
                this.isVertical = isVertical
                this.bar = bar || createDefaultBar()
                this.arrowUp = arrowUp || createDefaultArrow(false)
                this.arrowDown = arrowDown || createDefaultArrow(true)
                this.slider = slider || createDefaultSlider()
                timer = new Timer(SCROLL_DELAY)
                timer.addEventListener(TimerEvent.TIMER, startScrolling)
                addParts()
                if (autoUpdate)
                    this.addEventListener(Event.ENTER_FRAME, update)
                configureListeners()
                update()
                position = 0
            protected function scroll(e:*= null):void {
                // This nested if forbids the slider to continue moving if the user is
                // "holding" the bar and the slider already reached the mouse position
                if (e && (e is Event) && (Event(e).type == Event.ENTER_FRAME)) {
                    if (partHold == bar) {
                        var sliderBounds:Rectangle = slider.getBounds(this)
                        if (isVertical) {
                            if (mouseY > sliderBounds.top && mouseY < sliderBounds.bottom) {
                                stopScrolling()
                                return
                        } else {
                            if (mouseX > sliderBounds.left && mouseX < sliderBounds.right) {
                                stopScrolling()
                                return
                scrollPixels(movement)
             * Scrolls the content by the specified ammount.
             * @param    number    number of pixels to be scrolled
            protected function scrollPixels(number:Number):void {
                position += number / -maxContentPos
            protected function configureListeners():void {
                slider.addEventListener(MouseEvent.MOUSE_DOWN, startSliderDrag)
                for each (var part:InteractiveObject in [arrowUp, arrowDown, bar]) {
                    part.addEventListener(MouseEvent.MOUSE_DOWN, fixedPart_onMouseDownHandler)
                addEventListener(MouseEvent.MOUSE_WHEEL, mouse_onWheelScrollHandler)
                addEventListener(KeyboardEvent.KEY_DOWN, keyboard_onKeyDownHandler)
            protected function fixedPart_onMouseDownHandler(event:MouseEvent):void
                partHold = InteractiveObject(event.currentTarget)
                if (partHold == arrowUp) {
                    movement = -PIXELS_PER_LINE
                } else if (partHold == arrowDown) {
                    movement = PIXELS_PER_LINE
                } else if (partHold == bar) {
                    var sliderBounds:Rectangle = slider.getBounds(this)
                    if (isVertical) {
                        if (mouseY > (sliderBounds.top + sliderBounds.height / 2))
                            movement = windowSize
                        else
                            movement = -windowSize
                    } else {
                        if (mouseX > (sliderBounds.left + sliderBounds.width / 2))
                            movement = windowSize
                        else
                            movement = -windowSize
                scroll()
                dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, eventOrigin))
                stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling)
                partHold.addEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
                timer.start()
            protected function keyboard_onKeyDownHandler(event:KeyboardEvent):void {
                switch (event.keyCode) {
                    case Keyboard.UP:
                    case Keyboard.LEFT:
                        movement = -PIXELS_PER_LINE
                        break
                    case Keyboard.DOWN:
                    case Keyboard.RIGHT:
                        movement = PIXELS_PER_LINE
                        break
                    case Keyboard.SPACE:
                    case Keyboard.PAGE_DOWN:
                        movement = windowSize
                        break
                    case Keyboard.PAGE_UP:
                        movement = -windowSize
                        break
                    case Keyboard.HOME:
                        movement = 0
                        position = 0
                        break
                    case Keyboard.END:
                        movement = 0
                        position = 100
                        break
                    default:
                        return
                scroll()
                dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.KEYBOARD))
            protected function startScrolling(e:*=null):void {
                timer.reset()
                this.addEventListener(Event.ENTER_FRAME, scroll)
                movement = (movement * (LINES_PER_SECOND * PIXELS_PER_LINE)) / stage.frameRate
                dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_START, eventOrigin))
            protected function stopScrolling(e:*=null) {
                timer.stop()
                this.removeEventListener(Event.ENTER_FRAME, scroll)
                stage.removeEventListener(KeyboardEvent.KEY_UP, stopScrolling)
                stage.removeEventListener(MouseEvent.MOUSE_UP, stopScrolling)
                dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_STOP, eventOrigin))
                if (partHold) {
                    partHold.removeEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
                    partHold = null
            protected function mouse_onWheelScrollHandler(event:MouseEvent) {
                // The mouse wheel delta arrives inverted
                var delta:int = -event.delta
                movement = delta * PIXELS_PER_LINE
                scroll()
                dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.MOUSE_WHEEL))
            //{ region Slider Drag functions
            protected function startSliderDrag(event:MouseEvent) {
                if (isVertical)
                    mouseOffset = slider.getBounds(this).y - this.mouseY
                else
                    mouseOffset = slider.getBounds(this).x - this.mouseX
                stage.addEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
                stage.addEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
                dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_START, ScrollEvent.SLIDER))
            protected function stopSliderDrag(event:MouseEvent) {
                stage.removeEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
                stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
                dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_STOP, ScrollEvent.SLIDER))
            protected function onSliderDrag(event:MouseEvent) {
                if (isVertical) {
                    if (bar.height == slider.height)
                        return
                } else {
                    if (bar.width == slider.width)
                        return
                if (isVertical)
                    position = (this.mouseY + mouseOffset - arrowUp.height) / (bar.height - slider.height)
                else
                    position = (this.mouseX + mouseOffset - arrowUp.width) / (bar.width - slider.width)
            //} endregion
            //{ region Visual functions
            /// Adds all required parts to the scrollbar's display list
            protected function addParts():void {
                setPosition(content, 0, 0, false, false)
                addChild(this.bar)
                addChild(this.arrowUp)
                addChild(this.arrowDown)
                addChild(this.slider)
                addChild(this.content)
             * Updates all parts to fit the new dimensions and positions.
            public function update(e:*= null):void {
                contentBounds = content.getBounds(this)
                updatePartsPositions()
                // Ugly, but updates everything that was not update in the above call based on the content's position and size
                position = position
            protected function updatePartsPositions(event:Event = null):void {
                if (isVertical) {
                    // The parts width is divided by 2 because they will be center aligned
                    var newX:Number = contentBounds.width +
                                contentPadding +
                                Math.max(slider.width, arrowUp.width, arrowDown.width, bar.width) / 2
                    setPosition(arrowUp, newX, 0, true, false)
                    setPosition(bar, newX, arrowUp.height, true, false)
                    setPosition(arrowDown, newX, arrowUp.height + bar.height, true, false)
                    setPosition(slider, newX, null, true, false)
                } else {
                    var newY:Number = contentBounds.height +
                                contentPadding +
                                Math.max(slider.height, arrowUp.height, arrowDown.height, bar.height) / 2
                    setPosition(arrowUp, 0, newY, false, true)
                    setPosition(bar, arrowUp.width, newY, false, true)
                    setPosition(arrowDown, arrowUp.width + bar.width, newY, false, true)
                    setPosition(slider, null, newY, false, true)
                updateMask()
            private function updateMask():void {
                if (content.mask && this.contains(content.mask))
                    removeChild(content.mask)
                var contentMask:Sprite = createWindowMask()
                addChild(contentMask)
                content.mask = contentMask
            protected function setPosition(part:DisplayObject, newX:Object=null, newY:Object=null, alignHorizontal:Boolean=false, alignVertical:Boolean=false):void {
                var bounds:Rectangle = part.getBounds(this)
                if (newX is Number)
                    part.x = int(newX) + (part.x - bounds.x) - ((alignHorizontal) ? bounds.width / 2 : 0)
                if (newY is Number)
                    part.y = int(newY) + (part.y - bounds.y) - ((alignVertical) ? bounds.height / 2 : 0)
            //} endregion
            //{ region Functions to draw parts
            private function createDefaultBar():Sprite {
                var image:Sprite = new Sprite()
                image.graphics.lineStyle(1)
                image.graphics.beginFill(0xFFFFFF)
                if (isVertical)
                    image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
                else
                    image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
                image.graphics.endFill()
                //image.buttonMode = true
                return image
            private function createDefaultArrow(inverted:Boolean):Sprite {
                var image:Sprite = new Sprite()
                image.graphics.lineStyle(1)
                image.graphics.beginFill(0xBFBFBF)
                image.graphics.drawRect(0, 0, DEFAULT_SIDE, DEFAULT_SIDE)
                image.graphics.endFill()
                image.graphics.lineStyle(3)
                if (isVertical) {
                    if (inverted) {
                        image.graphics.moveTo(4, 4)
                        image.graphics.lineTo(10, 16)
                        image.graphics.lineTo(16, 4)
                    } else {
                        image.graphics.moveTo(4, 16)
                        image.graphics.lineTo(10, 4)
                        image.graphics.lineTo(16, 16)
                } else {
                    if (inverted) {
                        image.graphics.moveTo(4, 4)
                        image.graphics.lineTo(16, 10)
                        image.graphics.lineTo(4, 16)
                    } else {
                        image.graphics.moveTo(16, 4)
                        image.graphics.lineTo(4, 10)
                        image.graphics.lineTo(16, 16)
                image.buttonMode = true
                return image
            private function createDefaultSlider():Sprite {
                var image:Sprite = new Sprite()
                image.graphics.lineStyle(1)
                image.graphics.beginFill(0xBFBFBF)
                if (isVertical)
                    image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
                else
                    image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
                image.graphics.endFill()
                image.buttonMode = true
                return image
            private function createWindowMask():Sprite {
                var image:Sprite = new Sprite()
                image.graphics.lineStyle(0)
                image.graphics.beginFill(0x000000, 1)
                if (isVertical)
                    image.graphics.drawRect(0, 0, content.width + 1, windowSize)
                else
                    image.graphics.drawRect(0, 0, windowSize, content.width + 1)
                image.graphics.endFill()
                image.alpha = 0
                return image
            //} endregion
    And this is the ScrollEvent AS file:
    package boppreh.ui
        import flash.events.Event;
         * Events related to the Scrollbar class.
         * Author: Lucas Boppre Niehues ([email protected])
         * Date: 09/02/2010
        public class ScrollEvent extends Event
            /// Dispatched when a scroll movement occurs
            public static const SCROLL:String = "scroll"
            /// Dispatched when the user has clicked and is holding an arrow or the bar
            public static const CONTINOUS_SCROLL_START:String = "continous scroll start"
            /// Dispatched when the user has clicked and dropped an arrow or the bar
            public static const CONTINOUS_SCROLL_STOP:String = "continous scroll stop"
            /// Dispatched when the user starts dragging the slider part
            public static const SLIDER_DRAG_START:String = "slider drag start"
            /// Dispatched when the user stops dragging the slider part
            public static const SLIDER_DRAG_STOP:String = "slider drag stop"
            /// Origin type representing the arrow up part
            public static const ARROW_UP:String = "arrow up"
            /// Origin type representing the arrow down part
            public static const ARROW_DOWN:String = "arrow down"
            /// Origin type representing the bar part
            public static const BAR:String = "part"
            /// Origin type representing the slider part
            public static const SLIDER:String = "slider"
            /// Origin type representing the keyboard
            public static const KEYBOARD:String = "keyboard"
            /// Origin type representing the mouse wheel
            public static const MOUSE_WHEEL:String = "mouse wheel"
            public var origin:String
             * Creates a new ScrollEvent object.
             * @param    type    the object type (first group of declared constants)
             * @param    origin    the object that originated the event (second group of declared constants)
            public function ScrollEvent (type:String, origin:String, bubbles:Boolean = false, cancelable:Boolean = false) {
                this.origin = origin
                super(type, bubbles, cancelable)
    Any help would be appreciated. I've been stuck here all day.

  • Help with working with color and profiles

    Like many others, I suspect, I am having trouble managing the colors on my iMac to match the prints I get. I have a few questions, but first, some background:
    1. Screen calibrated with Huey Pantone. Calibration was done with monitor brightness all the way to lowest. I don't use Shades or anything else. I have my Display Profile set to this profile. I'd be happy to post my .icc profile if I knew how. I can email it to anyone who can help here.
    2. I have been sending my prints to Costco with the option of turning OFF their Auto Correct. To try to get things to match, I downloaded Costco's printer profiles from http://www.drycreekphoto.com/icc/Profiles/Minnesota_profiles.htm#MN (Eden Prairie, Glossy and Lustre paper profiles).
    3. I shoot photos with a Canon XTi with color space set to sRGB. I am using iPhoto 08.
    So here are my questions:
    1. I loaded the Costco printer profile icc files into /Library/ColorSync/Profiles/Displays. When I open ColorSync, I see them under Profiles/Displays. However, in ColorSync/Devices/Displays/iMac, when I go to change the profile, I navigate to these files but the computer just beeps and won't take them. I thought all icc files could be used by monitors and printers - can these Costco iccs only be used for printers (I noticed the Costco files are 4MB, the other display iccs are 4KB)?
    2. How does iPhoto handle color spaces? I import my photos off my CF card. Under iPhoto / Prefs / Advanced, I have both Copy Items and Embed ColorSync Profiles checked. Which color profile is it embedding? The one from the camera (some generic sRGB) or the one my display is using (the Huey)?
    3. As a test, I exported my photo as a full size TIFF (a 3.3MB jpeg became a 28MB tiff). I opened the TIFF in Preview. Preview / Tools / Assign Profile came up as "Camera RGB Profile" (so I think this answers question 2 but I'm not sure). While in Preview, if I now change the Display Profile (from Huey to Adobe RGB), the whole screen changes, including the photo I'm looking at in Preview - shouldn't Preview hold the photo the same since it's using a different color profile?
    4. I set the Display Profile back to Huey. In Preview, I go back to my photo and under Tools / Assign Profile I assign the profile my Huey profile (instead of Camera RGB). I save this as a jpeg and reimport into iPhoto. When I compare these two photos side by side in iPhoto, they look indistinguishable. Why, if on the original import iPhoto embedded the Camera RGB profile into the photo and I make a copy assigning the Huey profile do they look identical? There's no reason to assume that the Camera RGB and Huey profiles are the same! Or is it some trick where the Display Profile is overriding everything?
    5. Lastly, I reopened the original TIFF export in Preview and assigned it the Costco profile (happened to use the glossy one). Lo and behold, what appears on the screen is a much closer version to what I got back as a print. Finally, as one last tweak, I changed my Display Profile from Huey to Adobe RGB and the picture I saw in Preview was closer still to what I got back from Costco. I changed the Display back to Huey, kept the Costco profile assigned and saved my TIFF back to a JPEG. I imported into iPhoto and compared - it looks much closer to my Costco print.
    So I'm utterly confused. How do professionals manage their color workflow? Is my Huey calibration whacky? Why, if I assign a color profile to something in Preview, does it really depend on what Display Profile I have set (I thought profiles managed color, but it looks like it's relative).
    I apologize for the rather long post, and very much appreciate any help and suggestions here!
    Thanks!

    The contractual requirements between the vendor and your company may be the key. The contract may or may not discuss whether the vendor's permission to modify the material includes an obligation to make the documents usable. "Usable" may be construed to mean providing original files. If the vendor is required to provide originals, they may or may not be required to provide them in a common format, like MS Word, rather than the proprietary FrameMaker format they use. Their providing a PDF may completely satisfy their obligation; your lawyers may be helpful here.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices
    bmr0330 wrote:
    I did ask them for the source file but they haven't been forthcoming with that. I may look into the evaluation copy of FM anyway but considering the price ($868 USD through our catalogue supplier) I doubt I would be able to get a licensed copy once the evaluation runs out. I do appreciate the suggestion though. Thank you. Brian

  • Need help now! Preserving color in Pages to PDF format

    I read the other recent post on PDF-CMYK and I may be in the same boat. Right now, I need to get my Pages newsletter (6 pages long) saved in a PDF format that will preserve the original colors I used in Pages. This PDF will be emailed and be posted online for others to read online--so I need the same colors. Everything I have tried has failed - but this for some reason worked, and I dont know why (nor I am not sure what it is doing) -
    From Pages Print, Save PDF as PostScript (no clue what this is). It created a 40MB file. I used Preview to open it and it converted it to a PDF - *perfect color match to original Pages document* Yes!... BUT - in the title bar I can see the name of my file, it has .pdf a the end. So I try to File Save it in the required directory and it reverts to the off-colors. The off colors consistently appear when I try to use any other PDF save format.
    My goals -
    #1 Time-date Priority (less than 24hrs) I need a compressed email friendly newsletter in PDF to share via email/web download.
    #2 Print ready PDF version (not sure on the file requirements yet)
    HELP!!

    Thanks. Yes, I realize i need RGB. When I try any of the PDF print options (either export or print PDF or Compressed PDF or Email PDF) they ALL change the color layout of the entire newsletter!! The colored blocks behind the text are all altered, but all of the inserted JPGS are just fine.
    I managed to use Automator and applied a custom Quartz filter to apply an RGB profile and render the intent on the shading and it seemed to help some, but it is not the same as the original. This action I created has to start with a PDF file to run it - so you can see I am back at square one with the PDF save not capturing the correct colors. This action took a 7+mb PDF file (created via Export) and made it into 660kb (oh, I also used a compression quartz filter too in the action).
    I only had one problem with one image getting fine white lines horizontally through it. I suspect that is one image that was very large to begin with. I will try to resize it in PSE and then insert a smaller version of it. The rest of the jpg's were fine.
    Right now this newsletter PDF has to be emailed to members and it will be posted online for download. It will also be emailed to prospective commercial printers to give them a preview of the project (but not use this actual file for printing).
    So I am still stuck with PDF saves not preserving my original colors.

  • Need help understanding profiles and color management

    I made the big leap from inexpensive inkjets to:
    1 Epson 3800 Standard
    2 Spyder3Studio
    I have a Mac Pro Quad, Aperture, PS3, etc.
    I have a steep learning curve ahead, here's what I've done:
    1 Read a lot of books, watched tutorials, etc.
    2 Calibrated the monitor
    3 Calibrated the printer several times and created .icc profiles
    What I've found:
    1 The sample print produced by Spyder3Print, using the profile I created with color management turned off in the print dialog, looks very good.
    2 When I get into Aperture, and apply the .icc profile I created in the proofing profile with onscreen proofing, the onscreen image does not change appreciably compared with the no proof setting. It gets slightly darker
    3 When I select File>Print image, select the profile I created, turn off color management and look a the resulting preview image it looks much lighter and washed out than the onscreen image with onscreen proofing turned on.
    4 When I print the image, it looks the same as was shown in the print preview...light and washed out, which is much different than what is shown in edit mode.
    5 When I open PS3 with onscreen soft-proofing, the onscreen image is light and washed out...just like displayed in PS3 preview. If I re-edit the image to look OK onscreen, and print with the profile and color management turned off, the printed image looks OK.
    So, why am I confused?
    1 In the back of my simplistic and naive mind, I anticipated that in creating a custom printer profile I would only need to edit a photo once, so it looks good on the calibrated screen, and then a custom printer profile will handle the work to print a good looking photo. Different profiles do different translations for different printers/papers. However, judging by the PS work, it appears I need to re-edit a photo for each printer/paper I encounter...just doesn't seem right.
    2 In Aperture, I'm confused by the onscreen proofing does not present the same image as what I see in the print preview. I'm selecting the same .icc profile in both locations.
    I tried visiting with Spyder support, but am not able to explain myself well enough to help them understand what I'm doing wrong.
    Any help is greatly appreciated.

    Calibrated the printer several times and created .icc profiles
    You have understand that maintaining the colour is done by morphing the colourants, and you have understood that matching the digital graphic display (which is emissive) to the print from the digital graphic printer (which is reflective) presupposes a studio lighting situation that simulates the conditions presupposed in the mathematical illuminant model for media independent matching. Basically, for a display-to-print match you need to calibrate and characterise the display to something like 5000-55000 kelvin. There are all sorts of arguments surrounding this, and you will find your way through them in time, but you now have the gist of the thing.
    So far so good, but what of the problem posed by the digital graphic printer? If you are a professional photographer, you are dependent on your printer for contract proofing. Your prints you can pass to clients and to printers, but your display you cannot. So this is critical.
    The ICC Specification was published at DRUPA Druck und Papier in Düsseldorf in May 1995 and ColorSync 2 Golden Master is on the WWDC CD for May 1995. Between 1995 and 2000 die reine Lehre said to render your colour patch chart in the raw condition of the colour device.
    The problem with this is that in a separation the reflectance of the paper (which is how you get to see the colours of the colourants laid down on top of the paper) and the amount of colourant (solid and combinations of tints) gives you the gamut.
    By this argument, you would want to render the colour patch chart with the most colourant, but what if the most colourant produces artifacts? A safer solution is to have primary ink limiting as part of the calibration process prior to rendering of the colour patch chart.
    You can see the progression e.g. in the BEST RIP which since 2002 has been owned by EFI Electronics for Imaging. BEST started by allowing access to the raw colour device, with pooling problems and whatnot, but then introduced a primary ink limiting and linearisation.
    The next thing you need to know is what colour test chart to send to the colour device, depending on whether the colour device is considered an RGB device or a CMYK device. By convention, if the device is not driven by a PostScript RIP it is considered an RGB device.
    The colour patch chart is not tagged, meaning that it is deviceColor and neither CIEBased colour or ICCBased colour. You need to keep your colour patch chart deviceColor or you will have a colour characterisation of a colour managed conversion. Which is not what you want.
    If the operating system is colour managed through and through, how do you render a colour test chart without automatically assigning a source ICC profile for the colourant model (Generic RGB Profile for three component, Generic CMYK Profile for four component)?
    The convention is that no colour conversion occurs if the source ICC device profile and the destination ICC device profile are identical. So if you are targetting your inkjet in RGB mode, you open an RGB colourant patch chart, set the source ICC profile for the working space to the same as the destination ICC profile for the device, and render as deviceColor.
    You then leave the rendered colourant test chart to dry for one hour. If you measure a colourant test chart every ten minutes through the first hour, you may find that the soluble inkjet inks in drying change colour. If you wait, you avoid this cause of error in your characterisation.
    As you will mainly want to work with loose photographs, and not with photographs placed in pages, when you produce a contract proof using Absolute Colorimetric rendering from the ICC profile for the printing condition to the ICC profile for your studio printer, here's a tip.
    Your eyes, the eyes of your client, and the eyes of the prepress production manager will see the white white of the surrounding unprinted margins of the paper, and will judge the printed area of the paper relative to that.
    If, therefore, your untrimmed contract proof and the contract proof from Adobe InDesign or QuarkPress, or a EFI or other proofing RIP, are placed side by side in the viewing box your untrimmed contract proof will work as the visual reference for the media white.
    The measured reference for the media white is in the ICC profile for the printing condition, to be precise in the WTPT White Point tag that you can see by doubleclicking the ICC profile in the Apple ColorSync Utility. This is the lightness and tint laid down on proof prints.
    You, your client and your chosen printer will get on well if you remember to set up your studio lighting, and trim the blank borders of your proof prints. (Another tip: set your Finder to neutral gray and avoid a clutter of white windows, icons and so forth in the Finder when viewing.)
    So far, so good. This leaves the nittygritty of specific ICC profiling packages and specific ICC-enabled applications. As for Aperture, do not apply a gamma correction to your colourant patch chart, or to colour managed printing.
    As for Adobe applications, which you say you will be comparing with, you should probably be aware that Adobe InDesign CS3 has problems. When targetting an RGB printing device, the prints are not correctly colour managed, but basically bypass colour management.
    There's been a discussion on the Apple ColorSync Users List and on Adobe's fora, see the two threads below.
    Hope this helps,
    Henrik Holmegaard
    technical writer
    References:
    http://www.adobeforums.com/webx?14@@.59b52c9b/0
    http://lists.apple.com/archives/colorsync-users/2007/Nov/msg00143.html

  • Combobox scrollbar width  and item list padding

    Hello, I am running an application on a touchscreen, and the default combobox is way too small to be used.
    I have tried skinning the combo box component to make the scrollbar wider, it didn't work.
    I tried combobox.dropdown.horizontalScrollBar.width = 300;
    Nothing happens.
    Is there any way to do this?
    Also, I needed to increase to font size of the list items, which I was able to do. However now all the list items are squished fairly close together. Is there a way to widen each list item/ add padding around the text?
    Or heck, is there even a custom combobox control that will allow me to do this? I really need this, but can't figure it out.

    Hi Siva/Viswas,
    Problem got solved.I fixed width in pixels and the width does not change.
    But as Viswas said,if the text is long then the user will not be able to see entire text..How to solve this problem other than showing a different text to user(As the user does not want that way).
    I tried by dynamically creating a tool tip i.e, i bound the tool tip of list box to a attribute and i was setting the attribute to the selected text in list box.But unfortunately tool tip does not show up.Do you guys worked on dynamically generating a tool tip or else can you tell how to solve this problem.
    Thanks and Regards,
    Pradeep

Maybe you are looking for

  • IPad2 and VGA/Video Mirroring...

    I'm a teacher with a VGA projector in my classroom. I really want to get an iPad2, but I've been holding out until I could justify the purchase by using it in class (Maps, Safari, Keynote, Pages, using the cameras to record video of the kid's project

  • Locked / password  by Mail

    Hi, # File name - Lock.sh # # Description - Script which sends mail to DBA team # # if any Locked Users found. # #!/bin/ksh export ORACLE_OWNER=oracle export ORACLE_BASE=/u01/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.3 export ORACLE_SID=P

  • Transfer Focus From a Child Dialog To its Parent Frame

    Hi I m working on a Multimedia Desktop Application. I have done alomst 90% of work. Here I have a problem to transfer focus from a Child Dialog to Parent Frame. Remember the whole applicatio does not use Mouse every thing is handled on key events. So

  • Start up computer not loading & freezing every minute

    If  anyone can shed some light on this I would be so grateful. So I started up my computer in safe mode as the computer keeps freezing with the multi coloured wheel of death, and it is not loading the icons on the desktop or the bar at the bottom. Ju

  • Read XML Values

    SQL*Plus: Release 9.2.0.1.0 - Production on Wed Mar 26 15:01:22 2008 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production With the Partitioning, OLAP and Oracle Da