I have the top of the window with little images that are hard coded with weblinks. How hard would it be to use say txt file etc that would hold the links so they could be changed if wanted?
Professional Software Development Tools
I have the top of the window with little images that are hard coded with weblinks. How hard would it be to use say txt file etc that would hold the links so they could be changed if wanted?
Not hard at all. Just use variables for your link(s) code and then use a TextFile.ReadToTable action to retrieve the link values from your text file on startup and place them into the appropriate variables. Here's a one button example attached, but you can add as many urls to the text file as you like, just refer to them according to their position in the table, i.e. myURL[1], myURL[2], etc.![]()
So you would use the one txt file and just add the urls to that txt file like this?
http://www.google.com
http://www.yahoo.com
etc
and call them like this .
myURL[1], myURL[2]
Ok that works great , how do I load it into the web1 then?
Last edited by bobbie; 02-08-2006 at 09:31 PM.
Yes, that's what I'd do for something like this. To lead the URL into the web object just change the action in the example, I set it up using File.OpenURL. You can change that to any action you like, the main point to note being that I used a variable (myURLS[1]) to refer to the URL value, not a literal string. That is what makes it possible you load URLs dynamically.
If you want to "protect" the text file somewhat you could even add it to an encrypted zip file and extract it from there at runtime, read it into memory, then delete it. It's not foolproof but it is enough to prevent casual looky-loos from lookylooing, or worse yet, altering your links.
As a follow up, you could also create a separate administration tool/page using AMS for parents to add/edit links inside the links file inside the encrypted zip file. Again, it's not unbeatable security but adequate enough to ward off any casual unsavoriness.
If you need more security than that so that the links are never readable in plain text you could also work out a little system to scramble/unscramble them etc. At it's crudest level the metaphor here would be to say shuffle every second character forward by 3 characters, and then reverse the string. Or whatever, you get the idea, obfuscating the text so that even if people have access to the text file they can't just casually modify links. The real king of this sort of thing is Lorne, if you ever get to the point where you are seeking to implement some encryption or security, he's the guy to ask for sure. And he has vantastic taste in mountain bikes too, so that's a bonus.![]()
Thanks Corey you have been so much help . I got it to work with thisand got it on the first try . Almost sh*t my pants. lolCode:Web.LoadURL("Web1",myURLs[2], SW_SHOWNORMAL);
I can code something up to edit the file with in Autohotkey as I know that well .
I don't think I need to go as far as encrypting the file .
Thanks so much for the help.
No problem.![]()
Working on the link editor , how does it look so far.
When it opens it will have the links load and ready to be replaced.
Bobbie,
It looks slick and professional.
Good work!
Yossi
I agree with Yossi, this looks slick.![]()
Thank you .. now to do the coding . I may get some help with this .time to call my buddy . lol.
I have done a user link input an save that uses the sqlite plugin. It would take me 30 minutes to break it out of the project as a stand alone, so if you want to see it, let me know.
I use the database in a useful links popup in the project. It can be passworded so only the adult can make the changes.
Slick bobbie![]()
Thanks ,I sure would like to see it if you want to do it.Originally Posted by Roboblue
Sorry to be a pest , I want to open the txt file that will hold the links from the url.txt.
So I have tried the paragraph object and that loadss the info fine from the txt file but I can't seem to find how to use that to edit the file.
I have tried listbox object but it didn't load the txt file ( not sure if I had it right) So what do I use to the load the txt file abd able to edit it and save it back the new links that have been change?
Use an Input object with the multi-line option truned on.