4 Replies Latest reply on Nov 6, 2007 4:31 AM by mumbaimerijaan

    Help setting ContentPath to a variable

      I am using Flash CS3 to build a website. The content for each page is encapsulated in a movie symbol. Therefore, as you click on the nav of the site the corresponding movie symbol will display.

      Each movie symbol is pulling in extrenal content. The text areas are working perfectly. Using an HTML file, I am assigning variables to the external text. Then I use the properties GUI to assign each text area the corresponding variable.

      However, I am having a problem with the Loader component. In the same HTML file, I am assigning a variable to the path of each external image I want to use. Using the GUI, I am trying to assign this variable to ContentPath in the component parameters. On the parameters tab, I am setting ContentPath to: _root.page1_tphoto01

      It is not working. I can only get it to work by hard coding the ContentPath to the image's physical path. Can someone please help a brother out?
        • 1. Re: Help setting ContentPath to a variable
          kglad Adobe Community Professional & MVP
          that's not as3 code. are you publishing for as2?
          • 2. Help setting ContentPath to a variable
            hcaraway Level 1
            Yes I am publishing it as Flash 7 for compatibility reasons.

            I am not sure how you can tell what version of AS I am using based on my variable call. I declared all my variables in the external HTML (named tfile_main.html) by using the following code in my first frame using the following AS:
            url = "tfile";
            loadVariablesNum(url+"_main.html", 0);

            My variable is defined in my external HTML file as:

            It would be nice if the property inspector GUI had an input field for VAR the way that TextArea does. It doesn't so instead I was hoping that entering the variable (_root.page1_tphoto01) in ContentPath under the Parameters tab would produce the same effect but it did not.

            I am assuming I need to assign the variable somehow to myloader.contentpath but I am not sure.
            • 3. Re: Help setting ContentPath to a variable
              fanglinyong Level 1
              i agree with with what kglad said! not flash 7,is AS2.0!
              • 4. Re: Help setting ContentPath to a variable
                It willnot work since you are setting the contentPath in the parameters panel, and you are loading the variable with data dynamically. What I suggest is that when you haver loaded the data in the variables, you can set the contentPath dynamically. like myLoader.contentPath=myVar;
                Let me know your views on this.
                By the way, it doesnt matter whether AS2 or AS3 :)