All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
Playing with these toys that you mentioned is known in Islamic Law and in language by conjuration. The scholars defined conjuration as showing strange things by arranging geometric devices while moving one's hands quickly and making use of special medicines and stones. [The definition in Longman dictionary reads: to perform clever tricks in which you seem to make things appear, disappear or change as if by magic].
All the scholars forbade this. Imaam An-Nawawi said: 'It is forbidden to sell books about disbelief, fortunetelling books, conjuration and philosophy, and other forbidden and false sciences. So selling them is forbidden as there is no permissible benefit in them.'
The author of Asnaa Al-Mattaalib said: 'It is forbidden to teach or do magic; also horoscope and predicting by looking to the sand, stones or barley, and conjuration are forbidden.'
Moreover, the author of Uuli An-Nuha said: 'Singing, chess, conjuration and the like are forbidden professions.'
Allaah Knows best.