bindu.nvn Posted January 16, 2011 Report Share Posted January 16, 2011 Need support in Flex.....Its urgent Quote Link to comment Share on other sites More sharing options...
2012 Posted January 16, 2011 Report Share Posted January 16, 2011 wht is the issue? Quote Link to comment Share on other sites More sharing options...
bindu.nvn Posted January 16, 2011 Author Report Share Posted January 16, 2011 Have a combobox with center,stretch and tile. I need to change the background image based on the selected item in the combobox. Quote Link to comment Share on other sites More sharing options...
2012 Posted January 16, 2011 Report Share Posted January 16, 2011 r u susing flex builder 3 or 4 Quote Link to comment Share on other sites More sharing options...
2012 Posted January 16, 2011 Report Share Posted January 16, 2011 If u have u r dataprovider for the combo box code looks like this<mx:Array id="arr"> <mx:Object label="One" /> <mx:Object label="Two" /> <mx:Object label="Three" /> <mx:Object label="Four" /> <mx:Object label="Five" /> <mx:Object label="Six" /> <mx:Object label="Seven" /> <mx:Object label="Eight" /> <mx:Object label="Nine" /> <mx:Object label="Ten" /> </mx:Array> <mx:ApplicationControlBar dock="true"> <mx:Form styleName="plain"> <mx:FormItem label="selectionColor:"> <mx:ColorPicker id="colorPicker" selectedColor="#CCCCCC" /> </mx:FormItem> </mx:Form> </mx:ApplicationControlBar> <mx:ComboBox id="comboBox" dataProvider="{arr}" selectionColor="{colorPicker.selectedColor}" /> Quote Link to comment Share on other sites More sharing options...
2012 Posted January 16, 2011 Report Share Posted January 16, 2011 There are several ways... here's another one. It requires that your pictures arestored in the same folder as your app. That's easily changed. Just add pathinfo to the filename you pass to the sub.Drop a combobox and image control on a new form and run this....Option ExplicitPrivate msFileNames() As StringPrivate Sub Form_Load()ReDim msFileNames(0)'Add your itemsCall AddAnItem("Jane Doe", "janedoe.jpg")Call AddAnItem("John Doe", "johndoe.jpg")End SubPrivate Sub Combo1_Click()Set Image1.Picture = LoadPicture(msFileNames(Combo1.ListIndex))End SubPrivate Sub AddAnItem(ComboText As String, FileName As String)Dim iItemIndex As IntegerWith Combo1.AddItem ComboTextiItemIndex = .NewIndexIf iItemIndex > UBound(msFileNames) ThenReDim Preserve msFileNames(iItemIndex)End IfmsFileNames(iItemIndex) = FileNameEnd WithEnd Sub Quote Link to comment Share on other sites More sharing options...
2012 Posted January 16, 2011 Report Share Posted January 16, 2011 If u still not able to do it let me know i will give u some other solutions Quote Link to comment Share on other sites More sharing options...
andhrabalayya Posted January 16, 2011 Report Share Posted January 16, 2011 You should checkout [url=http://www.stackoverflow.com]www.stackoverflow.com[/url] ... Post your question there and paste the link here !![quote author=bindu.nvn link=topic=144157.msg1648544#msg1648544 date=1295191872]Need support in Flex.....Its urgent[/quote] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.