my google apps script doesn't run, no parameters with serverhandler - google-apps-script

I try to change a sheets with a script but it doesn't work as expected. I can load the right panel, but nothing happens when I try to record the change. It seems "masterFunctionPS" isn't called.
The function periodSelection post the panel, the listbox and the button. But nothing append, when I clic on the Button. Nothing change in the sheets.
function periodSelection() {
var activeSS = SpreadsheetApp.getActiveSpreadsheet();
var sheetPS = activeSS.getSheetByName("Periods");
var uiPS = UiApp.createApplication().setWidth(300);
var panelPS = uiPS.createVerticalPanel();
var periodPS = uiPS.createListBox();
for (var i = 2; i < 13; i++) {
var range = "A" + i;
periodPS.addItem(sheetPS.getRange(range).getValue());
}
var endDatePS = uiPS.createDatePicker();
var recordPS = uiPS.createButton("Enregistrer");
var masterPS = uiPS.createServerHandler('masterFunctionPS');
masterPS.addCallbackElement(periodPS)
.addCallbackElement(endDatePS)
recordPS.addClickHandler(masterPS);
panelPS.add(periodPS);
panelPS.add(endDatePS);
panelPS.add(recordPS);
uiPS.add(panelPS);
SpreadsheetApp.getUi().showSidebar(uiPS);
return uiPS;
}
function masterFunctionPS(element) {
var parameterPS = element.parameter;
var appE = UiApp.getActiveApplication();
var periodE = parameterPS.periodPS;
var endDateE = parameterPS.endDatePS;
var activeE = parameterPS.activeSS;
var sheetE = parameterPS.sheetPS;
switch (periodE) {
case "P1":
sheetE.getRange("C2").setValue(endDateE);
break;
case "P2":
sheetE.getRange("C3").setValue(endDateE);
break;
case "P3":
sheetE.getRange("C4").setValue(endDateE);
break;
case "P4":
sheetE.getRange("C5").setValue(endDateE);
break;
case "P5":
sheetE.getRange("C6").setValue(endDateE);
break;
case "P6":
sheetE.getRange("C7").setValue(endDateE);
break;
case "P7":
sheetE.getRange("C8").setValue(endDateE);
break;
case "P8":
sheetE.getRange("C9").setValue(endDateE);
break;
case "P9":
sheetE.getRange("C10").setValue(endDateE);
break;
case "10":
sheetE.getRange("C11").setValue(endDateE);
break;
case "P11":
sheetE.getRange("C12").setValue(endDateE);
break;
}
return (appE);
}

