PDA

View Full Version : Using ListBox to control timeline ???


GeckOblue
06-16-2004, 12:31 PM
Hello!
Nice Fourm!

Here is my dilema:
I am trying to use a listbox component to take the user to different frames of the timeline.

For example:
The UI Component ListBox, has in it the labels, 'story 1', 'story 2', and 'story 3'. In the main scene that contains this component, there is the text of story 1 on frame 1, the text of story 2 on frame 2, and so on. The ListBox itself doesnt need to retrieve from any external source information, the text is already on the scene on different frames. All I want the buttons on the listbox to do is take the user to the different frames (corresponding with the name of the label/button).

This seems simple enough, but so far there doesnt seem to be any way to add actions to the individual rows/labels/buttons in the ListBox component. Under behaviors I was able to add on (change) {

//Movieclip GotoAndPlay Behavior
this._parent._parent.gotoAndPlay("2");
//End Behavior


but of course this applies to the whole component not to an individual button in the listbox component, so that when I click on 'story 5', it will still go to frame 2...

you get the idea.

SO how do i point the individual buttons in the component to go to and play different frames? (ListBox button: 'story 7' to go to frame 7, etc.)
I know I must seem dumb, its probably very simple...
but please give me a hand here.
Thanx,
GeckOblue

GeckOblue
06-16-2004, 06:57 PM
:rolleyes:
thanx for the help...
got the nfo at flashkit.com and #flash on undernet (irc)

getpaid2share
12-10-2004, 01:16 AM
:rolleyes:
thanx for the help...
got the nfo at flashkit.com and #flash on undernet (irc)

You got the answer where? ... Probably a fat chance that you will come back and clarify where you got the answer to this question, I'm looking for the Same answer. flashkit.com and "#flash????" on undernet (irc) ????

Could you write that in english for those of us who arent as intelligent :D
Or if anyone else Does know the answer to this question, Could you be so kind as to share it, not just for me, but for all of those who like Geckoblue and myself, would love to know.

annexion
12-10-2004, 02:54 AM
listBox.dataProvider=[{label:"Story 1",data:"s1"},{label:"Story 2",data:"s2"},{label:"Story 3",data:"s3"}];

var lbListener={};
lbListener.change=function(evt){
timeLineReference.gotoAndStop(evt.target.selectedI tem.data);
}
listBox.addEventListener("change",lbListener);

getpaid2share
12-10-2004, 05:09 AM
listBox.dataProvider=[{label:"Story 1",data:"s1"},{label:"Story 2",data:"s2"},{label:"Story 3",data:"s3"}];

var lbListener={};
lbListener.change=function(evt){
timeLineReference.gotoAndStop(evt.target.selectedI tem.data);
}
listBox.addEventListener("change",lbListener);


Thanks annexion ....

That didnt exactly work out for me. Let's see if I can try explaining things a lil better.

I have the following instances in my movie.

A listBox = productList_lb
A Product MovieClip = products_mc

Inside of the products_mc I have 4 frames with frame lables to help with navigation : 1 = blank 2 = coffee 3 = tea 4 = candles.

In my productList_lb, I have 4 Labels. Labels that I filled manually in the component inspector. Those labels are: 0= Welcome 1 = Coffee, etc..

naturaually what I want to do, is script it so that clicking on Coffee, will perform this action ->> _root.products_mc.gotoAndStop("coffee")

Now, I tried your suggestion annx, and First, the "dataProvider" simply filled my listbox with Welcome from top to bottom.

So I deleted that line, and re-filled my labels out mannually... and then the rest of the code, still didnt do anything.

The "blank" frame has a page that says "Start Shopping" .. it's tied to the Welcome label in my listbox.

So far, with everything I've tried, nothing moves my movie off that "blank" frame.

Maybe I should try sending the .fla to someone?? ...

I hope someone is able to help answer this question.

There is always a solution to every problem.