Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Michaelb on July 10, 2014, 12:07:38 AM

Title: www object read images from a folder [SOLVED THANK YOU LANE AND JEAN YOU ROCK]
Post by: Michaelb on July 10, 2014, 12:07:38 AM
Greetings ,

i need your kind help once more.

In wwwobject , were we put the url link , i need to do this

--> I have a folder with random named images in there , so i wont be able to know exactly their name when i call them with wwwobject. (random users will upload them)

Is there a command that will read random from this folder.

Extremely urgent , hoping for help.

Thank you very much.

Michael.
Title: Re: www object read images from a folder
Post by: jeanfabre on July 10, 2014, 06:31:40 AM
Hi,

 what's your platform target?

typically, you can use "file://" appended to the url:

http://answers.unity3d.com/questions/517414/how-to-use-www-to-load-local-files.html

 Bye,

 Jean
Title: Re: www object read images from a folder
Post by: Michaelb on July 10, 2014, 07:57:50 AM
Greetings Jean ,

first of all thank you for replying back.

What i need is to use the images on a www folder (server) as textures.

Lets say path is www.test.com/thisfolder

well , in this folder there are images with random names.

Usually with wwwobject we call

-->http://upload.wikimedia.org/wikipedia/commons/2/22/Turkish_Van_Cat.jpg

file name is Turkish_Van_Cat.jpg.

My problem now is that in the same path and folder , there are images with random names , and i want to use them but i dont know their names to call them.

How file:// is going to help , i will put only file:// this showing to the folder?

Thank you very very much in advance.
Title: Re: www object read images from a folder
Post by: Lane on July 10, 2014, 08:03:12 AM
You need to compile a string with the url prefix to the folder and the file/image name on the end, then use the result in the WWW path.
Title: Re: www object read images from a folder
Post by: Michaelb on July 10, 2014, 08:07:22 AM
Greetings Lane , and thank you for helping out.

I really dont know how to do what you just said...... :-[
Title: Re: www object read images from a folder
Post by: Lane on July 10, 2014, 08:28:28 AM
For example

"http://www.mywebsite/myfolder/" is stringA.
"adorablecat.jpg" is stringB.

You can use the Format String action to put them together, then the result is your url target for the WWW action.
Title: Re: www object read images from a folder
Post by: Michaelb on July 10, 2014, 08:40:35 AM
Aahhhh , i understand now , the string part got me confused.

Yes , correct , this  is what i am trying to do , problem is i dont know the name of the images (they will be created from users).

Is there any way to read / look into the folder , take the names one by one and store them , so i can finally get them into strings??

P.S

Thank you for helping out , you really cant imagine how this helps.
Title: Re: www object read images from a folder
Post by: Michaelb on July 10, 2014, 03:24:00 PM
My friend Lane ,

one last question , since i managed to do it with strings and guilayouttext (input from the user as one string).

On the format string , what do we put on the format* field???

Much appreciated for all your help.
Title: Re: www object read images from a folder
Post by: Michaelb on July 10, 2014, 04:18:11 PM
Found this awesome tutorial

-->
and it solved all my questions.

GO GO PLAYMAKER

P.S

I love the guy that does those tutorials , sooooo easy to understand everything.