There are a few errors in your code...mainly you forgot to give names to your widgets and name is used to retrieve values from the callbackelements
below is a "rectified" version that works but there are still 2 items that won't work because you tried to get properties of the sheet in the Ui and that can't be done like this...
please explain what for you need that and I could suggest a better way to go.
(see comments in code and look at the logger to see the values in event parameters)
function periodSelection() {
var activeSS = SpreadsheetApp.getActiveSpreadsheet();
var sheetPS = activeSS.getActiveSheet();
var uiPS = UiApp.createApplication();
var panelPS = uiPS.createVerticalPanel();
var periodPS = uiPS.createListBox().setName('periodPS');
for (var i = 2; i < 13; i++) {
var range = "A" + i;
periodPS.addItem(sheetPS.getRange(range).getValue());
}
var endDatePS = uiPS.createDatePicker().setName('endDatePS');
var recordPS = uiPS.createButton("Enregistrer");
var masterPS = uiPS.createServerHandler('masterFunctionPS');
masterPS.addCallbackElement(panelPS);
recordPS.addClickHandler(masterPS);
panelPS.add(periodPS);
panelPS.add(endDatePS);
panelPS.add(recordPS);
uiPS.add(panelPS);
SpreadsheetApp.getUi().showSidebar(uiPS);
}
function masterFunctionPS(element) {
var parameterPS = element.parameter;
var appE = UiApp.getActiveApplication();
Logger.log('parameter : '+JSON.stringify(parameterPS));
var periodE = parameterPS.periodPS;
var endDateE = parameterPS.endDatePS;
var activeE = parameterPS.activeSS; // won't work
var sheetE = parameterPS.sheetPS; // won't work
switch (periodE) {
case "P1":
sheetE.getRange("C2").setValue(endDateE);
break;
case "P2":
sheetE.getRange("C3").setValue(endDateE);
break;
case "P3":
sheetE.getRange("C4").setValue(endDateE);
break;
case "P4":
sheetE.getRange("C5").setValue(endDateE);
break;
case "P5":
sheetE.getRange("C6").setValue(endDateE);
break;
case "P6":
sheetE.getRange("C7").setValue(endDateE);
break;
case "P7":
sheetE.getRange("C8").setValue(endDateE);
break;
case "P8":
sheetE.getRange("C9").setValue(endDateE);
break;
case "P9":
sheetE.getRange("C10").setValue(endDateE);
break;
case "10":
sheetE.getRange("C11").setValue(endDateE);
break;
case "P11":
sheetE.getRange("C12").setValue(endDateE);
break;
}
return appE;
}
EDIT :
I think I guess what you are trying to do...
Actually the active SS and sheet are always the same, you can just reuse it the same way ...(personally I would keep the same names all along...) see updated handler function below :
function masterFunctionPS(element) {
var parameterPS = element.parameter;
var appE = UiApp.getActiveApplication();
Logger.log('parameter : '+JSON.stringify(parameterPS));
var periodE = parameterPS.periodPS;
var endDateE = parameterPS.endDatePS;
// var activeE = parameterPS.activeSS; // won't work
// var sheetE = parameterPS.sheetPS; // won't work
var activeE = SpreadsheetApp.getActiveSpreadsheet();
var sheetE = activeE.getActiveSheet();
switch (periodE) {
case "P1":
sheetE.getRange("C2").setValue(endDateE);
break;
case "P2":
sheetE.getRange("C3").setValue(endDateE);
break;
case "P3":
sheetE.getRange("C4").setValue(endDateE);
break;
case "P4":
sheetE.getRange("C5").setValue(endDateE);
break;
case "P5":
sheetE.getRange("C6").setValue(endDateE);
break;
case "P6":
sheetE.getRange("C7").setValue(endDateE);
break;
case "P7":
sheetE.getRange("C8").setValue(endDateE);
break;
case "P8":
sheetE.getRange("C9").setValue(endDateE);
break;
case "P9":
sheetE.getRange("C10").setValue(endDateE);
break;
case "10":
sheetE.getRange("C11").setValue(endDateE);
break;
case "P11":
sheetE.getRange("C12").setValue(endDateE);
break;
}
// the following line is only for test... remove it when it works!!!
sheetE.getRange("A1").setValue('failed to write value '+endDateE);
return appE;
}

Related

retrieving EntryID for Checkbox item in Google Sheets Form not working

I used the code from #contributorpw on this post get Entry ID which is used to pre-populate fields (Items) in a Google Form URL and added the extended list of form types from #SourceFli (in same post).
I get the error message: "Exception: The parameters (String) don't match the method signature for FormApp.CheckboxItem.createResponse". That checkbox has only 1 option: "yes".
The rest of all my form items are only TEXT items and work fine.
function getPreFillEntriesMap(){
var ssOrder = SpreadsheetApp.openById(ORDER_SPREADSHEET_ID);
var orderFormUrl = ssOrder.getFormUrl();
var orderForm = FormApp.openByUrl(orderFormUrl);
var form = orderForm;
// var form = FormApp.openById(id);
var items = form.getItems();
var newFormResponse = form.createResponse();
var itms = [];
for(var i = 0; i < items.length; i++){
var response = getDefaultItemResponse_(items[i]);
if(response){
newFormResponse.withItemResponse(response);
itms.push({
id: items[i].getId(),
entry: null,
title: items[i].getTitle(),
type: "" + items[i].getType()
});
}
}
var ens = newFormResponse.toPrefilledUrl().split("&entry.").map(function(s){
return s.split("=")[0];
});
ens.shift();
return Logger.log(itms.map(function(r, i){
r.entry = this[i];
return r;
}, ens));
}
function getDefaultItemResponse_(item){
switch(item.getType()){
case FormApp.ItemType.TEXT:
return item.asTextItem().createResponse("1");
break;
case FormApp.ItemType.MULTIPLE_CHOICE:
return item.asMultipleChoiceItem()
.createResponse(item.asMultipleChoiceItem().getChoices()[0].getValue());
break;
case FormApp.ItemType.CHECKBOX:
return item.asCheckboxItem()
.createResponse(item.asCheckboxItem().getChoices()[0].getValue());
break;
case FormApp.ItemType.DATETIME:
return item.asDateTimeItem()
.createResponse(new Date());
break;
case FormApp.ItemType.DATE:
return item.asDateItem()
.createResponse(new Date());
break;
case FormApp.ItemType.LIST:
return item.asListItem()
.createResponse(item.asListItem().getChoices()[0].getValue());
break;
case FormApp.ItemType.PARAGRAPH_TEXT:
return item.asParagraphTextItem()
.createResponse(item.asParagraphTextItem().createResponse("some paragraph"));
break;
case FormApp.ItemType.CHECKBOX_GRID:
return item.asCheckboxGridItem()
.createResponse(item.asCheckboxGridItem().createResponse([item.asGridItem().getColumns[0], item.asGridItem().getRows[0]]));
break;
case FormApp.ItemType.DURATION:
return item.asDurationItem()
.createResponse(item.asDurationItem().createResponse(2, 20, 20));
break;
case FormApp.ItemType.GRID:
return item.asGridItem()
.createResponse(item.asGridItem().createResponse([item.asGridItem().getColumns[0], item.asGridItem().getRows[0]]));
break;
case FormApp.ItemType.SCALE:
return item.asScaleItem()
.createResponse(item.asScaleItem().createResponse(1));
break;
case FormApp.ItemType.TIME:
return item.asTimeItem()
.createResponse(item.asTimeItem().createResponse(1, 1));
break;
default:
return undefined;
}
}
response of createResponse(responses) of Class CheckboxItem is String[]. In your script, the string is used. I thought that this might be the reason of your issue. So how about the following modification?
From:
return item.asCheckboxItem()
.createResponse(item.asCheckboxItem().getChoices()[0].getValue());
To:
return item.asCheckboxItem()
.createResponse([item.asCheckboxItem().getChoices()[0].getValue()]);
Reference:
createResponse(responses)

