PDA

View Full Version : Is it possible to do such an action ? :o)


el5ateer
08-29-2005, 04:38 PM
Hi again experts :cool ,

Now I am confused and I wanna know what to do in such case..

When I use this action (in a combo box ofcourse) : selected = ComboBox.GetSelected("Plugin1");

it's known that [selected] by then is equal to one or two .. etc. // I want to insert the number of the "selected" let's say "one" to load an audio which is named [1.ogg] in the background .. I use this action :

Audio.Load(CHANNEL_BACKGROUND, "AutoPlay\\Audio\\"..selected..".ogg", true, false);

so am I right which is probably a non-sense question coz it does not work :D
Or is there something wrong which I should fix it or I am goin on the wrong way ?

el5ateer
08-31-2005, 02:25 PM
Is it hard or it's my fault I did not explain clearly what I want ?? :rolleyes

TJ_Tigger
08-31-2005, 02:35 PM
Does it actually return a value or does it return -1 for an error?

It looks like it should work. I will try to play with it later tonight.

TJ_Tigger
08-31-2005, 02:38 PM
Remember also that the combobox has both a text field and a data field. you can store the filename in the data and use that to when you load the audio.

Tigg


edit this worked


nSel = ComboBox.GetSelected(this);
if nSel ~= -1 then
Audio.Load(CHANNEL_BACKGROUND, "AutoPlay\\Audio\\"..nSel..".ogg", true, false);
end

Worm
08-31-2005, 02:38 PM
It looks right, are you sure you have a 1.ogg in the Audio folder?

[Tigs hoppin' around fast these days!]

TJ_Tigger
08-31-2005, 02:44 PM
It looks right, are you sure you have a 1.ogg in the Audio folder?

[Tigs hoppin' around fast these days!]

Depends on where I am and what I am doing. Lately I have had time in the home office and this week while I am on the road I am in training and I check the board at lunch and on breaks.

:)

el5ateer
08-31-2005, 04:10 PM
thnx a lot :yes it worked .. Man , I like this forum :lol