Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : I need a Action Script for List Box


Nosferatus
5/14/2004 7:13:03 PM


When i select a item of the list box, a movie clip begin. (play)., So, when i choose another element of the list box, the movie clip stop and begins a new one.
Nosferatus
5/15/2004 11:42:38 PM
here is an example of mi possible script

this.onEnterframe function() {
getSelectedItem().gotoAndPlay();
}

but it dsnt seems to work, so can any one helpme at least whit an idea

Jack.
5/16/2004 12:52:22 AM
are you loading movies to a movieclip ?
with a clip instance - TestMC
and a listbox instance - listbox1
add a frame action,

id = [];
id[0] = {label:"A", data:"a1"};
id[1] = {label:"B", data:"b1"};
id[2] = {label:"C", data:"c1"};
id[3] = {label:"D", data:"d1"};

listbox1.setDataProvider(id);
listbox1.setChangeHandler("handle");

function handle(comp){
fData = comp.getSelectedItem().data;
trace(fData);
TestMC.loadMovie(fData+".swf");
};
AddThis Social Bookmark Button