Error when trying to set Google Forms quiz score

I'm trying to change the grade of a response based on its answer.
Here's the code I'm using:
function myFunction() {
var form = FormApp.openById('formID123456');
// For a question with options: "1", "2", "3", and "4",
// award points for responses that correlate with their answers.
var formResponses = FormApp.getActiveForm().getResponses();
// Go through each form response
for (var i = 0; i < formResponses.length; i++) {
var response = formResponses[i];
var items = FormApp.getActiveForm().getItems();
// Assume it's the first item
var item = items[0];
var itemResponse = response.getGradableResponseForItem(item);
// Give 4 points for "4".
if (itemResponse != null && itemResponse.getResponse() == '4') {
var points = item.asScaleItem().getPoints();
itemResponse.setScore(points == 4);
}
// Give 3 points for "3".
else if (itemResponse != null && itemResponse.getResponse() == '3') {
var points = item.asScaleItem().getPoints();
itemResponse.setScore(points == 3);
}
// Give 2 points for "2".
else if (itemResponse != null && itemResponse.getResponse() == '2') {
var points = item.asScaleItem().getPoints();
itemResponse.setScore(points == 2);
}
// Give 1 points for "1".
else if (itemResponse != null && itemResponse.getResponse() == '1') {
var points = item.asScaleItem().getPoints();
itemResponse.setScore(points == 1);
// This saves the grade, but does not submit to Forms yet.
response.withItemGrade(itemResponse);
}
}
// Grades are actually submitted to Forms here.
FormApp.getActiveForm().submitGrades(formResponses);
}
This returns the error:
We're sorry, a server error occurred. Please wait a bit and try again. (line 23, file "Code")
It seemed like it was having issues changing the score of the response, but it didn't return a specific error, so I tried to isolate the part that changes the score.
Here, the script attempts only to change the score of the response.
function myFunction() {
var form = FormApp.openById('formID123456');
var formResponses = FormApp.getActiveForm().getResponses();
// Go through each form response
for (var i = 0; i < formResponses.length; i++) {
var response = formResponses[i];
var items = FormApp.getActiveForm().getItems();
// Assume it's the first item
var item = items[0];
var itemResponse = response.getGradableResponseForItem(item);
// Set Score to 3
var points = item.asScaleItem().getPoints();
itemResponse.setScore(points == 3);
}}
Again, it returned the same error, which confirms my suspicions. Why am I having this problem and how can I fix it? Any help would be much appreciated. Thanks!
As I mentioned in comments, your posted code erroneously uses a Boolean value in the call to ItemResponse#setScore, when the method expects to receive an Integer value.
Resolving the internal server error can be done by changing your entire if-elseif chain from this:
if (itemResponse != null && itemResponse.getResponse() == '4') {
var points = item.asScaleItem().getPoints();
itemResponse.setScore(points == 4); //<--- 'points == 4' evaluates to True or False
}
// Give 3 points for "3".
else if (...
to this:
// Skip changing the score if there was no answer or the answer is "falsey"
if (!itemResponse || !itemResponse.getResponse())
continue;
var answer = itemResponse.getResponse();
var newPoints = answer *1; // Convert "2" to 2, etc.
// Assumption: newPoints <= maximum possible points.
itemResponse.setScore(newPoints);
response.withItemGrade(itemResponse);
The below code is an example of how to set all graded items in all responses to a form to their maximum possible value.
function everyonePassesForTrying() {
var form = FormApp.getActiveForm();
var responses = form.getResponses();
responses.forEach(function (fr) {
fr.getGradableItemResponses().forEach(function (gr) {
if (gr.getResponse()) {
var maxPoints = getPointValue_(gr.getItem());
if (gr.getScore() !== maxPoints) {
// Re-grade the item's response.
gr.setScore(maxPoints);
// Update the form response with the new grade.
fr.withItemGrade(gr);
}
}
else { /* They didn't even try, so no change */ }
});
});
// Submit the altered scores.
form.submitGrades(responses);
}
var itemCache = {};
function getPointValue_(item) {
var id = item.getId();
// Use a pseudo-cache of the item's point values to avoid constantly determining what
// type it is, casting to that type, and getting the max points.
if(!itemCache[id]) {
// Haven't seen it yet, so cast and cache.
item = castToType_(item);
itemCache[id] = {maxPoints: item.getPoints() *1};
}
return itemCache[id].maxPoints;
}
function castToType_(item) {
// Cast the generic item to its type.
var CHECKBOX = FormApp.ItemType.CHECKBOX,
DATE = FormApp.ItemType.DATE,
DATETIME = FormApp.ItemType.DATETIME,
DURATION = FormApp.ItemType.DURATION,
LIST = FormApp.ItemType.LIST,
MULTICHOICE = FormApp.ItemType.MULTIPLE_CHOICE,
PARAGRAPH = FormApp.ItemType.PARAGRAPH_TEXT,
SCALE = FormApp.ItemType.SCALE,
TEXT = FormApp.ItemType.TEXT,
TIME = FormApp.ItemType.TIME;
switch (item.getType()) {
case CHECKBOX: item = item.asCheckboxItem();
break;
case DATE: item = item.asDateItem();
break;
case DATETIME: item = item.asDateTimeItem();
break;
case DURATION: item = item.asDurationItem();
break;
case LIST: item = item.asListItem();
break;
case MULTICHOICE: item = item.asMultipleChoiceItem();
break;
case PARAGRAPH: item = item.asParagraphTextItem();
break;
case SCALE: item = item.asScaleItem();
break;
case TEXT: item = item.asTextItem();
break;
case TIME: item = item.asTimeItem();
break;
default:
throw new Error("Unhandled gradable item type '" + item.getType() + "'");
break;
}
return item;
}

Line 49, 52,55,58,61,64- 1119:Access of possibly undefined property text through a reference with static type String

Not sure what I am doing wrong, I removed any text from the text box fields so why am I still getting this error ?
Code below :
switch (day) {
case "Sun":
day.text = "Monday";
break;
case "Mom":
day.text = "Tuesday";
break;
case "Tue":
day.text = "Wednesday";
break;
case "Wed":
day.text = "Thursday";
break;
case "Thu":
day.text = "Friday";
break;
case "Fri":
day.text = "Saturday";
break;
case "Sat":
day.text = "Sunday";
break;
}
switch (codeToday) {
case "0":
case "3200":
var weather00:weather00 = new weather00();
_weatherToday.addChild(weather00);
_weatherToday.scaleX = 10.85;
_weatherToday.scaleY = 158.75;
break;
case "1":
case "3200":
var weather01:weather01 = new weather01();
_weatherToday.addChild(weather01);
_weatherToday.scaleX = 10.85;
_weatherToday.scaleY = 158.75;
break;
}
i suppose that 'day' is a String variable and have not a text property - look here -> String
Some components have a text property like: TextField and TextArea

Building a autocomplete search input with a combobox

I'm trying to create a combobox that will fill with posible auto complete results, I firstly have all the words in an array that compares to the user input, its then put into a switch statement that adds the words to the combobox. I however can't get it right to remove the results from the combobox when the input changes.
var dictionary:Vector.<String> = new Vector.<String>();
dictionary.push("University Chapel");
dictionary.push("IT Building");
dictionary.push("Student Centre");
dictionary.push("EMS Building");
dictionary.push("EMB Building");
dictionary.push("Monastry Hall");
dictionary.push("Conference Centre");
dictionary.push("Client Service Centre");
var objects:Vector.<MovieClip> = new Vector.<MovieClip>();
stage.focus = inputBox;
inputBox.addEventListener(Event.CHANGE, onCompletions);
function onCompletions(event:Event):void{
for(var i:int = 0; i < dictionary.length; ++i){
if(dictionary[i].indexOf(inputBox.text) >= 0){
switch(dictionary[i]) {
case 'IT Building':
cbox.addItemAt({label:"IT Building", data:"screenData" + newRow},0);
break;
case 'University Chapel':
cbox.addItemAt({label:"University Chapel", data:"screenData" + newRow},0);
break;
case 'Student Centre':
cbox.addItemAt({label:"Student Centre", data:"screenData" + newRow},0);
break;
case 'EMS Building':
cbox.addItemAt({label:"EMS Building", data:"screenData" + newRow},0);
break;
case 'EMB Building':
cbox.addItemAt({label:"EMB Building", data:"screenData" + newRow},0);
break;
case 'Monastry Hall':
cbox.addItemAt({label:"Monastry Hall", data:"screenData" + newRow},0);
break;
case 'Conference Centre':
cbox.addItemAt({label:"Conference Centre", data:"screenData" + newRow},0);
break;
case 'Client Service Centre':
cbox.addItemAt({label:"Client Service Centre", data:"screenData" + newRow},0);
break;
}
}
else {
//cbox.removeAll(); //Where I attempted to remove all the results
}
}
}
So I'm trying to remove the results from the combobox and have them re evaluated and then inserted again. Just as a side question is there a way to expand comboboxs through actionscript ?
Thanks in advance
If anyone is interested, I got it to work, so this will basically create a autocomplete search input box.
var dictionary:Vector.<String> = new Vector.<String>();
dictionary.push("University Chapel");
dictionary.push("IT Building");
dictionary.push("Student Centre");
dictionary.push("EMS Building");
dictionary.push("EMB Building");
dictionary.push("Monastry Hall");
dictionary.push("Conference Centre");
dictionary.push("Client Service Centre");
stage.focus = inputBox;
inputBox.addEventListener(Event.CHANGE, onCompletions);
cbox.open();
function onCompletions(event:Event):void{
cbox.removeAll();
cbox.close();
for(var i:int = 0; i < dictionary.length; ++i){
if(dictionary[i].indexOf(inputBox.text) >= 0 && inputBox.text != ''){
switch(dictionary[i]) {
case 'IT Building':
cbox.addItemAt({label:"IT Building", data:"screenData"},0);
cbox.open();
break;
case 'University Chapel':
cbox.addItemAt({label:"University Chapel", data:"screenData"},0);
cbox.open();
break;
case 'Student Centre':
cbox.addItemAt({label:"Student Centre", data:"screenData"},0);
cbox.open();
break;
case 'EMS Building':
cbox.addItemAt({label:"EMS Building", data:"screenData"},0);
cbox.open();
break;
case 'EMB Building':
cbox.addItemAt({label:"EMB Building", data:"screenData"},0);
cbox.open();
break;
case 'Monastry Hall':
cbox.addItemAt({label:"Monastry Hall", data:"screenData"},0);
cbox.open();
break;
case 'Conference Centre':
cbox.addItemAt({label:"Conference Centre", data:"screenData"},0);
cbox.open();
break;
case 'Client Service Centre':
cbox.addItemAt({label:"Client Service Centre", data:"screenData"},0);
cbox.open();
break;
}
}
}
}

Adobe AIR 3.2 Glitch

I just finished a successful build of my program last night. Then, I get up this morning, and after an update fro Adobe AIR 3.1 to AIR 3.2, I find THIS bug!
The same build under 3.1 works perfectly. However, as soon as 3.2 is installed, the following code after stopDrag fails silently. Mind you, it only fails in the packed and installed AIR application. It works perfectly when I test it inside of Adobe Flash Professional CS5.5
WHAT is going on? Here's the code I'm dealing with. Again, this works without error for Adobe AIR 3.1, but fails for 3.2. I cannot get to any other MouseEvent.MOUSE_UP events in my program at this point, due to my structure.
I omitted the irrelevant parts of the code. All the same, there is a lot, due to the fact that I don't know where the error occurs exactly. Instead of everything that is supposed to happen happening, stopDrag is the last line of code that fires in this block.
tile5.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler5);
function mouseUpHandler5(evt:MouseEvent):void
{
Mouse.cursor = "paw";
var obj = evt.target;
var target = obj.dropTarget;
obj.stopDrag();
if (target != null && target.parent == hsSlot1)
{
brdgcheck(5, 1);
}
}
function brdgcheck(tile:int, slot:int)
{
var ck_brdg_l:String = "osr.Langue.brdg_l" + String(slot);
var ck_brdg_t:String = "osr.Langue.brdg_t" + String(tile);
var ck_slotfilled:String = "Slot" + String(slot) + "Filled";
var ck_tile:String = "tile" + String(tile);
var ck_slot:String = "hsSlot" + String(slot);
var ck_txtTile:String;
switch(tile)
{
case 1:
ck_brdg_t = osr.Langue.brdg_t1;
ck_txtTile = tile1.txtTile1.text;
break;
case 2:
ck_brdg_t = osr.Langue.brdg_t2;
ck_txtTile = tile2.txtTile2.text;
break;
case 3:
ck_brdg_t = osr.Langue.brdg_t3;
ck_txtTile = tile3.txtTile3.text;
break;
case 4:
ck_brdg_t = osr.Langue.brdg_t4;
ck_txtTile = tile4.txtTile4.text;
break;
case 5:
ck_brdg_t = osr.Langue.brdg_t5;
ck_txtTile = tile5.txtTile5.text;
break;
}
switch(slot)
{
case 1:
ck_brdg_l = osr.Langue.brdg_l1;
break;
case 2:
ck_brdg_l = osr.Langue.brdg_l2;
break;
case 3:
ck_brdg_l = osr.Langue.brdg_l3;
break;
case 4:
ck_brdg_l = osr.Langue.brdg_l4;
break;
case 5:
ck_brdg_l = osr.Langue.brdg_l5;
break;
}
if (ck_brdg_l == ck_brdg_t)
{
osr.Sonus.PlaySound("concretehit");
this[ck_slotfilled].visible = true;
switch(slot)
{
case 1:
Slot1Filled.txtSlot1.text = ck_txtTile;
break;
case 2:
Slot2Filled.txtSlot2.text = ck_txtTile;
break;
case 3:
Slot3Filled.txtSlot3.text = ck_txtTile;
break;
case 4:
Slot4Filled.txtSlot4.text = ck_txtTile;
break;
case 5:
Slot5Filled.txtSlot5.text = ck_txtTile;
break;
}
this[ck_tile].visible = false;
this[ck_slot].visible = false;
if (hsSlot1.visible == false && hsSlot2.visible == false && hsSlot3.visible == false && hsSlot4.visible == false && hsSlot5.visible == false)
{
osr.Gradua.Score(true);
osr.Gradua.Evaluate("brdg");
btnReset.visible = false;
hsChar.visible = false;
if (osr.Gradua.Fetch("brdg", "arr_act_stcnt") < 4)
{
bga.gotoAndPlay("FINKEY");
win_key();
}
else
{
bga.gotoAndPlay("FINNON");
}
}
else
{
osr.Gradua.Score(true);
}
}
else
{
osr.Gradua.Score(false);
osr.Sonus.PlaySound("glassbreak");
switch(tile)
{
case 1:
tile1.x = 92.85;
tile1.y = 65.85;
break;
case 2:
tile2.x = 208.80;
tile2.y = 162.85;
break;
case 3:
tile3.x = 324.80;
tile3.y = 65.85;
break;
case 4:
tile4.x = 437.80;
tile4.y = 162.85;
break;
case 5:
tile5.x = 549.80;
tile5.y = 65.85;
break;
}
}
}
EDIT: I found a good workaround, to use "if (hsSlot1.hitTestPoint(mouseX,mouseY) && hsSlot1.visible == true)"
However, a solution to this problem would still be appreciated!