11 Replies Latest reply on Oct 21, 2010 5:16 AM by Ned Murphy

    Need help to find link to external AS2 file

    David C Anderson Level 1

      I have purchased an image gallery program that works fine but I am struggling to make a very minor modification. I have asked the author for assistance but previous requests have met with no response so I am also asking my question here.

       

      This program has most of its logic in an external AS2 file. I have made some small changes to this file and want to save it under a new name. However, that would also require me to change the reference to the external AS2 file from within the fla file. That's where my problem lies. I can't find any code in the fla that contains such a reference.

       

      If I try to publish an swf without this file in the required location it causes a compiler error thus proving that there must be a reference somewhere to that file. However, doing a search for this AS2 file in the 'current document' when viewing the fla file in Flash CS4 produces no results. Where else could this reference be hidden?

       

      David

        • 1. Re: Need help to find link to external AS2 file
          Ned Murphy Adobe Community Professional & MVP

          When you first open the fla file, look in the properties panel and see if the file appears in the Document Class field.

          • 2. Re: Need help to find link to external AS2 file
            David C Anderson Level 1

            Hi Ned,
            Thanks for the suggestion, but when I look at the Properties panel in Flash CS4 for my fla file I don't see any mention of a Document Class. All I see are an FPS setting and size and background colour settings for the stage.

             

            David

            • 3. Re: Need help to find link to external AS2 file
              Ned Murphy Adobe Community Professional & MVP

              I don't have CS4, so I can't say for usre, but here's a link to a discussion that has a picture of where you'll find it if it's there.

               

              http://active.tutsplus.com/tutorials/actionscript/quick-tip-how-to-use-a-document-class-in -flash/

              • 4. Re: Need help to find link to external AS2 file
                David C Anderson Level 1

                With the help of your link, I've now found where document class info would be provided if there was any. Rather confusingly, that panel has the title of Properties and then a section within it also called Properties, which is where I looked before. The box containing any class references is simply labelled Class and is in the section called Publish.

                 

                Unfortunately, however, this Class box is greyed out as it is only supported by projects that target Flash Player 9 and ActionScript 3.0. My application uses AS2 and is targeted at Flash Player 8. The reference to my external AS2 file must therefore be stored somewhere else.

                • 5. Re: Need help to find link to external AS2 file
                  Ned Murphy Adobe Community Professional & MVP

                  What does the .as file code look like?  You don't have to show all of it, maybe just the first so many lines in it.  THat'll indicate whether it is a class file at all or just an actionscript file.

                   

                  Since it is an AS2 file there are more places you might need to look as compared to an AS3 file.  Where have you looked within the fla to find the code?  Aside from code on a timeline, AS2 allows code to be attached to objects, so have you checked there?  And have you looked inside any movieclips in the file to see if there is code in them?

                   

                  And the design might use scenes, so have you checked to see if it does?

                  • 6. Re: Need help to find link to external AS2 file
                    David C Anderson Level 1

                    After various Import statements, the first line of my external AS2 file is as follows,

                    class net.lucidstudios.KIZoomSlideshow extends MovieClip {

                     

                    There is one scene in the fla file and a handful of objects in the library, most of which are just symbols such as play, pause, next and previous. There is no embedded movieclip as the whole purpose of the application is to display external images referenced from an xml file.

                     

                    I will check through each of the library items once again but I didn't see anything the first time. However, I am a Flash newbie and am a little vague about how best to search for code attachments. I have assumed that you do this via Actions but all I ever see there is the code associated with Scene 1. Where do you find code that is not linked to the timeline?  

                    • 7. Re: Need help to find link to external AS2 file
                      Ned Murphy Adobe Community Professional & MVP

                      That .as file is definitely a class file based on what you described, not just an included actionscript file.  You might be able to find it linked via the objects in the library.  Right click each movieclip object in the library and choose the Linkage option in the menu that appears.  You should see an interface that has fields for an Identifier and a Class.  You might find the file tied in that way.

                       

                      To find code attached to objects you need to have the Actions panel opened and just click on an object on the stage, like a button or whatever.  Whatever code is attached will appear in the Actions window.  The ability to attach code like this was discontinued when AS3 was released.

                      • 8. Re: Need help to find link to external AS2 file
                        David C Anderson Level 1

                        Found it!

                         

                        The class reference was in the Linkage section of the Symbol Properties panel for one of the library objects. Needless to say, it was the very last item in the library list. Is all this repetitive clicking on object after object really the only way to find such references? Is there no global search that will find such things?

                         

                        Thanks, Ned, for sticking with it. You got me there in the end and your assistance is much appreciated.

                         

                        David

                        • 9. Re: Need help to find link to external AS2 file
                          Ned Murphy Adobe Community Professional & MVP

                          In the top menu bar under the Window option you should be able to find a Movie Explorer option in the menu.  I think that can take care of collecting all the actionscript in the file if you select the options to show the code and movieclips and stuff.  But I don't know if it does anything to show the classes that are tied in to library objects.  You should look and see and let me know.  I didn't remember to suggest this mainly because I never have had a need to use it... it's more of a hearsay thing to me.

                          1 person found this helpful
                          • 10. Re: Need help to find link to external AS2 file
                            David C Anderson Level 1

                            Unfortunately, the Movie Explorer window does not show class references of the type under discussion. I guess an alternative way to reference this external file might be via an include statement in an action, which would make it a lot easier to find than when it is hidden in the properties box of a library symbol.

                             

                            However, the Movie Explorer appears to be a useful facility for finding and searching timeline actions so thanks for bringing it to my attention. I used it for a brief exploration of another fla file with lots of code scattered all over the place.

                             

                            Thanks again for all your help.

                             

                            David