Image sprite YaiList instead problem

1,124 views
Skip to first unread message
Assigned to taifu...@gmail.com by me

Sid101

unread,
Feb 13, 2014, 7:26:19 PM2/13/14
to mitappinv...@googlegroups.com
Hello fellow AI'ers

I have a small problem I get the message Runtime Error - Property setter was expecting a ImageSprite component but got a YailList instead.

What I am trying to do is use one image sprite to show a variety of images by creating a list fired by one clock. I am attaching a file please take a look and tell me where I am going wrong and why I am getting the YaiList??. Please try to provide any examples  with blocks so I can understand your explanations better. I have only been learning AI2 a few weeks in, keep hitting road blocks and trying to learn by adapting methods found by others.

Your help will be appreciated.










Prob1.docx

Taifun

unread,
Feb 13, 2014, 8:37:25 PM2/13/14
to mitappinv...@googlegroups.com


use get item instead of get global Fingers
btw: your add items to list block looks strange, the second socket is missing
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         


add items to list

Adds the given items to the end of the list.
The difference between this and append to list is that append to list takes the items to be appended as a single list
while add items to list takes the items as individual arguments. This block is a mutator.


Sid101

unread,
Feb 14, 2014, 10:19:44 AM2/14/14
to mitappinv...@googlegroups.com
I did the changes shown that were pointed out by Taifun. But was I supposed to put something in the second socket of add items to list?
I now get the message --- Runtime Error
Property setter was expecting a ImageSprite component but got a String instead.
Note: You will not see another error reported for 5 seconds.
The YailList error is gone now, but the changes bring about this error now. 
How is the add item to list item supposed to look like with which socket components???

Sid101

unread,
Feb 14, 2014, 11:41:43 AM2/14/14
to mitappinv...@googlegroups.com
Or if my method is too flawed as in the attachment Please can someone show me how to use one image sprite fired by one clock to show a variety of images jpeg/png type files to appear randomly around the screen.  I have already done the mole mash tutorials but I am looking for a short way to do it and not having to have many sprites with each one represented by an image.

Taifun

unread,
Feb 14, 2014, 12:47:06 PM2/14/14
to mitappinv...@googlegroups.com
you might want to provide another screenshot of your relevant blocks
Taifun

Sid101

unread,
Feb 14, 2014, 1:30:26 PM2/14/14
to mitappinv...@googlegroups.com

Hello Taifun

First I want to thank you I have noticed you try to help a lot of AI'ers no matter how early or late it is. I am a business studies teacher and thought I would give this a try before trying to teach it. I found it very easy with the aid of a few tutorials but going solo is giving me road blocks. I am trying to take things further but there is no manual and guys like yourself are needed. 

Anyway. I have attached a screenshot. First I think I did as you asked but got the error message about "got a String instead." So I tried to make further changes as in Version 2 but messed it further. Hopefully you will spot something I am doing wrong (ignore version 2).

Basically with this I am trying to link 5 images with one sprite and one clock, which will randomly appear on the screen. If you have a blocks of your own that can show me how to do it, it will save me a lot of time.


Problem2.docx

Taifun

unread,
Feb 14, 2014, 5:42:04 PM2/14/14
to mitappinv...@googlegroups.com
so your list is a list of images...
but you are using the list as list of components, therefore you get that error...
do you also have 5 image sprites and you want to assign pictures to them during runtime?
but why during runtime? you just could assign the pictures in the designer directly to these image sprites...
this might help how to use the advanced blocks http://puravidaapps.com/quiz.php
Taifun

Taifun

unread,
Feb 17, 2014, 11:40:28 AM2/17/14
to mitappinv...@googlegroups.com
no answer, will close this post
Taifun

Reply all
Reply to author
Forward
0 new messages