Loading a File

For questions about using Classic.

Post » Tue Apr 20, 2010 2:19 am

I'm trying to get a window that pops up when you press "Load." In this window, I want the user to be able to pick which file to load from the computer by clicking on it. Sort of like loading an image in paint or some other program. Is there any way to do this? I can't find any information on how to do it anywhere. Thanks in advance for any suggestions or advice on how to do this. :)
B
2
G
2
Posts: 48
Reputation: 746

Post » Tue Apr 20, 2010 2:40 am

Look for the Common Dialog object. For a quick test:
- Start a new project
- insert a CommonDialog and an EditBox into the layout
- make two events in the event sheet like so:

[code:8irsnubz]+ System: Start of layout
-> CommonDialog: Show open dialog
+ CommonDialog: File dialog: OK
-> EditBox: Set text to CommonDialog.FirstSelectedFile[/code:8irsnubz]

Note that you can do this without typing anything, if you haven't learned the finer points of Construct's interface. You can also do quite a bit more with this object.

Anyway, the result is a string, and can be used in any other way as such.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Tue Apr 20, 2010 3:30 am

Thanks 8) I'll try it out and hopefully succeed.
B
2
G
2
Posts: 48
Reputation: 746


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: RodrigoLopes and 0 guests