ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 22nd, 2005, 09:39 PM
snip128 snip128 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 snip128 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 44 sec
Reputation Power: 0
directory listing/linking with CF and flash

well, i searched google for a while on how to list a directory in flash and i found that coldfusion can do this-along with some help from actionscript

ColdFusion script:

<cfdirectory
directory="d:\inetpub\wwwroot\CFIDE"
action="list"
name="fileList">
<cfloop query="fileList">
<cfoutput>&file#fileList.currentRow#=#fileList.name#&</cfoutput>
</cfloop>
<cfoutput>&numFiles=#fileList.recordCount#&</cfoutput>

Flash:

var theRoot = this;
var myLoadVars:LoadVars = new LoadVars();
myLoadVars.load("http://localhost:8500/devx/fileList.cfm");

myLoadVars.onLoad = function(){
for(var i=1;i<=myLoadVars.numFiles;i++){
theRoot.createTextField("t"+i,i*10,0,i*20,200, 20);
theRoot["t" + i].text=myLoadVars["file"+i];
}
}

And its great...it works...but...the problem is i want links to the files and folders, so that people can click on the file to download it and click on a directory to go there.If you wanna see what it does now go here. Also, it'd be nice for it to show the directory that its displaying now..i dont need to use this script if you have any other alternatives as long as its flash...i wanna convert my site to flash, but its gonna be a file site...for LAN party's lol oh if the link doesnt work its because my computer is off..thx in advance! oh and btw this is what i use for html..

Reply With Quote
  #2  
Old May 23rd, 2005, 08:18 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
All you need to do is use the name in conjunction with the URL to the directory that you are reading to create a full URL to each file.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old May 23rd, 2005, 03:10 PM
snip128 snip128 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 snip128 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 44 sec
Reputation Power: 0
umm english please? >.< im a noob x_x i know almost nothing about actionscript and coldfusion...

Reply With Quote
  #4  
Old May 23rd, 2005, 04:08 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
If the URL to the directory that you're displaying is http://mysite.com/files/, then you can construct a URL by using the name attribute of the file that you got using cfdirectory:

<cfdirectory name="dirList" action="list" directory="c:\inetpub\wwwroot\mysite\files">

<cfoutput query="dirList"><a href="http://mysite.com/files/#dirList.name#">#dirList.name#</a></cfoutput>

Now how you do this in Flash I have no idea, never used Flash.

Reply With Quote
  #5  
Old May 23rd, 2005, 05:30 PM
snip128 snip128 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 snip128 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 44 sec
Reputation Power: 0
hmm doesnt work...this is the .cfm file i have after your suggestion..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfdirectory
directory="d:\inetpub\wwwroot\CFIDE"
action="list"
name="fileList">
<cfloop query="fileList">
<cfoutput query="fileList"><a href="http://thenooblet.com/CFIDE/#fileList.name#">#fileList.name#</a></cfoutput>
</cfloop>
<cfoutput>&numFiles=#fileList.recordCount#&</cfoutput>
</body>
</html>

the flash (which is set to just display the output of the cfm file with textboxes for each file) now, displays 11 "Undefined" lines (it says "undefined")...Theres 11 files/folders in the dir...now...i dont know if the flash would even display the files a links, but i dont think it should return "undefined"... -.-

Reply With Quote
  #6  
Old May 23rd, 2005, 06:50 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
But does it work without Flash, if you just execute the .cfm file directly in your browser?

Reply With Quote
  #7  
Old May 23rd, 2005, 07:08 PM
snip128 snip128 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 snip128 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 44 sec
Reputation Power: 0
it displays this line over and over:

administratorApplication.cfmclassescomponentutilsdebuginstall.cfmmain.aspprobe.cfmregister.htmregist er_ja.htmscripts

each word is a different link. at the end it has &numFiles=11&

you can see it here

Reply With Quote
  #8  
Old May 23rd, 2005, 09:24 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
You're looping over the query twice. And you need a line break after each URL.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfdirectory
directory="d:\inetpub\wwwroot\CFIDE"
action="list"
name="fileList">

<cfoutput query="fileList"><a href="http://thenooblet.com/CFIDE/#fileList.name#">#fileList.name#</a><br></cfoutput>

<cfoutput>&numFiles=#fileList.recordCount#&</cfoutput>
</body>
</html>

Reply With Quote
  #9  
Old May 23rd, 2005, 09:49 PM
snip128 snip128 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 snip128 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 44 sec
Reputation Power: 0
hmm yea...the cfm works now except for the &numFiles=11& at the end (its still there) still...undefined in flash though...maybe ill take this to the flash section now that the cf pretty much works...maybe its that &numFiles=11& at the end though who knows...lol is it needed?

Reply With Quote
  #10  
Old May 24th, 2005, 08:07 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
Well you're putting that numFiles in there yourself, did you need it for something? If not, take this out:

<cfoutput>&numFiles=#fileList.recordCount#&</cfoutput>

Reply With Quote
  #11  
Old May 24th, 2005, 08:14 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
And I have no idea how you are feeding this to Flash. If I were you I would look at using CFCs and Flash Remoting to send data to the Flash client. It's all in the docs.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > directory listing/linking with CF and flash


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway