maxb
July 27, 2019, 12:39pm
1
I’m trying to ‘apply’ an image that I’ve uploaded to the app designer as a property of an object , but I can’t seem to find if it is possible as I can only use the block assigned to the image component to retrieve the actual image.
BTW, i just found out that I can’t set it as a property, I’ll see if I can make a list of images.
Hope I explained myself, thx.
actech
July 27, 2019, 12:58pm
2
Why did you decide that this is impossible?
maxb
July 27, 2019, 1:00pm
3
I just tried to attach the block “from image x get the image” to the object propoerty but it says I can’t
actech
July 27, 2019, 1:06pm
4
Do this in a function, not directly in initialize. This is a well-known nuance. Or try this join through the text “join” block
1 Like
maxb
July 27, 2019, 1:08pm
5
Like “add the picture to the end of the list”, or “set the object property to picture x”?
I just tried this and gives no error, maybe I can use this?
maxb
July 27, 2019, 1:12pm
7
Ok Ok many thanks as always.
So I’m noticing that this works with databases, lists and objects .
Thx
maxb
July 27, 2019, 2:06pm
8
BTW, can you confirm that I can’t access an image that I uploaded to the app if I don’t assign it to some component and only from there I can retrieve it?
actech
July 27, 2019, 3:02pm
9
If an image is loaded into a project, then it can be accessed by specifying the file name in the text block
maxb
July 27, 2019, 3:15pm
10
BTW, the “set object property ” is not working
actech
July 28, 2019, 9:46am
11
Can you show blocks that don’t work? While I have not seen this.
maxb
July 28, 2019, 2:10pm
12
I get set the image as a property of the object as the screen starts, then I clone a button and row/labels/buttons and set them specific names and images that are properties of objects in a list of objects
actech
July 28, 2019, 2:13pm
13
Sorry, but I did not understand that this does not work.
maxb
July 28, 2019, 2:41pm
14
I think the problem is this “in list x getobject number y”, or pictures are not allowed as objects properties.
I tried using a normal list and it works, but I can’t have the “j” position in the list as it gives 0 for every “j” object in the list
actech
July 28, 2019, 4:33pm
15
The Picture property is just a text string. How can it not be resolved?
You are trying to build a house from the roof, so there are difficulties. Try to start with a simple foundation:
See what type of data the Picture property is.
Сreate new Screen and object.
Сonnect the “get picture” block to this object.
In the image component show the image obtained from the object property.
If this does not work out, then the error is in the blocks.
maxb
July 28, 2019, 5:26pm
16
Right, I tested as you said a very basic one and it worked, so now I’m stepping up from there, and this is not working already.
I get the value that is set in the object’s property but not the image I set as the screen opens.
I think I’m stuck.
actech
July 28, 2019, 5:30pm
17
I’ll show you an example now.
actech
July 28, 2019, 5:58pm
19
I understood the problem. The point is in the type of the variable. If you use a global variable, it will not really work. This is surprising.
For this reason, I try to use variable functions that work as expected.
https://x.thunkable.com/projects/5d3ddbda9288fa6ca26ec7d3/project/properties/designer/
1 Like
maxb
July 29, 2019, 8:33am
20
Ok, very good thx, but as @Mark told you that kind of behaviour might change in the future so it’s risky to base a part of the app on that.
Btw, since you can upload objects to firebase, I’m curious to see how it will work if you set an image as an object’s property.
BTW, how do you create functions variables without the function? Do you just delete it after you create the variable?