6 Replies Latest reply on Apr 26, 2010 9:39 AM by Paul2610

    links between swf files

    Paul2610 Level 1

      Hi All


      I have (or will have) two gallery swf files which I would like to link together. As with most flash I've done recently it is by following the 'classroom in a book' - chapter 9 goes over connecting different pages together using the code below which I did alter to hopfully fit in with my documents;


      cloud.addEventListener(MouseEvent.CLICK, portfolio_flash_2content);

      function portfolio_flash_2content(myevent:MouseEvent):void {

      var myURL:URLRequest=new URLRequest("portfolio_flash_2.swf");

      myLoader.load(myURL); addChild(myLoader); }


      I am using a shape (cloud) as the trigger on the first page

      the second swf is called portfolio_flash_2


      Unlike in the book I have added this script to other script which deals with the buttons of larger images on my gallery.


      upon testing the page with this script I get a function problem plus all the larger images keep showing instead of stopping - I have managed to sort out most problem but as this involves script I need help again.


      Is there a simpler way to connect swf files together? or does my script just need sorting out or can it be placed in a different layer?


      cheers for any help



        • 1. Re: links between swf files
          Ned Murphy Adobe Community Professional & MVP

          If you are getting error messages, show the complete messages.

          • 2. Re: links between swf files
            Paul2610 Level 1

            description - 1120: Access of undefined property cloud.


            source - cloud.addEventListener(MouseEvent.CLICK, portfolio_flash_2);


            I dare to assume that reading this error that it has something to do with the 'cloud'. As stated before it is a shape and labeled as a cloud or could be something else?


            The whole plan for this is to create a link from this gallery portfolio swf (http://www.mtn-m.co.uk/Portfolio_flash.html) to a second one within the same window and position (the cloud stated above would be those shown in the first galley above the house - I did want to have the number 2 ( for page 2) to use as a text link to the next portfolio but did'nt know how to make this the trigger.


            cheers for your help.



            • 3. Re: links between swf files
              Ned Murphy Adobe Community Professional & MVP

              You keep describing cloud as a shape.  Is it a movieclip object?

              • 4. Re: links between swf files
                Paul2610 Level 1

                no its just a shape I made in flash


                There is a movie clip involved - as in the motion tween of a smaller cloud which climbs up out of the chimney and grows as it reaches a point in the top left corner, but then I made that fade out to be replaced by the shape (both on different time lines).


                Why did I create a shape - I did think it was needed for the mouseclick event. - now I see that all I have labeled the instance of (i.e. cloud) are the frames containing the cloud and not the shape, whereas a movieclip instance can be named - or am I wrong!!

                • 5. Re: links between swf files
                  Ned Murphy Adobe Community Professional & MVP

                  You cannot interact with a shape.  You need to convert it to a movieclip, assign it an instance name of "cloud" via the properties panel, and then your code should work as long as they are all in the same frame (not the same layer, just the same frame).

                  • 6. Re: links between swf files
                    Paul2610 Level 1

                    ye its working now - get this error message - Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. But I presume thats just because I hav'nt saved a swf of the portfolio_flash_2 yet. But cheers for your help is a really good feeling when everything works as planned!!!


                    Also figured out that if I need to use bones (as I will be doing for the motion of walking etc) I can save my graphics as symbols in illustrator and import or paste them straight in - could'nt be simpler - he's says


                    cheers ned