• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

resize combox dropdown

New Here ,
Sep 09, 2012 Sep 09, 2012

Copy link to clipboard

Copied

hi 

how do you resize combox dropdown? i have try from the stage with no luck.  it is inside a movie clip.......

thanks

Josh

TOPICS
ActionScript

Views

2.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 10, 2012 Sep 10, 2012

if you want to customize/format the text of the combobox, you can assign one (or more) textformat instances.  for example:

var tfor:TextFormat = new TextFormat();

tfor.size = 8;

//if cb is your combobox instance:

cb.textField.setStyle("textFormat", tfor);

cb.setStyle("disabledTextFormat", tfor);

cb.dropdown.setRendererStyle("textFormat", tfor);

p.s.  please mark helpful/correct responses.

Votes

Translate

Translate
Community Expert ,
Sep 09, 2012 Sep 09, 2012

Copy link to clipboard

Copied

show the code you tried and explain the reference to the movieclip parent and the combobox reference.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2012 Sep 09, 2012

Copy link to clipboard

Copied

code

function addComList ():void {

com_txt.addItem( { label: "com" } );

com_txt.addItem( { label: "net" } );

com_txt.addItem( { label: "org" } );

}

i using flash form components

the movieclip is called form2

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2012 Sep 09, 2012

Copy link to clipboard

Copied

if the code you want to use to control your cb is in the same scope as addComList(), use

com_txt.width, com_txt.height

if the code is in the scope of the parent of form2, use:

form2.com_txt.width, form2.com_txt.height

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2012 Sep 09, 2012

Copy link to clipboard

Copied

thanks

i think i  am looking to set the font size.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

if you want to customize/format the text of the combobox, you can assign one (or more) textformat instances.  for example:

var tfor:TextFormat = new TextFormat();

tfor.size = 8;

//if cb is your combobox instance:

cb.textField.setStyle("textFormat", tfor);

cb.setStyle("disabledTextFormat", tfor);

cb.dropdown.setRendererStyle("textFormat", tfor);

p.s.  please mark helpful/correct responses.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

would you be so kind to explane how that code does what it does? i am trying to learn and i find the stuff on the web doesnt explane how or why, and i learn easiter knowing why/how.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

  the dropdown text is fine but when it is in the upstate the font is too smallscreenshot.gif

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

change the font size to suit your needs.  i wasn't suggesting that size=8 was what you should use.

to learn more about styling a combobox (or other flash components): http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d118a9c65b32...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

size=8 works great in the dropdowns but when an item is picked it is too small

sorry to be a pest, thanks four your help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

then use a different size in the cb's textfield:

var tfor:TextFormat = new TextFormat();

tfor.size = 8;

//if cb is your combobox instance:

cb.setStyle("disabledTextFormat", tfor);

cb.dropdown.setRendererStyle("textFormat", tfor);

tfor.size=12;
cb.textField.setStyle("textFormat", tfor);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

sorry for bothering you.      what am doindg wrong? nothing is changing

import fl.controls.ComboBox;

import flash.text.TextField;

import flash.text.TextFieldType;

// custom function we create to populate the comboBox list

// create a new textformat and set the style of it

var tfor:TextFormat = new TextFormat();

com_txt.setStyle("disabledTextFormat", tfor);

com_txt.dropdown.setRendererStyle("textFormat", tfor);

tfor.size=11;

com_txt.textField.setStyle("textFormat", tfor);

com_txt.dropdownWidth = 40;

com_txt.dropdown.rowHeight = 10;

function addComList ():void {

com_txt.addItem( { label: "" } );

com_txt.addItem( { label: "com" } );

com_txt.addItem( { label: "net" } );

com_txt.addItem( { label: "org" } );

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

looks like you have to use a different textformat instance for each:

import fl.controls.ComboBox;

import flash.text.TextField;

import flash.text.TextFieldType;

// custom function we create to populate the comboBox list

// create a new textformat and set the style of it

var tfor1:TextFormat = new TextFormat();

com_txt.setStyle("disabledTextFormat", tfor1);

com_txt.dropdown.setRendererStyle("textFormat", tfor1);

var tfor:TextFormat = new TextFormat();

tfor.size=11;

com_txt.textField.setStyle("textFormat", tfor);

com_txt.dropdownWidth = 40;

com_txt.dropdown.rowHeight = 10;

function addComList ():void {

com_txt.addItem( { label: "" } );

com_txt.addItem( { label: "com" } );

com_txt.addItem( { label: "net" } );

com_txt.addItem( { label: "org" } );

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 10, 2012 Sep 10, 2012

Copy link to clipboard

Copied

thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2012 Sep 11, 2012

Copy link to clipboard

Copied

you're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2012 Sep 11, 2012

Copy link to clipboard

Copied

where can i learn as3?

my dropdown is to far down from the rest, why me? the issues started when i made my flash full browser. i relize i had to scale everything dwon in flah so it will look right in the browser, everything scaled down easily accpet the combox

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2012 Sep 11, 2012

Copy link to clipboard

Copied

there are a number of ways to learn as3.  some people learn best using a book and some via trial and error.

but i think the most helpful way to learn is to start by learning how to use the adobe help files.  especially, the listing of all classes, properties, methods and events.  learning how to use it (you don't need to learn or memorize it), combined with trial and error (or testing in flash) is what works best for me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2012 Sep 11, 2012

Copy link to clipboard

Copied

any way to move the dropdown? its too low.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2012 Sep 11, 2012

Copy link to clipboard

Copied

LATEST

you can use its x and y properties to change where it appears on stage:

com_txt.y -= 200;  // will move it up 200 pixels

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines