View Full Version : Sample: File Browser with Tree Object
Brett
09-15-2005, 12:04 PM
This sample project shows you how to work with the Tree object by dynamically filling it at runtime.
It is a simple file browser that allows you to set the root folder that is being displayed:
Skills used:
Tree object, Dialog.FolderBrowse action, File actions, Input object, Paragraph object
Note: This project only works in AutoPlay Media Studio 6.0
azmanar
12-25-2005, 03:30 AM
This sample project shows you how to work with the Tree object by dynamically filling it at runtime.
It is a simple file browser that allows you to set the root folder that is being displayed:
Skills used:
Tree object, Dialog.FolderBrowse action, File actions, Input object, Paragraph object
Note: This project only works in AutoPlay Media Studio 6.0
Hi,
Nice piece.
How do I activate the subitems so if I double click, it will launch?
ON DOUBLE-CLICK EVENT
File.Open(strFilename) ?
Thanks
srussell
02-10-2006, 08:52 AM
Brett,
This sample works great... The only question I have is that I only need to display the folder names, not the folders with the filenames in a sub-node of each folder...
Any suggestions?
clubbcrusher
06-18-2006, 02:42 AM
nice script! ,b ut, is it possible when you browse and click, n the right info, and at top of the right collum, insert a image, that you can see what youre talking about??? and a action click button??
lepinski
04-16-2008, 02:45 PM
Hi, I'm new in Ams, this example is good for my project, but I need to know how to open files from subitems, the project open a folder, then show names in sub items but I need script for open file with double click option.
I have AMS 7.0
Thanks
Centauri Soldier
09-23-2008, 10:11 AM
I've avoided the tree object for over a year and now I need one. Mine was coming along but then I saw yours....thanks so much; yours is great and I can modify it to fit my project, you saved me hours of work. :yes
Alweissi
01-19-2009, 07:06 AM
Hi. This project suits for my project. BUT.. Can somebody help me, how I change this to search always in same file (same path).
On start or behind button? (button is better)
when Klik, "C:\filepath" goes to the tree and tree shows what are inside filepath.? ;)
Imagine Programming
01-19-2009, 08:33 AM
Try to check the source, On Click on that button for instance :)
Alweissi
01-19-2009, 01:21 PM
Try to check the source, On Click on that button for instance :)
yes I did check, and I still do. but dont get how.. =/
Centauri Soldier
01-19-2009, 04:47 PM
This code is in the On Show event of the page.
-- See "On Preload" for functions
Tree.PopulateFromFolder("tree", _SourceFolder);
jJust modify '_SourceFolder' to be whatever path you want.
JDog37
01-19-2009, 06:13 PM
Im getting this error: On show line 5: attempt to call field populate from folder ( a nil value)... ???? What dose that mean?
Centauri Soldier
01-19-2009, 10:52 PM
It means that your PopulateFromFolder function has not been defined as a sub item of Tree...perhaps it's missing or being called before it is declared.
The AMS order of operations during load (and correct me if I'm wrong here) is Plugins, Globals, On Startup then the first page or dialog that shows.
Alweissi
01-20-2009, 12:18 AM
This code is in the On Show event of the page.
-- See "On Preload" for functions
Tree.PopulateFromFolder("tree", _SourceFolder);
jJust modify '_SourceFolder' to be whatever path you want.
Thanks. U r the best =)
Hmm. Untill now I notice to replace \ --> /
C:\test\test --> c:/test/test
Now its works fine. Just modify and 1 problem less to solve
thx Centauri Soldier
Alweissi
01-20-2009, 12:42 AM
Thanks. U r the best =)
Hmm. Untill now I notice to replace \ --> /
C:\test\test --> c:/test/test
Now its works fine. Just modify and 1 problem less to solve
thx Centauri Soldier
1 other question. This Tree object. Can it be transparent anyhow.?
ReconADA
01-28-2009, 12:19 PM
Hi,
Nice piece.
How do I activate the subitems so if I double click, it will launch?
ON DOUBLE-CLICK EVENT
File.Open(strFilename) ?
Thanks
I'm sure this is a stupid question but how would you open a file from the double-click event?
ReconADA
01-28-2009, 01:48 PM
Never mind I figured it out.
Here the solution by the way.
-- Get the selected item's node index
sNodeIndex = Tree.GetSelectedNode("tree");
-- Get the properties of the currently selected item
tProps = Tree.GetNode("tree", sNodeIndex);
strFile = tProps.Data
File.Open(strFile);
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.