Listbox
Is there a resizeable Flash 5 Listbox / Combobox out there?
The Macromedia Smartclip is not at all smart. When resized, the dropdown button is also resized proportionally. Its behaviour also leaves a bit to be desired.
I am particularly interested in loading movie clips into the listbox and combobox, rather than just a text element for each row.
Hoping...
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-17-2001, 08:15 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Listbox /combobox Help, Linking Combo And Listbox To Call Url W/ Flash 7
Seeking:
I'm want to be able to select an item from a combobox, that will call a list into a listbox, and then be able to click on that link to navigate to a URL.
Purpose:
I have a list of over 80 blog urls from the past several year, a monthly release. I would like to be able to select the year in a combobox which will trigger the 12 url from that year to appear in a listbox, when an item from the listbox is selected I want that url to open. This has proved to be quite difficult in in Flash 7. Any assistance, link, or tutorials would be greatly appreciated.
Load Swf File From ListBox, When Close Swf ListBox Disappear
Hello all,
I seemed to have problems with Listbox for days now. I managed to write actionscript to load external swf file when selecting a choice from the listbox. However, when the close the swf file by writing the script 'unloadmovie'. It returns to the main scene however, the problem is the ListBox disappears!... anyone advice me please what I did wrong
Thank you very much
Any help appreciated.
Peddie
ListBox, Create My Own ListBox...
Hi there…
I need to create my own list box (no components). With the scroll bar, and the selected item option with the highlighted option too. Basically with all the options that the ListBox component provides.
What I am trying to do, is a light (very light) version of the existing ListBox.
Can anyone help me out?
Thanks.
Cheers.
Leo.
One ListBox Which Populates The Second ListBox
my brain is mush. I've been staring at this for nearly 10 hours straight and I'm more confused now than ever. Someone with fresh eyes please look this over and help me out. Ugh.
I'm trying to make an mp3 player catalogue for sound effects. It has a listbox for the main categories and a second list box for all the sounds found in that category.
I have data coming in from an external xml file here:
Code:
<soundfx>
<sounds>
<category label="Animals">
<sound name="Cow" file="cow.wav" />
<sound name="Chicken" file="cow.wav" />
<sound name="Pig" file="cow.wav" />
</category>
<category label="Cartoons" >
<sound name="Bugs Bunny" file="cow.wav" />
</category>
<category label="Crowds">
<sound name="Football Crowd" file="cow.wav" />
</category>
</sounds>
</soundfx>
Here is my entire AS3 code.
Code:
import flash.display.Loader;
import flash.events.*;
import flash.net.*;
var categorySel:String;
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);
category.categoryList.addEventListener(Event.CHANGE, getSounds);
//sounds.soundList.addEventListener(Event.CHANGE, getSoundFiles);
//sounds.soundList.text = category.categoryList.selectedItem.data;
function getSounds(e:Event):void
{
sounds.soundList.removeAll();
categorySel = category.categoryList.selectedItem.data;
var sl:XMLList = xml.sounds.category;
for(var i:uint=0; i<sl.length(); i++)
{
sounds.soundList.addItem({data:sl.sound.@file [i],
label:sl.sound [i]});
}
}
var xml:XML;
function onLoaded(e:Event):void
{
xml = new XML(e.target.data);
var cl:XMLList = xml.sounds.category;
for(var i:uint=0; i<cl.length(); i++)
{
category.categoryList.addItem({data:cl.sound.@name[i],
label:cl.@label[i]});
}
}
loader.load(new URLRequest("soundfx.xml"));
I'm too exhausted to continue tonight. I sure hope someone out there can help tackle this one. There is nothing on these forums, or any other forums I could find, that discusses 2 listboxes, one populating the other.
Listbox
Hi all,
I have been modifying a listbox created by Pipey downloaded from Flashkit to be used in a site. The listbox allows you to add text items to a movie with a scroll box, so every time you add an item it duplicates the movie "Row0" and Changes it to "Row" & Counter. All the while utilizing a scrollbar. This works great but unfortunately I need to send every item in the listbox to another text box in another scene. I can't figure out what variables to send and how to write the action on the button. Is it possible to send variables from a movie inside another movie? It seems like it would be simple, that's why it's so frustrating. If anyone could look at Pipey's Flash File called "listbox" and tell me how to write the action in the button that would make my day. Thanks
ListBox
Hi,
I've checked the listbox tutorials but they don't seem to cover what I need.
I need to create a simple listbox with 3 items. According to which one is selected it loads a movie. I've been going round and round just to create this simple thing.
Thanks
Listbox
hallo
i´m here again
i´ve got a big problem
i have to read out all variables i have selected from the listbox
how can i do it?
please answer soon
thank you
ListBox
I have a listbox and i need to load a text file (that has variables in it) when someone clicks on a certain item in the list.
For example:
Its a store list
So...
Entry 0 = 100 Mile House
There are the following text fields
TextAddress
TextHours
TextStore
TextPhone
TextManager
And i have these declared in the text document for each store.
The text file is 100mile.txt
Im curious how to go about using the listbox as im new to flash (but getting better), I usually dont ask for help unless im completly stuck because i prefer to learn on my own heh.
Thanks in advance for any assistance anyone providex with my situation.
ListBox ... Help
Hi,
I have a listbox with some labels.
Is possible display the select label in a dynamicbox?
I try display one item and is possible:
on (release) {
box1 = listBox1.getItemAt(4).label;}
But this display only the item4
What i need is select a item and display it on the dynamicbox, how can i do this?
Listbox
Hi,
I need some urgente help, im working in a multichoice quest and i need disable one listbox after the 3th choice, is this possible?
Help me pls, tks
Help And Example For ListBox
I need help in coding for functions and controls for a ListBox component.
Basically, what I need is that when I click on an item in the ListBox, an object [image, {Flash,avi,wmv,mpg} movie, text document] will load onto a specified area. Plus, whenever an image is loaded, panning and zooming controls are enabled [ while for movies they will be disabled ].
Any example files?
No Zip In Listbox
I am using this script below to add names to my listbox. I want to be able to add that I don't want the files with the ext of zip to be added to this list.
Thanks
lv = new LoadVars();
lv.onLoad = function() {
tmp = lv.theFiles.split("#");
for (i=0; i<tmp.length; i++-100) {
var name = tmp[i];
dropdown.addItem(name);
}
};
Could Someone Help Me With My Listbox...
im trying to get my Listbox to populate dynamicly from an external .txt file
but i cant seem to figure out how to get the array to call variables
here is my code:
loadVariablesNum("music.txt", 0);
//
// The labels in the Playlist
mp3Playlist = new Array();
//
// Populate the listbox
for (i in myLabels) {
playlist.addItem(mp3Playlist[i]);
}
//
// Display Playlist
function listDisplay(component) {
list = component.getSelectedItem().label;
trace(list);
}
//
// Function
playlist.setChangeHandler("listDisplay");
ListBox.......Help
Please help me to take a short time for looking this article
http://www.macromedia.com/devnet/mx/...omponents.html
I followed the direction and it works well but I have a problem in this example. I only need 3 or less items(labels) add into the listbox,how can I show the picture numbers by the items?
Any advices will great in the application! Thanks!
Listbox
Hi all!!
I have a listbox component in a movie clip. I am using a button to make the movie clip visible and making the first option (index 0) of the list box selected at the same time. Is there any way to make the list box scrollable by using up and down arrows, instead of the mouse?
Also, can I allow the user to submit the desired option in the listbox by pressing Enter, instead of using the mouse?
Cheers,
mmasci,
Listbox Help
I cannot seem to get the removeItemAt method to work properly. I assign an index i with the index of a selected item from the listbox and everytime i call the removeItemAt(i) it always removes the item at index 0. this is my code:
this is the code from the first frame in the only layer of the scene:
var i;
function itemIndex(){
i = list.getSelectedIndices();
}
function removeItem(){
list.removeItemAt(i);
}
I thought it was a variable passing problem but when i call a trace(i) from the removeitem function it returns the correct value. any thoughts???
Listbox Help
I cannot seem to get the removeItemAt method to work properly. I assign an index i with the index of a selected item from the listbox and everytime i call the removeItemAt(i) it always removes the item at index 0. this is my code:
this is the code from the first frame in the only layer of the scene:
var i;
function itemIndex(){
i = list.getSelectedIndices();
}
function removeItem(){
list.removeItemAt(i);
}
I thought it was a variable passing problem but when i call a trace(i) from the removeitem function it returns the correct value. any thoughts???
Listbox - Another Cry For Help
I'm completely newborn babe to flash, and i have been trying to teach myself through various tutorials.
One feature I'm trying to add to a site I'm (trying) to make is a listbox. I followed a tutorial to get the general idea, however I want to change it.
I admit I have difficulty learning from just reading and get confused easily, so if someone could help me out with very clear and simple steps like a walkthrough, it would be VERY much appreciated. Even if someone has to walk me through via IM, i don't care, i just really need help. It's an important website for someone I know.
I would like my listbox to contain dates, and when the person clicks the date, the time and place appears in the textbox. At the same time I would like it to be skinned to match the rest of my site (and other components like a form, which i have not yet created either haha).
Also, to make it for easier updating, is it possible to have the list of dates linked to a txt file so all i have to do is add some new dates to that file so it appears in the listbox?
Thank you SOOOO MUCH to anyone who can help me.
ListBox
Why is this so difficult! No I am not an expert Actionscrtipt(er), but I do OK. I have dragged a LisyBox component onto the stage within a MovieClip. All I want to do is, when the user Clicks on one of the many choices to a.) know which choice the user selected then b.) be able to do something based on that choice (i.e. loadMovie(xxxx.swf,1). I have searched and searched and while I have found hints, I cannot find just a straightforward way of doing what should be...
I have a ListBox called (menu) within a movieclip call mcMain. I have added a series of selections using -- menu.addItemAt(0,"Welcome to SRA"); but cannot get any further with my challenge. Thank you in advance for your precise help....
ListBox
Hello,
Once I have configured a TextBox Component they way i like it....how can i send the information to a email address..
I can only assume you would load variables to a .asp file...but im sure im really wrong...
I have tried the GetValue, cant make it work....HELP!
can somebody give me a suggestion...
or Email me @ johnrlee4@hotmail.com
thanks,
johnny
Vibe
Need A Little Help (listbox)
Hey,
I need some flash resource files, but I can't make it myself and I didn't find any yet. Exactly I need a comfortable list box with xml file. All items in list box should be links. And when you roll over on some item in that listbox it shows a little popup window with small description.
Well I found one script, but it cost a lot. Here is link to these similar scripts:
http://www.adobe.com/cfusion/exchang...sort=0&Submit=
Actually I need "XGListBox". For me it will be perfect.
Does anybody know where I can download similar flash files?
Or maybe somebody can write that code for me. I would be very happy.
Of course if it isn't so hard, because I am not very good in flash.
Thanks
Listbox Help
I Need Some Help On My List Box. I am creating a listbox for some movies. What I want to happen is when someone clicks on a Movie Title it will load up in the MediaPlayer and play. So how do I do this? and how do I write the Actionscript for this function? Need Help.
MWilkerson
Listbox
Quote:
function padr(s, n, c) {
var nLen = s.length;
for (var i=nLen; i < n; i++) {
s += c;
}
return s;
}
function dataLoad(isAdd) {
var sLabel, i;
equipment.onLoad = function() {
lbxIdDisplay.removeAll();
for (i=0; i<this.n; i++) {
sLabel = padr(this["Id"+i] + ", " + this["Make"+i], 25, " ");
sLabel += " " + padr(this["Model"+i], 13, " ") + " " + this["Serial"+i];
lbxIdDisplay.addItem(
sLabel,
{Id:this["Id"+i],
Make:this["Make"+i],
Model:this["Model"+i],
Serial:this["Serial"+i]
}
);
}
if (!isAdd) {
dtfMsg.text = this.n + " Records are loaded. Click any record to view, edit or delete it, or click the Add Record button to add a new one.";
} else {
dtfMsg.text = "Record has been added. Enter a new record and click Save to save it, or click any record to view, edit or delete it.";
}
for (i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = '';
}
}
equipment.tab = "Heavy";
equipment.cond = gsFilter;
//trace("condition = " + lvAddressData.cond);
equipment.sendAndLoad(sFileLoc + "getTableData.php", equipment, "POST");
//lvAddressData.send(sFileLoc + "getTableData.php", "newwin", "POST");
}
function checkFilter(compPassed) {
gsFilter = compPassed.getSelectedItem().data;
dtfMsg.text = "Loading records for " + compPassed.getSelectedItem().label;
displayed for
for (var i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = '';
}
btnSaveChanges._visible = false;
btnDeleteRecord._visible = false;
dataLoad(false);
}
cboFilter.setChangeHandler("checkFilter", this);
function getEdits(compPassed){
mcFields._visible = true;
if (btnAddThisRecord != undefined) {
btnAddThisRecord._visible = false;
}
if (btnSaveChanges == undefined) {
this.attachMovie("FPushButtonSymbol", "btnSaveChanges", 2, {_x: 382, _y: 174});
centerFontStyle.addListener(btnSaveChanges);
btnSaveChanges.setLabel("Save Changes");
btnSaveChanges.tabEnabled = false;
btnSaveChanges.setClickHandler("updateRecord", this);
} else {
btnSaveChanges._visible = true;
}
// make Delete Record button if first time called
if (btnDeleteRecord == undefined) {
this.attachMovie("FPushButtonSymbol", "btnDeleteRecord", 3, {_x: 382, _y: 204});
centerFontStyle.addListener(btnDeleteRecord);
btnDeleteRecord.setLabel("Delete Record");
btnDeleteRecord.tabEnabled = false;
btnDeleteRecord.setClickHandler("deleteRecord", this);
} else {
btnDeleteRecord._visible = true;
}
dtfMsg.text = "Make changes to any fields in the edit boxes and click Save Changes, or click Delete Record to delete this record from the database";
var record = compPassed.getSelectedItem();
for (var i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = record.data[gaFields[i].name];
}
}
lbxIdDisplay.setChangeHandler("getEdits", this);
// function to SHOW BLANK FIELDS for data entry when Add Record is clicked
function addRecord(g) {
btnDeleteRecord._visible = false;
btnSaveChanges._visible = false;
mcFields._visible = true;
for (var i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = '';
}
if (btnAddThisRecord == undefined) {
this.attachMovie("FPushButtonSymbol", "btnAddThisRecord", 1, {_x: 382, _y: 174});
centerFontStyle.addListener(btnAddThisRecord);
btnAddThisRecord.setLabel("Save");
btnAddThisRecord.tabEnabled = false;
btnAddThisRecord.setClickHandler("addThisRecord", this);
}
btnAddThisRecord._visible = true;
// start focus on first field in form
Selection.setFocus("mcFields.dtfId");
dtfMsg.text = "Enter data for the new record in the edit boxes and click Save to add it to the database";
}
btnAddRecord.setClickHandler("addRecord", this);
// function to SAVE RECORD to database when btnAddThisRecord is clicked
function addThisRecord() {
for (var i in equipment) {
delete equipment[i];
}
equipment.onLoad = function() {
// msg will indicate status of insert
dtfMsg.text = this.msg;
// update display
dataLoad(true);
// keep Save button displayed in case user wants to enter multiple records
//btnAddThisRecord._visible = false;
}
for (var i in gaFields) {
if (gaFields[i].type == "n") {
equipment[gaFields[i].name] = Number(mcFields["dtf" + gaFields[i].name].text);
} else {
equipment[gaFields[i].name] = escape(mcFields["dtf" + gaFields[i].name].text);
}
}
equipment.sendAndLoad(sFileLoc + "insertContact.php", equipment, "POST");
//lvAddressData.send(sFileLoc + "insertContact.php", "newwin", "POST");
}
// addThisRecord is an event handler for btnAddThisRecord, and is assigned when that
// button is created, in the addRecord function above
// function to UPDATE A RECORD when Save Changes button is clicked
function updateRecord() {
var i;
for (i in equipment) {
delete equipment[i];
}
equipment.onLoad = function() {
msg.text = this.msg;
// update display if successful
if (this.success) {
dataLoad(false);
}
btnSaveChanges._visible = false;
btnDeleteRecord._visible = false;
}
for (i in gaFields) {
if (gaFields[i].type == "n") {
equipment[gaFields[i].name] = Number(mcFields["dtf" + gaFields[i].name].text);
} else {
equipment[gaFields[i].name] = escape(mcFields["dtf" + gaFields[i].name].text);
}
}
equipment.tab = 'Heavy';
equipment.cond = 'Id=' + Number(mcFields.dtfId.text);
equipment.sendAndLoad("updateContacts.php", equipment, "POST");
//lvAddressData.send("updateContacts.php", "newwin", "POST");
}
// updateRecord is an event handler for btnSaveChanges, and is assigned when that
// button is created, in the getEdits function above
// functions for DELETING A RECORD (confirmation, etc)
function deleteRecord() {
//msg.text = "Delete Record clicked " + deleteConfirm._name;
mcDeleteConfirm._visible = true;
mcDeleteConfirm.yes.enabled = true;
mcDeleteConfirm.no.enabled = true;
mcDeleteConfirm.msg.text = "Are you sure you want to delete the record for " + mcFields.dtfId.text + " " + mcFields.dtfId.text + " ? ";
}
// deleteRecord is an event handler for btnDeleteRecord, and is assigned when that
// button is created, in the getEdits function above
mcDeleteConfirm.yes.onRelease = function() {
// hide the confirmation window
this._parent._visible = false;
// disable the buttons in it so they don't interfere with the main movie
mcDeleteConfirm.yes.enabled = false;
mcDeleteConfirm.no.enabled = false;
// do the delete: clear all previous properties of lvAddressData
for (var i in equipment) {
delete equipment[i];
}
// say what to do when the delete is accomplished
equipment.onLoad = function() {
dtfMsg.text = this.msg;
btnSaveChanges._visible = false;
btnDeleteRecord._visible = false;
mcFields._visible = false;
// refresh display
dataLoad(false);
}
// and call the php routine to delete record for specified contactID
equipment.Id = Number(mcFields.dtfId.text);
equipment.sendAndLoad("deleteContact.php", equipment, "POST");
};
mcDeleteConfirm.no.onRelease = function() {
msg.text = "No record was deleted";
this._parent._visible = false;
mcDeleteConfirm.yes.enabled = false;
mcDeleteConfirm.no.enabled = false;
};
/**************** Program execution starts: START UP MESSAGE *********************/
mcDeleteConfirm._visible = false;
mcFields._visible = false;
dtfMsg.text = "Choose a record to edit/delete by clicking on it, or choose a different filter to show a subset of the data";
_global.gaFields = [
{editable: true, name: "Id", type:"t"},
{editable: true, name: "Make", type:"t"},
{editable: true, name: "Model", type:"t"},
{editable: true, name: "Serial", type:"t"}
];
_global.gsFilter = "";
// set this style on all components in movie
globalStyleFormat.textFont = "Verdana";
globalStyleFormat.textSize = 11;
globalStyleFormat.applyChanges();
// apply a monospace font to the listbox for an attempt at controlling column spacing
var monospaceStyle = new FStyleFormat( {textFont:"Courier",
textSize:9} );
monospaceStyle.addListener(lbxIdDisplay);
// format for pushbuttons only
// add listener to this when each pushbutton is attached
var centerFontStyle = new FStyleFormat( {textAlign:"center"} );
//sFileLoc = "http://localhost/dbedit/";
sFileLoc = "root@localhost";
lbxIdDisplay.setRowCount(20);
lbxIdDisplay.setWidth(480); // note: setSize would wipe out setRowCount
equipment = new LoadVars();
cboFilter.tabEnabled = false;
// default filter = all records
cboFilter.setSelectedIndex(3);
btnAddRecord.tabEnabled = false;
// set up tab order of fields in data editing section
// all other buttons and components on stage are tab-disabled
for (var i=0; i<gaFields.length; i++) {
mcFields["dtf" + gaFields[i].name].tabEnabled = true;
mcFields["dtf" + gaFields[i].name].tabIndex = i;
}
The problem I have is that the data is sent to the listbox just fine, but I'm using mx Pro and the tut is mx only. The listbox are different and when I use mine it shows the data but once the data is clicked in the listbox it will not execute the getedit command. Any ideas whats wrong ?
Listbox Help
I have my listbox set up in a movieclip that when you click on a button dynamically puts it on stage [I set the linkage identifier for that]. The delete works for you, but it's not working for me...I tried _root., shoppingBag_mc., and nothing, with the ".removeItemAt(shoppingBag_lb.selectedIndex);" line after all of them. None of them worked, I am not sure why. Can you help me on that?
Also on my main movie, when you drag the yellow shape to the shopping bag (this puts it in the shoppingBag array), the shopping bag is supposed to shake, look at the script even. It does not, can someone help me with this also?
I don't know why I can't upload anything in zip format, every time I try it says document contains no data, anyways I uploaded it to my server, click to download.HERE
Thanks!!
Xml - Listbox
here's a doohicky of a question.
How do you take a .xml file, and read the contents. Then display say just the first level of child nodes in a list box or something?
Like Several Others- Listbox
I'm completely newborn babe to flash, and i have been trying to teach myself through various tutorials.
One feature I'm trying to add to a site I'm (trying) to make is a listbox. I followed the tutorial to get the general idea, however I want to change it (like many others who post their questions on here).
I admit I have difficulty learning from just reading and get confused easily, so if someone could help me out with very clear and simple steps like a walkthrough, it would be VERY much appreciated. Even if someone has to walk me through via IM, i don't care, i just really need help. It's an important website for someone I know.
I would like my listbox to contain dates, and when the person clicks the date, the time and place appears in the textbox. At the same time I would like it to be skinned to match the rest of my site (and other components like a form, which i have not yet created either haha).
Also, to make it for easier updating, is it possible to have the list of dates linked to a txt file so all i have to do is add some new dates to that file so it appears in the listbox?
Thank you SOOOO MUCH to anyone who can help me.
XML In Listbox?
okay i have an xml file set up like this.
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Artists>
<Artist>
<aname group="Jack Johnson" g_url="swf/content.swf" />
<image>images/1.jpg</image>
<desc>This is a description of the musician you have clicked on. What you are about to do is notice how great this person is.</desc>
<alink>http://www.versusmediagroup.com</alink>
</Artist>
<Artist>
<aname group="Brand New" g_url="swf/content.swf" />
<image>images/2.jpg</image>
<desc>This is the SECOND PERSON</desc>
</Artists>
and my action script set up like this
Code:
var vlist:XML = new XML();
vlist.ignoreWhite = true;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for (i=0; i<videos.length; i++) {
list.addItem(videos[i].attributes.group, videos[i].attributes.g_url);
}
};
vlist.load("artists.xml");
'list' is the instance name i gave the ListBox Component. But when i test it the list box says Undefined, Undefined?
If anyone knows how to fix this please let me know!
Thanks
ListBox To ListBox From XML...
I'm trying to get this right and I can't figure it out. How can I load XML into a listBox Component without loading each of my subcategories? Here's what I'm trying to do...
For example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<articles>
<cat url="http://www.msn.com" desc="Flash Forward SF" />
<subcat url="http://www.msn.com" desc="Flash Forward Sub" />
<cat url="http://www.msn.com" desc="Flash Forward SF" />
<subcat url="http://www.msn.com" desc="Flash Forward Sub" />
<cat url="http://www.msn.com" desc="Flash Forward SF" />
<subcat url="http://www.msn.com" desc="Flash Forward Sub" />
</articles>
I want to load the main "cat" into one listBox and when you click on one of that main "cat" it loads the corresponding "subcat" into a second listBox. Instead, the main "cat" and the "subcat"s are all being loaded into the first listBox. Make sense?
Here's my actionscript:
Code:
var alist:XML = new XML();
alist.ignoreWhite = true;
alist.onLoad = function() {
var articles:Array = this.firstChild.childNodes;
for(i=0;i<articles.length;i++) {
articleList.addItem(articles[i].attributes.desc,articles[i].attributes.url);
}
ns.play(articleList.getItemAt(0).data);
articleList.selectedIndex = 0;
}
var artList:Object = new Object();
artList.change = function() {
ns.play(articleList.getItemAt(articleList.selectedIndex).data);
}
articleList.addEventListener("change",artList);
alist.load("videos.xml");
articleList.setStyle("selectionColor",0xCCCCCC);
articleList.setStyle("textSelectedColor",0x000000);
articleList.setStyle("rollOverColor",0xCCCCCC);
Any help would be greatly appreciated.
Listbox Help
Hi. I want to make a music player, when you select a label, a music starts to play. But i need to do this by a dynamic text variable, because the player and the list is in different movieclips. Erm... Can someone give me an example script of when i click the label, the text changes, and for the player, check if the text is something.
I'm pretty confused. Help? Ty.
(P.S.: I've tried searching but i couldnt find the exact code i need.)
Listbox Help
I've got a box (instance named "list") that loads some external stuff into it. There's two things I'd like it to do, but can't figure out:
1) I'd like it to remember which item was selected, so if I navigate away from the frame and come back, it will still have the selected item highlighted.
2) If nothing has been selected yet, I'd like it to automatically highlight the first item. I'm doing a program that's controlled by arrow keys, not a mouse, so it'd be nice if users didn't have to tab into the box to start selecting.
Any ideas?
ListBox
Hi, all!
is it possible to put images into Listbox? if so, could someone explain it? or any resource that I can find! Thanks!!!!
Listbox
Quote:
function padr(s, n, c) {
var nLen = s.length;
for (var i=nLen; i < n; i++) {
s += c;
}
return s;
}
function dataLoad(isAdd) {
var sLabel, i;
equipment.onLoad = function() {
lbxIdDisplay.removeAll();
for (i=0; i<this.n; i++) {
sLabel = padr(this["Id"+i] + ", " + this["Make"+i], 25, " ");
sLabel += " " + padr(this["Model"+i], 13, " ") + " " + this["Serial"+i];
lbxIdDisplay.addItem(
sLabel,
{Id:this["Id"+i],
Make:this["Make"+i],
Model:this["Model"+i],
Serial:this["Serial"+i]
}
);
}
if (!isAdd) {
dtfMsg.text = this.n + " Records are loaded. Click any record to view, edit or delete it, or click the Add Record button to add a new one.";
} else {
dtfMsg.text = "Record has been added. Enter a new record and click Save to save it, or click any record to view, edit or delete it.";
}
for (i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = '';
}
}
equipment.tab = "Heavy";
equipment.cond = gsFilter;
//trace("condition = " + lvAddressData.cond);
equipment.sendAndLoad(sFileLoc + "getTableData.php", equipment, "POST");
//lvAddressData.send(sFileLoc + "getTableData.php", "newwin", "POST");
}
function checkFilter(compPassed) {
gsFilter = compPassed.getSelectedItem().data;
dtfMsg.text = "Loading records for " + compPassed.getSelectedItem().label;
displayed for
for (var i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = '';
}
btnSaveChanges._visible = false;
btnDeleteRecord._visible = false;
dataLoad(false);
}
cboFilter.setChangeHandler("checkFilter", this);
function getEdits(compPassed){
mcFields._visible = true;
if (btnAddThisRecord != undefined) {
btnAddThisRecord._visible = false;
}
if (btnSaveChanges == undefined) {
this.attachMovie("FPushButtonSymbol", "btnSaveChanges", 2, {_x: 382, _y: 174});
centerFontStyle.addListener(btnSaveChanges);
btnSaveChanges.setLabel("Save Changes");
btnSaveChanges.tabEnabled = false;
btnSaveChanges.setClickHandler("updateRecord", this);
} else {
btnSaveChanges._visible = true;
}
// make Delete Record button if first time called
if (btnDeleteRecord == undefined) {
this.attachMovie("FPushButtonSymbol", "btnDeleteRecord", 3, {_x: 382, _y: 204});
centerFontStyle.addListener(btnDeleteRecord);
btnDeleteRecord.setLabel("Delete Record");
btnDeleteRecord.tabEnabled = false;
btnDeleteRecord.setClickHandler("deleteRecord", this);
} else {
btnDeleteRecord._visible = true;
}
dtfMsg.text = "Make changes to any fields in the edit boxes and click Save Changes, or click Delete Record to delete this record from the database";
var record = compPassed.getSelectedItem();
for (var i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = record.data[gaFields[i].name];
}
}
lbxIdDisplay.setChangeHandler("getEdits", this);
// function to SHOW BLANK FIELDS for data entry when Add Record is clicked
function addRecord(g) {
btnDeleteRecord._visible = false;
btnSaveChanges._visible = false;
mcFields._visible = true;
for (var i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = '';
}
if (btnAddThisRecord == undefined) {
this.attachMovie("FPushButtonSymbol", "btnAddThisRecord", 1, {_x: 382, _y: 174});
centerFontStyle.addListener(btnAddThisRecord);
btnAddThisRecord.setLabel("Save");
btnAddThisRecord.tabEnabled = false;
btnAddThisRecord.setClickHandler("addThisRecord", this);
}
btnAddThisRecord._visible = true;
// start focus on first field in form
Selection.setFocus("mcFields.dtfId");
dtfMsg.text = "Enter data for the new record in the edit boxes and click Save to add it to the database";
}
btnAddRecord.setClickHandler("addRecord", this);
// function to SAVE RECORD to database when btnAddThisRecord is clicked
function addThisRecord() {
for (var i in equipment) {
delete equipment[i];
}
equipment.onLoad = function() {
// msg will indicate status of insert
dtfMsg.text = this.msg;
// update display
dataLoad(true);
// keep Save button displayed in case user wants to enter multiple records
//btnAddThisRecord._visible = false;
}
for (var i in gaFields) {
if (gaFields[i].type == "n") {
equipment[gaFields[i].name] = Number(mcFields["dtf" + gaFields[i].name].text);
} else {
equipment[gaFields[i].name] = escape(mcFields["dtf" + gaFields[i].name].text);
}
}
equipment.sendAndLoad(sFileLoc + "insertContact.php", equipment, "POST");
//lvAddressData.send(sFileLoc + "insertContact.php", "newwin", "POST");
}
// addThisRecord is an event handler for btnAddThisRecord, and is assigned when that
// button is created, in the addRecord function above
// function to UPDATE A RECORD when Save Changes button is clicked
function updateRecord() {
var i;
for (i in equipment) {
delete equipment[i];
}
equipment.onLoad = function() {
msg.text = this.msg;
// update display if successful
if (this.success) {
dataLoad(false);
}
btnSaveChanges._visible = false;
btnDeleteRecord._visible = false;
}
for (i in gaFields) {
if (gaFields[i].type == "n") {
equipment[gaFields[i].name] = Number(mcFields["dtf" + gaFields[i].name].text);
} else {
equipment[gaFields[i].name] = escape(mcFields["dtf" + gaFields[i].name].text);
}
}
equipment.tab = 'Heavy';
equipment.cond = 'Id=' + Number(mcFields.dtfId.text);
equipment.sendAndLoad("updateContacts.php", equipment, "POST");
//lvAddressData.send("updateContacts.php", "newwin", "POST");
}
// updateRecord is an event handler for btnSaveChanges, and is assigned when that
// button is created, in the getEdits function above
// functions for DELETING A RECORD (confirmation, etc)
function deleteRecord() {
//msg.text = "Delete Record clicked " + deleteConfirm._name;
mcDeleteConfirm._visible = true;
mcDeleteConfirm.yes.enabled = true;
mcDeleteConfirm.no.enabled = true;
mcDeleteConfirm.msg.text = "Are you sure you want to delete the record for " + mcFields.dtfId.text + " " + mcFields.dtfId.text + " ? ";
}
// deleteRecord is an event handler for btnDeleteRecord, and is assigned when that
// button is created, in the getEdits function above
mcDeleteConfirm.yes.onRelease = function() {
// hide the confirmation window
this._parent._visible = false;
// disable the buttons in it so they don't interfere with the main movie
mcDeleteConfirm.yes.enabled = false;
mcDeleteConfirm.no.enabled = false;
// do the delete: clear all previous properties of lvAddressData
for (var i in equipment) {
delete equipment[i];
}
// say what to do when the delete is accomplished
equipment.onLoad = function() {
dtfMsg.text = this.msg;
btnSaveChanges._visible = false;
btnDeleteRecord._visible = false;
mcFields._visible = false;
// refresh display
dataLoad(false);
}
// and call the php routine to delete record for specified contactID
equipment.Id = Number(mcFields.dtfId.text);
equipment.sendAndLoad("deleteContact.php", equipment, "POST");
};
mcDeleteConfirm.no.onRelease = function() {
msg.text = "No record was deleted";
this._parent._visible = false;
mcDeleteConfirm.yes.enabled = false;
mcDeleteConfirm.no.enabled = false;
};
/**************** Program execution starts: START UP MESSAGE *********************/
mcDeleteConfirm._visible = false;
mcFields._visible = false;
dtfMsg.text = "Choose a record to edit/delete by clicking on it, or choose a different filter to show a subset of the data";
_global.gaFields = [
{editable: true, name: "Id", type:"t"},
{editable: true, name: "Make", type:"t"},
{editable: true, name: "Model", type:"t"},
{editable: true, name: "Serial", type:"t"}
];
_global.gsFilter = "";
// set this style on all components in movie
globalStyleFormat.textFont = "Verdana";
globalStyleFormat.textSize = 11;
globalStyleFormat.applyChanges();
// apply a monospace font to the listbox for an attempt at controlling column spacing
var monospaceStyle = new FStyleFormat( {textFont:"Courier",
textSize:9} );
monospaceStyle.addListener(lbxIdDisplay);
// format for pushbuttons only
// add listener to this when each pushbutton is attached
var centerFontStyle = new FStyleFormat( {textAlign:"center"} );
//sFileLoc = "http://localhost/dbedit/";
sFileLoc = "root@localhost";
lbxIdDisplay.setRowCount(20);
lbxIdDisplay.setWidth(480); // note: setSize would wipe out setRowCount
equipment = new LoadVars();
cboFilter.tabEnabled = false;
// default filter = all records
cboFilter.setSelectedIndex(3);
btnAddRecord.tabEnabled = false;
// set up tab order of fields in data editing section
// all other buttons and components on stage are tab-disabled
for (var i=0; i<gaFields.length; i++) {
mcFields["dtf" + gaFields[i].name].tabEnabled = true;
mcFields["dtf" + gaFields[i].name].tabIndex = i;
}
The problem I have is that the data is sent to the listbox just fine, but I'm using mx Pro and the tut is mx only. The listbox are different and when I use mine it shows the data but once the data is clicked in the listbox it will not execute the getedit command. Any ideas whats wrong ?
Listbox Help
I have my listbox set up in a movieclip that when you click on a button dynamically puts it on stage [I set the linkage identifier for that]. The delete works for you, but it's not working for me...I tried _root., shoppingBag_mc., and nothing, with the ".removeItemAt(shoppingBag_lb.selectedIndex);" line after all of them. None of them worked, I am not sure why. Can you help me on that?
Also on my main movie, when you drag the yellow shape to the shopping bag (this puts it in the shoppingBag array), the shopping bag is supposed to shake, look at the script even. It does not, can someone help me with this also?
I don't know why I can't upload anything in zip format, every time I try it says document contains no data, anyways I uploaded it to my server, click to download.HERE
Thanks!!
Listbox HELP
Hi, i am newbie to Flash MX. I have learn listbox tutorial. Very interesting to learn. But it only shown the date. I want to know how to show many items such as name, email address and tel number when user select from listbox.
How to do that? Is there any link that similar that i want?
Xml - Listbox
here's a doohicky of a question.
How do you take a .xml file, and read the contents. Then display say just the first level of child nodes in a list box or something?
Listbox
Hi All,
I would like to copy an effect I saw on a site where the style of the listbox changes on mouse over.
Anybody know how to do this ?
T.I.A.
PHP To Listbox
Last edited by Nutrox : 2008-02-08 at 07:24.
Hey..
got this PHP code that searches for ".jpg"´s in the "root-folder" and then I parse the list in flash and then take the information and put it into a List.
PHP Code:
if ($handle = opendir('.') )
{
echo "filelist=";
while (false !== ($file = readdir($handle)))
{
$ext = substr(strrchr($file, "."), 1);
if ($file != "." && $file != ".." && $ext == "jpg")
{
echo "$file";
echo ",";
}
}
closedir($handle);
echo "null";
}
the AS:
ActionScript Code:
var listBox:mx.controls.List;
files = new Array();
lv = new LoadVars();
lv.onLoad = function()
{
fl = this.filelist;
files = fl.split(",");
c = files.length-1;
for (i=0; i<c; i++)
{
listBox.addItem(files[i]);
}
}
lv.load("files.php");
it all works like a charm when tested locally.. but when I upload this to the server the ListBox stays EMPTY...?
(there is nothing wrong with the PHP-settings on my server.. )
What can be causing this?
ListBox
Hi All,
I have edited a List box component in Flash Mx 2004 Pro, and I need to make the background of the component, so that I could place the list on my own design.
Could anyone help me out!!
Thanks in Advance!!
Loading A Swf From Listbox
hi,
i have a listbox i'd like after ,push a button ,for eatch elementi in listbox i can play a swf...
how i can do???
bye!
p.s. i'm an italian boy, i don't know english very well!
ListBox, What Is Returned...
I have a simple question. I am trying to use the ListBox component to control a couple of users. I have the ListBox inside of a MovieClip with the following script on it:
onClipEvent (mouseUp) {
_level0.Selected_User = Tree_Users.getValue();
_level0.Selected_User_Name = Tree_Users.getSelectedItem().label
}
I then have a few buttons under it that are supposed to check to see if anything got selected(You can deselect a user by Control+Clicking on them. The buttons have the following script:
on (release) {
if (_level0.Selected_User == "") {
Select_A_User._visible = true;
} else {
gotoAndStop(5);
}
}
Apparently Selected_User isn't getting set to "" when nothing is selected. Does anyone know what it does get set to or another way that I can grab the values.
Add Labels To Listbox
can someone help me with dynamically adding labels to the listbox companents??
thanks for the help
riyan
ListBox Flash MX
i would like to create a menu with the list box feature for it provides me with a scroll and everything elce without me having to design a menu. The problem is that i carnt find out in the help files how to simply turn the items in the list into buttons to other pages in my flash movie. A simple thing im sure but im missing the bigger picture. Help in this matter would be cool, thanks for any suggestions, leo.
Scripted Listbox
I'm trying to create a listbox that will add and remove items by script and not by user interface).
Has anyone seen, developed, or know of a working sample?
The basic premis is to constantly list the active users on the site, and create a messaging system. I'm a wiz at the server back-end, but a back-end at the flash front-end (if you know what i mean, wink, wink).
Any help appreciated.
Listbox And Images
Hi. Is there a way to have an "example image".For instance, i want to have a list of people in a listbox and when a person is selected their picture appears, and when i select a different person, the picture changes to that person's picture. any ideas?
ListBox Problem
I have a list box that works fine. However, I want to trap the Delete key and process the removeSelectedItem method. My problem is that if I put the code:
on(keyPress "<Delete>"){
trace('Do delete code here');
}
In my .as then the click functionality quits working, i.e. when you click on an item it does not get selected.
Does anyone know how to accomplish what I'm trying to do?
Thanks for any help,
CFDaddy
Listbox Selection
hi,
I am using MX to create a front end for a database. I populate a listbox with title of some books. Then, when the user select a particular title from this listbox, I would like to display the details of the book at other fields. Can I do this without using a button?
Thanks in advance.
Joe
Listbox Component?
I have a listbox on the stage named "lst_amenities". I'm tring to trace out an array of selected items from a multiple selection listBox. Problem is that i am getting an output of [objectObject] throughout the array. Below is the code that i used. Anyone have any ideas?
Code:
lst_amenities.setChangeHandler("select_amenities");
ary_amenities = ["string 1", "string 2", "string 3", "string 4"];
create_amenities(ary_amenities);
function create_amenities(ary) {
for (i=0; i<ary.length; i++) {
lst_amenities.addItem(ary[i]);
}
lst_amenities.setSelectMultiple(true);
lst_amenities.sortItemsBy("label", "ASC");
}
function select_amenities() {
ary_amenities = lst_amenities.getSelectedItems();
trace(ary_amenities);
}
ListBox And MovieClips
hello everyone!
i am wondering if it is possible to have a listbox that is able to load different movieclips according to the user's selection?
basically, what i would like to achieve is having the ability to load an external movieclip into the main movie when the user make a selection from the available items in the listbox.
thanks for your help!
|