Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-29-2009, 03:56 PM   #1
pudrocker
Registered User
 
Join Date: Apr 2009
Posts: 3
Default [AS3] Blank first item in ComboBox

I've imported a swf into my actionscript code which contains a combobox (instance name of "cb"). I'm having an issue with not being able to set the "prompt" property from within the code and also with the first item in the combobox always remaining blank.



When I compile my project withing FlashDevelop, the combobox populates all the items properly, but always leaves the first item (item 0) blank. When I try to assign the "prompt" property to a string, it has no effect - the first item always remains blank. When choosing different items in the combobox, the chosen item does not appear in the combobox for the user to see she has chosen it - it just remains blank.



**PLEASE help**



Here is the condensed code:


ActionScript Code:
[Embed(source = "../../../../flash/as3/video_player.swf")] private var VideoPlayerAssets:Class; _xVideoAssetsLoader = new EmbeddedAssetSwfLoader(VideoPlayerAssets); _xVideoAssetsLoader.addEventListener(EmbeddedAssetSwfLoader.EMBEDDED_ASSET_LOADE D, videoAssetsLoaded); _xVideoAssetsLoader.loadAssetSwf();   _xVideoControlsSymbol = _xVideoAssetsLoader.getSymbolInstance("VideoControlsHome"); _xVideoControlsSymbol.embedWindow.content.cb.prompt = "Choose a Size"; //THIS HAS NO EFFECT   _xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "400 x 320", width:400, height:320, data:"400x320" } ); _xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "480 x 384", width:480, height:384, data:"480x384" } ); _xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "560 x 448", width:560, height:448, data:"560x448" } ); _xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "640 x 512", width:640, height:512, data:"640x512" } );   _xVideoControlsSymbol.embedWindow.content.cb.addEventListener(Event.CHANGE, sizeSelected);
pudrocker is offline   Reply With Quote
Old 05-09-2009, 04:50 AM   #2
camdagr8
Registered User
 
Join Date: Oct 2007
Posts: 22
Default

Try this:
ActionScript Code:
_xVideoControlsSymbol.embedWindow.content.cb.removeAll(); _xVideoControlsSymbol.embedWindow.content.cb.selectedIndex = -1; _xVideoControlsSymbol.embedWindow.content.cb.prompt = "Choose a Size";   _xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "400 x 320", width:400, height:320, data:"400x320" } ); _xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "480 x 384", width:480, height:384, data:"480x384" } ); _xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "560 x 448", width:560, height:448, data:"560x448" } ); _xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "640 x 512", width:640, height:512, data:"640x512" } );
camdagr8 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[AS3] ComboBox inside Datagrid CFB001 Components 13 02-05-2009 10:18 AM
[AS3] ComboBox Problem ptsung Components 0 01-25-2009 06:15 AM
Combobox selected item disappearing cowtrap ActionScript 3.0 1 03-15-2008 01:20 AM
Changing the selected item in a combobox mcmcom Components 3 07-28-2006 11:42 AM
ComboBox setting the first item selected problem Ihou Components 1 01-21-2006 07:17 AM


All times are GMT. The time now is 01:56 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.