[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 660
  • Last Modified:

ActionScript 2.0 XML file path

Hello,
I am pretty new to ActionScript, and have done some coding in the past in .asp \ .aspx, but it is not my primary forte.  I am working on a site that has a page for project photo galleries, using a lot of the examples from kirupa.com.  I have a directory structure as follows:

root folder (containing projects.swf)
  |-->projects
      |-->project1 (containing image files, thumbnail images, and images.xml)

I am looking for advice on how to code projects.fla and resulting projects.swf so that when a button within this file is pressed, a variable containing the path to the .xml file and image files for a particular project is passed to the .swf file.  All of the examples I have seen to this point have the .xml file and the image files in the same directory as the .swf.  Or other suggestions?  I am working with AS 2.0, using Flash MX 2004.  Thanks in advance for any \ all advice you can pass along.
Russ
0
rdillion
Asked:
rdillion
  • 2
1 Solution
 
scooby_56Commented:
just change the file name from "images.xml" to "projects/project1/images.xml"

sample here...
xmlImages:XML = new XML();
xmlImages.ignoreWhite = true;
xmlImages.onLoad = function(ok){
  if(ok){
    trace("loaded fine: " + this)
  }else{
    trace("problem loading")
  }
}
 
//trigger the loading of the data
xmlImages.load("projects/project1/images.xml")

Open in new window

0
 
rdillionAuthor Commented:
Thanks for the advice scooby_56,
I have tried changing the path to the .xml file, addiing full paths to the images in the .xml file, etc. with varying results.  What I am really looking for is advice on the recommended way to code a .swf file so that a variable can be passed to it that contains the path to an .xml file in another directory, and load the .xml file so that it can find and open the images in the same directory as the .xml file.  I also need some help in exaclty how to pass the variable to the .swf as I am quite new to AS.
Thanks,
Russ

0
 
rdillionAuthor Commented:
After continuing with modifying paths, I have been able to make the site work as desired.  I would still like to find information on how to pass the path to a single .swf, instead of maintaining individual .swf files for each of the folders I would like to display a gallery for, but will continue efforts on that later.  Thanks again scooby_56 for taking a look.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now