4 Replies Latest reply on Sep 6, 2008 9:06 PM by Hugh Anderson

    Can someone help me with this code?

    Hugh Anderson Level 1
      Hi all,

      I have a Flash component that links to a gallery, and I understand that I can create buttons to point to multiple galleries. (waiting too long for support from the suppliers)

      The User Guide says that I can use the following to create the connection:


      That won't work, and it says that I need to include it in an onclipevent. I have no idea what i am doing and I was hoping someone could tell me what to script to get the text button I created to run this.

      Help would really be appreciated.


        • 1. Re: Can someone help me with this code?
          Hi Hugh,

          A couple of things to start you off....

          Is this to do with Simpleviewer? Are they the suppliers you talk of?

          Shouldn't the (24) be ("24.xml") ? Doesn't the function have to access a xml file (string) and not a number?

          Then you need a button (myLoadGalBtn) with the following code:

          myLoadGalBtn.onRelease = function () {



          • 2. Re: Can someone help me with this code?
            Hugh Anderson Level 1

            thanks for the reply, I REALLY appreciate it!

            The component is supplied by Flashloaded. It is their TN2Gallery, attached to then TN2Admin control panel. The number 24 refers to the gallery number. So, on loading the site I have gallery ID 5 set as the default, and I understand that I can link to other galleries using the ID number.

            I am thinking that I want to put buttons on my home page, each button opening one of several galleries. Am I able to list all the galleries and buttons in one piece of code? In the coding area of the Actionscript, they have code that you can drag in, and that is where the example I gave earlier came from (as well as being in the User Guide as shown below.

            Thumbnailer2 Methods
            Flash Player 8
            myThumbnailer2.loadGallery( id:Number )
            id - Number. id of the fCMSPro gallery document.
            Method. Loads TN2Admin defined gallery.
            The following code will load gallery with id 24:

            It's all Greek to me! I just can't seem to figure it out.

            • 3. Re: Can someone help me with this code?
              Kol-001 Level 1
              Hi Hugh,

              You are right in that you can link to other galleries using the ID number (but, I assume, only TN2Admin (fCMSPro gallery document) defined galleries) with the code supplied.

              I think this may help - I'm a newbie with actionscript and I know nothing about Flashloaded so I may be way off beam here, but....

              First define a variable, this will be used in the 'show' (that's show, not load) gallery element of your code:

              var galNum: Number;

              Make as many buttons as required to launch a gallery (you say "each button opening one of several galleries" so I assume you want 1 gallery per button) and give each an instance name.

              You then write the relevant code for each button function (assuming once more that the buttons are in the same frame) using the instance name (I use a separate layer in the frame to write actionscript and try not to attach code directly to objects - which then leads me to say yes you can put all the different buttons code in one frame)....

              myLoadGalBtn1.onRelease = function () {
              galNum = 24;

              myLoadGalBtn2.onRelease = function () {
              galNum = 25;

              notice the buttons have different instance names (the 1 & 2 at the end - but you can call them what you like).

              Then you can use other code supplied to actually show the gallery (using the variable generated in each button click). Some code from Flashloaded will be along the lines of:


              so my guess is you can replace the actual number with the variable galNum inside the brackets to use the number generated by whatever button was pressed, like:



              • 4. Re: Can someone help me with this code?
                Hugh Anderson Level 1

                thanks for your reply, I appreciate the help.

                In the end I decided to abandon using the component involved as it took 6 days for the vendor to reply to my question.

                I was still within my money back guarantee time. Thank you so much for trying to help.