|
|
|
#1 |
|
Registered User
Join Date: Sep 2007
Posts: 0
|
I need Actionscript Help with this! Anyone!!!
Hi evryone
Iv been banging my head against a brick wall for the last 3months ... i cant get any assistance anyware and its really driving me mad.... this is my problem... iv managed to put together a php script that reads the contents of the folder that the php file is in... so if theres 6files in a specific folder on your Apache server when you execute the php file in your web browser the output strings would be for e.g file3=getFiles.fla file4=getFiles.swf ....ect..! Right php working fine...ITS JUST FLASH thats being silly ..Right? heres my script! var myLoadVars:LoadVars = new LoadVars(); myLoadVars.onLoad = function(success:Boolean) { if (success) { for (var i = 0; i<10; i++) { var fileName = "file"; var fileNumber = i; var files = fileName+fileNumber; trace(files); myTree.dataProvider = [myLoadVars.file3,myLoadVars.file5]; } trace(myLoadVars.file3); } }; myLoadVars.load("http://localhost/listfiles.php"); If you wanna see the results for yourself just change localhost to moneyspiderr.com!! You see the "myTree.dataProvider = [myLoadVars.file3,myLoadVars.file5];" section that puts the php output results in the Tree component... i just want to add the "i" value to the file3 value so i get somthing like this "file"+i = file1,file2,file3 ect....as you can see i have accomplised that with this for (var i = 0; i<10; i++) { var fileName = "file"; var fileNumber = i; var files = fileName+fileNumber; trace(files); its just that when i now try to use that paticular string inside the [myLoadVars.file3,myLoadVars.file5];" statement like this [myLoadVars.files] the statement dont work!!! it returns a undefined value.....what would be the correct way to deal with this problem....please help...im going mad over here...lol if i can pull this off i would of created a flash tree menu that can read and display the content of your folder....if you aint got one of these then you can have a copy of my completed fla....... I hope you can help me...Thanx Jaden www.moneyspiderr.com |
|
|
|
|
|
#2 |
|
FK'n_dog
Join Date: Apr 2003
Location: "aaarf"
Posts: 9,176
|
The data of a tree component must be provided from an XML data source,
and needs to be well formed ( which yours is not, [use List Variables] ) so you need to manipulate the string from your php file to correct it, or manipulate it into well formed XML in Flash this is a method to correct the string in Flash - PHP Code:
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|