3 Replies Latest reply on Jan 10, 2014 4:37 AM by Ned Murphy

    Can anyone help me modify a fully functional SWF file to behave slightly differently?

    bradwaters

      I have a working SWF file which I used a free decompiler to get to the ActionScript of.  I do not know Actionscript, but I know enough other languages to have a vague understanding of whats going on.  I am not certain if this is Actionscript 1 or 2 or 3 honestly so I simply posted here.  The main thing I need to understand is the order in which code is executed within Actionscript.  What I'm trying to do is make a telnet applet which initializes with a giant connect button simply connect by default upon initializing and then if the connection is lost of disconnected function as normal and display the connect button again.  I believe this should be a fairly simply modification just moving a few lines of code around, I just do not have a good grasp on ActionScript.  If someone out there is willing to work briefly on this with me, you would have my gratitude greatly, or even any brief explanation anyone can offer as to what I may want to look into. It looks similar to java, but I just am not sure on too much to want to try to tackle this blindly.

        • 1. Re: Can anyone help me modify a fully functional SWF file to behave slightly differently?
          Ned Murphy Adobe Community Professional & MVP

          You should start by showing at least a snippet of the code so that you can post in the correct forum.

          • 2. Re: Can anyone help me modify a fully functional SWF file to behave slightly differently?
            bradwaters Level 1

               public class FlashTerm extends Sprite
               {
                 
                  public function FlashTerm() {
                     super();
                     trace("test");
                     this.stage.align = StageAlign.TOP;
                     this.stage.quality = StageQuality.BEST;
                     this.stage.scaleMode = StageScaleMode.EXACT_FIT;
                     drawContextMenu();
                     drawBorder();
                     DisplayShortcuts.init();
                     init();
                  }
                 
                  public static var EMBEDDED_FONT:String = "FlashTerm_EMBEDDED_FONT";
                 
                  public static const h:Number = 440;
                 
                  public static var EMBEDDED_FONT2:String = "FlashTerm_EMBEDDED_FONT2";
                 
                  public static var debug:TextField;
                 
                  public static var ansiViewer:MultiFontViewer;
                 
                  public static const w:Number = 650;
                 
                  public static var defaultFontName:String;
                 
                  private function handleCancelClicked(param1:MouseEvent) : void {
                     var _loc2_:DownloadPanel = DownloadPanel(param1.currentTarget.parent);
                     _loc2_.download.removeEventListener(MouseEvent.CLICK,handleDownloadClicked);
                     _loc2_.cancel.removeEventListener(MouseEvent.CLICK,handleCancelClicked);
                     Tweener.addTween(_loc2_,
                        {
                           "alpha":0,
                           "y":h / 2 - 10,
                           "time":0.4
                        });
                  }
                 
                  private function handleLoadComplete(param1:Event) : void {
                     var e:Event = param1;
                     var xml:XML = XML(e.currentTarget.data);
                     serverName = xml.@name.toString();
                     serverAddress = xml.@address.toString();
                     serverPort = xml.@port;
                     serverSocketPort = xml.@socket_server_port;
                     defaultFontName = xml.@default_font.toString();
                     columnWidth = xml.@columns == undefined || xml.@columns == ""?80:xml.@columns;
                     lineHeight = xml.@lines == undefined || xml.@lines == ""?25:xml.@lines;
                     if(serverSocketPort != 843)
                     {
                        try
                        {
                           Security.loadPolicyFile("xmlsocket://" + serverAddress + ":" + serverSocketPort);
                        }
                        catch(error:Error)
                        {
                           status.setStatus("Error: Socket security not configured");
                        }
                     }
                     if(xml.@info_graphic.toString() != "")
                     {
                        loadGraphic(xml.@info_graphic.toString());
                     }
                     else
                     {
                        readyToConnect();
                     }
                  }

            • 3. Re: Can anyone help me modify a fully functional SWF file to behave slightly differently?
              Ned Murphy Adobe Community Professional & MVP

              That's AS3 code so you should be posting any questions in the AS3 forum (http://forums.adobe.com/community/flash/flash_actionscript3?view=discussions).  When you post again you should try to identify what about the code has you wondering about the order of processing it.