How do I show an image on a sprite using a file chooser?

Get help using Construct 2

Post » Tue Aug 23, 2016 6:57 am

Hi guys,

I am trying to choose an image by using a file chooser on layout 1, then after I have chosen an image, i wanted to show the image on the sprite on layout 2. On the event sheet, I tried

FileChooser on Changed - System Go to Layout2, sprite Load Image from FileChooser.FileURLAt(0)

I manage to move to layout 2, but the sprite doesn't show the image, why??


Thanks!
B
48
S
20
G
6
Posts: 73
Reputation: 6,474

Post » Tue Aug 23, 2016 10:58 am

Hello, you have to use global variable.
see this capx :
https://www.dropbox.com/s/q76vhz8gdatbo ... .capx?dl=0
B
17
S
10
G
19
Posts: 140
Reputation: 11,457

Post » Tue Aug 23, 2016 11:47 am

@saad Swad
and how can this work with mouse click on other Sprite .. cause i don't need this choose file button :/
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Tue Aug 23, 2016 1:13 pm

@CBelle
I don't understand what you want ? Can you explain more please
B
17
S
10
G
19
Posts: 140
Reputation: 11,457

Post » Tue Aug 23, 2016 3:28 pm

@Saad Swad Whao, actually i tried global variable before, but don't know why it doesn't work! And now it works! Thanks alot man! Actually I still have another inquiry, do you happen to know How to use spirite to act/function as file chooser? .

Best Regards
B
48
S
20
G
6
Posts: 73
Reputation: 6,474

Post » Tue Aug 23, 2016 3:59 pm

Image

Image

Image
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Tue Aug 23, 2016 4:50 pm

@korbaach thank you for replying me, i tried your method, but it doesn't work for me. I pressed the sprite and nothing happen, do you mind sending me the capx file?

Thanks ;)
B
48
S
20
G
6
Posts: 73
Reputation: 6,474

Post » Tue Aug 23, 2016 6:49 pm

I guess..you use Firefox ;)
this works in Chrome,Opera,IE...but...not in FF,if you use Sprite..but works fine with Button

Image

for Sprite you can try simple set FileChoser opacity to 0

Image

and cover Sprite with FileChooser

Image
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests