Copy link to clipboard
Copied
warm greetings from Indonesia
can I learn Adobe Animate 2019 easily, I'm just using it for the first time. and I find it difficult to find information on the use of scripts, which in my opinion is a high level. for example, it shows a comma (,) truncated string. for combobox components in adobe animate. Example of the string that I have defined in the variable:
var strPropertycombobox = "a, b";
After I select one of the strings in the combobox component, it is used as a reference to display the strings that are truncated based on comma (,). for the listbox component in adobe animate, like this the logic
if a =
var strPropertylistboxa = "10, 20";
returns a comma (,) truncated string. for listbox components in adobe animate
example
listbox
10
20
if b =
var strPropertylistboxb = "100, 200";
returns a comma (,) truncated string. for listbox components in adobe animate
example
listbox
100
200
and every line of string that is in the listbox after being cut into a line. when I hover the mouse over the value in the listbox, for example, my mouse points to string 10 then it displays shapes1 / particular image.
I am using Adobe Animate 2019 for the first time, if creating a web database is not the first time for me and I already understand a little about using css, html, java, json. but in adobe animate I am confused to set the layout of it all, I play on the html 5 canvas.
I ask for help, is there a simple example, or can you make a simple example. Thank you.
Copy link to clipboard
Copied
canvas or as3?
do you have a question about the combobox or list component (or both)? or do you mean something else (other than list component) by "listbox"
Copy link to clipboard
Copied
both, combo box and listbox
logic
if I select a word in the combobox, the listbox displays the results of the string filled in from the variable, based on the string in the combobox.
canvas html 5
Copy link to clipboard
Copied
what's a listbox?
Copy link to clipboard
Copied
listbox, sorry I typed it wrong. The list should be for adobe animate 2019 components.
Copy link to clipboard
Copied
is the following correct,
your combobox displays, for example:
a,b
10,20
100,200
and when you pick one (eg, 100,200) you want your list to display
100
200
Copy link to clipboard
Copied
contents inside combobox = ["a, b"];
if choose "a" in combobox then {
list = ["10,20"];
}
else if you choose "b" in the combobox then {
list = ["100,200"];
}
Copy link to clipboard
Copied
i couldn't see any way to use the adobe list component (and it doesn't do anything useful). it's easier to create and control your own:
// create dataObj to associate cb selection to list display
this.dataObj = {"a":[10,20], "b":[100,200]};
// create list object passing "ol" or "ul" or ordered or unordered list
this.list0 = createF.bind(this)("ol");
// combobox change snippet
if(!this.cb_change_cbk) {
function cb_change(evt) {
// populate list
populateF.bind(this)(this.list0,this.dataObj[evt.target.value]);
}
$("#dom_overlay_container").on("change", "#cb", cb_change.bind(this));
this.cb_change_cbk = true;
}
function createF(s){
var list = document.createElement('list');
document.getElementById("dom_overlay_container").appendChild(list);
this[s] = document.createElement(s);
list.appendChild(this[s]);
list.setAttribute("list_type",s);
return list;
}
function populateF(list, array) {
// if you want to clear list before appending new values:
//clearF.bind(this)(list);
for (var i = 0; i < array.length; i++) {
var li = document.createElement('li');
li.innerHTML = array[i];
this[list.getAttribute("list_type")].append(li);
}
}
function clearF(list){
while (list.firstChild.firstChild) {
list.firstChild.removeChild(list.firstChild.firstChild);
}
}