zoukankan      html  css  js  c++  java
  • C# to SWF Flash Compiler

    Today I came across GOA WinForms for Adobe Flash, which allows you to write C# code in Visual Studio 2005 and compile it into a Flash SWF file. I was quite impressed, having been a C# web developer for some time now I thought this is great way to create Flash applications without having to become an expert at Flash or Flex. I have always found it difficult to get my head round the Adode interface for creating flash applications. I downloaded and installed the free version of GOA WinForms for Adobe Flash.

    GOA WinForms for Adobe Flash is promoted as:

    "GOA WinForms is an implementation of the standard System.Windows.Form .NET library for both Adobe Flash and Microsoft Silverlight. It allows .NET developers to write standard WinForms applications that will run on these two RIA platforms."

    There are over 40 samples that can be found in the folder C:\Program Files\NETiKA\GOA WinForms for Flash\samples. I had a good look through the samples; there are plenty of samples to start you off. I tried creating a simple application of my own. Initially it’s easy to forget you are writing code that will be compiled into flash rather than a fully fledged desktop application. I quickly noticed that not all of the System.Windows.Form namespace is implemented, just the bits that relate to what can be done in flash. You still have all of the restrictions of flash. GOA WinForms for Adobe Flash cannot be used with the Visual Studio debugger, this is due to Visual Studio not having access to what is happening inside of the flash SWF.

    Sample Hello World: < id="swfapp" classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" width="300" height="100" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" align="center"> 

    The sample loads the text from a flash parameter. It was quite straight forward to create. The compiled SWF file is quite large at 89KB I would expect only a few KB for this sort of thing in flash.

    Sample C# Code:

    using System; 
    using System.Drawing; 
    using System.Collections; 
    using System.ComponentModel; 
    using System.Windows.Forms; 
     
    namespace GOAApplicationStarter 
        public class MyForm : System.Windows.Forms.Form 
        { 
            Label label1; 
            private System.ComponentModel.Container components = null
     
            public MyForm() 
            { 
                InitializeComponent(); 
            } 
     
            private string GetParam(string name, string defaultValue) 
            { 
                AppDomain domain = AppDomain.CurrentDomain; 
                string paramValue = (string)domain.Parameters[name]; 
     
                if (paramValue == null
                { 
                    return defaultValue; 
                } 
                return paramValue;    
            } 
     
            protected override void Dispose(bool disposing) 
            { 
                if (disposing) 
                { 
                    if (components != null
                    { 
                        components.Dispose(); 
                    } 
                } 
                base.Dispose(disposing); 
            } 
     
            private void InitializeComponent() 
            { 
                SuspendLayout(); 
                 
                this.label1 = new System.Windows.Forms.Label(); 
                this.label1.Location = new System.Drawing.Point(10, 0); 
                this.label1.Width = 280; 
                this.label1.Height = 100; 
                this.label1.Font =  new System.Drawing.Font(this.label1.Font.FontFamily, 25 ); 
                this.label1.TextAlign =  System.Drawing.ContentAlignment.MiddleLeft; 
                this.label1.Text = GetParam("label""..."); 
                this.Controls.Add(label1); 
                this.BackColor = Color.Lime; 
                 
                ResumeLayout(false); 
            } 
     
            public static void Main() 
            { 
                Application.Run(new MyForm()); 
            } 
        } 
     

    I do think GOA WinForms for Adobe Flash is defiantly a tool for a specific purpose. It takes some tasks, like animation, that flash is good at and makes then difficult. A lot of tasks can more easily be achieved using Adobe Flash or HTML and AJAX or perhaps even Silverlight. I think in general flash is best saved for interactive components in a web site such as the nice charts in Google Analytics rather than full websites. 
    Sunday August 17 2008 07:37 p.m.
     
    本文转自:
  • 相关阅读:
    解决is not a supported wheel on this platform-解决pip has no attribute pep425tags-解决网上旧教程不适用的问题
    语音信号实验1-基于时域分析技术的语音识别
    解决 ModuleNotFoundError: No module named 'pip'
    Typecho如何上传模板和插件
    获取图片的URL链接(Typecho修改背景图片等都需要URL链接)
    ubuntu云服务器安装anaconda+jupyter配置
    ORACLE用户密码过期啦
    关于Nacos启动报如下错:nacos no javac in (usr/lib/jvm-1.8.0)
    记录一次华为云服务器给根目录扩容
    记录一次NFS快照es集群索引备份
  • 原文地址:https://www.cnblogs.com/googlegis/p/2978910.html
Copyright © 2011-2022 走看看