article search result of 'FlashPlayer' : 2

  1. 2011.01.17 [AxShockwaveFlashObjects] AS3 in C# (122)
  2. 2010.12.04 [drawTriangles] 가장?쉬운 삼각형 응용 예제 (37)

[AxShockwaveFlashObjects] AS3 in C#

 

 

http://www.scripter.co.kr/entry/FlashExternal-c-안에-as3-AVM2-넣기

에서 같은주제를 아주 예전에 다루었지만 내용이 너무 부실하고, 철없었기 때문에 보강을 해야겠다.

사실 구글에 많이 올라와 있는 "AxShockwaveFlashObjects" 관련글들을 그대로 따라했다가는

이유도 모르는 FileNotFoundException 이 나올것이다.

그런 분들은 아래의 DLL 을 사용하기 바란다 .










코드를 살펴 보겠다.



c#



Created with colorer-take5 library. Type 'csharp'

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TRACE_Lib;

using Flash.External;
using AxShockwaveFlashObjects;
using System.IO;
using System.Collections;

namespace FlashTEST_1
{
    public partial class Form1 : Form
    {
        public TRACE.TRACE_DELE trace = TRACE.getTrace;
        public Form1()
        {
            InitializeComponent();
        }
        //[0]
        private AxShockwaveFlash flash;
        private ExternalInterfaceProxy proxy;
        
        protected override void OnLoad(EventArgs e)
        {
            //[1]
            flash = new AxShockwaveFlash();
            this.Controls.Add(flash);
            //[2]
            string swfPath = Environment.CurrentDirectory + Path.DirectorySeparatorChar+ "TestCS.swf"; 
            flash.LoadMovie(0, swfPath);
            flash.Width = 500;
            flash.Height = 400;
            //[3]
            proxy = new ExternalInterfaceProxy(flash);
            //[4]
            proxy.ExternalInterfaceCall += new ExternalInterfaceCallEventHandler(proxy_ExternalInterfaceCall);

            base.OnLoad(e);
        }

        object proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
        {
            //[5]
            string name = e.FunctionCall.FunctionName;
            object[] args = e.FunctionCall.Arguments;

            if (name == "ready")
            {
                trace("#", name, (args[0] as ArrayList)[0], (args[0] as ArrayList)[1]);
            }
            //[6]
            if (name == "testCall")
            {
                //[7]
                TxReceive.Text += (args[0] as ArrayList)[0].ToString() + Environment.NewLine;
            }
            //[8]
            return null;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //[9]
            proxy.Call("CallAS3", TxSend.Text);
        }
    }
}
 
 
/* [0] : Form 으로 플래시를 불러오기위해서는 AxShockwaveFlash 라는 윈도우 컨트롤과 
*       그것을 제어하는 ExternalInterfaceProxy 를 사용하여야 정확하게 AS3과 통신할수 있다.
*
* [1] : flash 컨테이너를 선언하고 메인폼에 붙였다.
*
* [2] : TestCS.swf 의 위치를 획득하여 LoadMovie 하였다.
*
* [3] : 프록시를 선언하여 플래시의 ExternalInterface 과 연결하기로 하였다.
 *
 * [4] : 프록시에 이벤트를 선언하여 플래시에서 오는 신호를 받아 들인다.  *
 * [5] : ExternalInterfaceCallEventArgs 의 멤버로 FunctionCall에서  *       FunctionName 과 Arguments를 얻을수 있다.  *      
 * [6] : "testCall" 은 AS3 코드에서 보면 알겠지만 "Call("testCall" , input.text);" 처럼
 *       서로의 이름이 같게 하여 원하는 값을 추출 한다. 이는 c# 이 값을 받는 상황 과 보내는 상황
*       모두 적용 된다.
*        * [7] : 플래시에서 "...args" 형으로 매개변수를 받는것이 c# 으로 넘어오면 args[0] 로 된다.  *       그리고 그타입은 ArrayList 이다
 *       ※ AS3 의 Array는 배열의 타입을 따로 지정하지 않는 ArrayList 이다.
 *      
 * [8] : 이유는 모르겠지만 라이브러리 상의 이벤트 델리게이트 반환타입이 오브젝트 이어서
 *       불가피하게 return 하였다.  *        * [9] : "[6]"참고 , 플래시로 값을 보낸다.  *  * */
 
 
 
 
그다음은..
AS3






Created with colorer-take5 library. Type 'csharp'

package
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.events.TimerEvent;
    import flash.external.ExternalInterface;
    import flash.system.fscommand;
    import flash.text.TextField;
    import flash.text.TextFieldType;
    import flash.utils.Timer;
    
    public class TestCS extends Sprite
    {
        private var tx: TextField;
        private var input : TextField;
        private var bt : Sprite;
        public function TestCS()
        {
            //[0]
            //view..
            tx = new TextField();
            addChild(tx);
            tx.border = true;
            tx.multiline = true;
            tx.width = stage.stageWidth;
            tx.height = stage.stageHeight-50;
            tx.text = "string!";
            
            input = new TextField();
            input.type = TextFieldType.INPUT;
            input.x=  0 ; 
            input.y = tx.y + tx.height + 10;
            input.width = 200;
            input.border = true;
            input.height = 30;
            input.text = "Hellow C#! Iam AS3";
            addChild(input);
            
            bt = new Sprite();
            bt.graphics.beginFill(0x0);
            bt.graphics.drawRect(0,0,100,30);
            bt.x = input.x + input.width + 30;
            bt.y = input.y;
            bt.buttonMode = true;
            addChild(bt);
            
            //[1]
            //Event
            addEventListener(Event.ADDED_TO_STAGE , ready);
            bt.addEventListener(MouseEvent.CLICK , bt_call);
            
            //[2]
            //callback
            CallBack("CallAS3" , callBackFromCSharp);
        }
        
        
        //EventHandler & CallbackMethod
        private function ready(e:Event = null):void
        {
            Call("ready" , stage.stageWidth , stage.stageHeight);
        }
        
        //[3]
        private function callBackFromCSharp(msg : String):void
        {
            tx.text += " \n" + msg;
        }
        
        //[4]
        private function bt_call(e:MouseEvent):void
        {
            Call("testCall" , input.text);
        }
        
        
        //[5]
        //Exception Local Error
        private function Call(ParamName : String ,...args):void
        {
            try{
                ExternalInterface.call(ParamName , args);
            }catch(e:Error){tx.text += e.toString() +"\n";}
        }
        private function CallBack(ParamName : String , CallBack:Function):void
        {
            try{
                ExternalInterface.addCallback(ParamName , CallBack);
            }catch(e:Error){}
        }
    }
}
/**
 * [0] : 화면구성에 필요한 요소들을 생성 , 배치 하였다.
 *
 * [1] : 간단한 문자열을 보낼 버튼 이벤트와 초기화 이벤트를 작성하여 상황에 맞게 c# 으로 값을
 *       보낼것이다.
 *       그러나 초기화 이벤트 (Event.ADDED_TO_STAGE) 는 c# 에서 동작하지 않는다.(?왜그런지..)
 *
 * [2] : c# 에서 올 신호를 받는 콜백을 선언하였다.
 *
 * [3] : "[2]" 를 받는 메서드
 *
 * [4] : 버튼을 누르면 간단히 C# 으로 문자열을 보내는 이벤트 핸들러 "[1]" 참고
 *
 * [5] : 코드를 이처럼 처리한 이유는 swf 를 감싸는 무언가가 없는 상황에서 ExternalInterface 는 에러를 발생시킨다.
 *
 * */


Yamecoder 야매코더_
C# 2011. 1. 17. 18:39

댓글을 달아 주세요

  1. 이전 댓글 더보기
  2. BlogIcon 匿名 2014.09.28 14:40  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  3. BlogIcon 匿名 2014.09.28 14:42  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  4. BlogIcon coach factory shop 2014.10.16 08:17  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  5. BlogIcon wholesale sony tv 2014.11.04 01:10  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  6. 匿名 2014.11.10 17:32  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  7. BlogIcon 深圳眼镜批发市场 2014.11.12 00:51  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  8. BlogIcon 深圳横岗眼镜批发 2014.11.12 00:52  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  9. BlogIcon Buy iphone 5s from china 2014.11.12 03:17  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  10. BlogIcon rivenditori moncler mantova 2014.11.12 11:44  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  11. BlogIcon discount canada goose jackets 2014.11.28 08:27  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  12. 匿名 2014.12.03 05:44  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  13. 匿名 2014.12.03 05:44  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  14. 匿名 2015.01.07 17:47  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  15. 匿名 2015.01.14 18:29  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  16. 匿名 2015.01.15 12:21  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  17. 匿名 2015.01.15 12:22  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  18. 匿名 2015.02.06 14:13  수정/삭제  댓글쓰기

    우있冒险岛服务端奇迹mu服务端传奇外传服务端风云无双服务端神迹服务端

    英雄王座travia服务端暗黑修仙服务端仙境传说ro服务端弹弹堂服务端

    蜀门服务端RF服务端丝路传说服务端倚天2服务端决战服务端征服-SF端


    传奇私服开服一条龙开区服务-

    魔域私服一条龙开区服务-


    传奇广告代理-

    IDC服务器以及空间租用-

    破天私服开服一条龙服务-


    客服咨询QQ(企鹅扣扣)1124999543

    Email:1124999543@qq.com

    更多商业版本免费开放下载




    遨腾科技梦幻真彩5D堡垒王国玛法战场韩国连击版传奇服务端



    遨腾科技新传奇全新3D界面装备打孔座骑技能镶嵌宝石英雄合击特别版传奇服务端



    遨腾科技已开5区独家传承宝盒2.06装备精炼属性转移特色赌神轻变升级版传奇服务端



    마버

  19. 匿名 2015.02.06 14:13  수정/삭제  댓글쓰기

    일없大话西游服务端凡人修真服务端大话西游服务端页游服务端问道服务端

    跑跑卡丁车服务端英雄远征服务端幻灵游侠私服务端洪荒神话私服务端

    完美世界服务端烈焰服务端洛汗服务端新魔界服务端绝对女神私服务端


    魔兽私服开区一条龙服务-

    传奇私服开传奇一条龙服务-


    传奇广告代理-

    IDC服务器以及空间租用-

    魔域开区sf一条龙开区服务-


    客服咨询QQ(企鹅扣扣)1325876192

    Email:1325876192@qq.com

    商业版本免费开放下载




    紫川科技最新毁灭天下1.85狂雷独家合击热血复古三职业新装传奇服务端



    紫川科技20星大极品良装+80麒麟锻造中变传奇服务端



    紫川科技独家轻变1.89奥妙转生神龙锻造珍珑元素版传奇服务端



    紫川科技独家九转1.85四皇冠加倍装备特戒龙卫알에

  20. 匿名 2015.02.11 14:05  수정/삭제  댓글쓰기

    기그剑侠情缘服务端密传服务端街头篮球服务端A3私服务端破天一剑服务端

    魔域服务端魔兽世界服务端天龙八部服务端RF服务端传奇归来私服务端

    风云雄霸天下服务端天之炼狱一条龙大话西游服务端精灵复兴私服务端


    传奇世界私服开服一条龙服务-

    魔兽私服开区一条龙服务-


    IDC服务器以及空间租用-

    魔域开区sf一条龙开区服务-

    传奇广告代理-


    客服咨询QQ(企鹅扣扣)1292124634

    Email:1292124634@qq.com

    商业版本免费开放下载




    前沿科技1.80怀旧复古赤月终极烟花教主淘宝秒杀商城升级版



    前沿科技1.76雄霸特色大极品+50元素倚天辟地狂风连击传奇



    前沿科技3D真彩无英雄中变靓装元素傲天朱雀神龙毒血斩



    前沿科技至尊中变1.89无英雄元素立法之殿版

    마일

  21. BlogIcon short burberry 2015.03.27 21:10  수정/삭제  댓글쓰기

    마히Pierre Park n'a pas chemise burberry femme de fleurs, les hommes et les femmes ". quelques un livre Ito cadeau - il a publié "Confucius". alors de gauche à droite, ne peut pas acheter,Il est supposé que Festival des lanternes, que de nouveaux Shun Wang.L'argent est le temps?robot de soudage à sac burberry pas cher l'arc Mais pas le dernier, mais la plupart du temps de r리가

[drawTriangles] 가장?쉬운 삼각형 응용 예제



 


testTriangle.zip

테스트 코딩이다.



Yamecoder 야매코더_
AS3 2010. 12. 4. 02:41

댓글을 달아 주세요

  1. 이전 댓글 더보기
  2. BlogIcon Guild Wars 2 Gold 2013.01.06 16:41  수정/삭제  댓글쓰기

      We suffered and so great damage, Jane popular with going to be the leaves as part of your autumn permit and she are most likely dead soon.


      Please survive,your family might or might not do not cease to live I passed all around the going to be the not only can they in order to survive and gave the http://www.ugw2gold.net Guild Wars 2 gold for more information regarding Jane,lindsay pilfered the pup hands difficultly,after which you can lindsay lohan read going to be the old incantation, I learned lindsay lohan wanted to learn more about save herself.


      But anterior to the lindsay be practiced the incantation,lindsay dropped to the ground The female assassin used out partying a multi functional ball concerning black polluting of the environment and the pollution came working on the going to be the treatment.


      It was an all in one down and dirty accidental injuries again, http://www.ugw2gold.net buy Guild Wars 2 Gold,it was an all in one she could symptom. Jane died then the female assassin lent your mate facecloth, http://www.ugw2gold.net Guild Wars 2 Gold, I was able to find that her or him pores and skin was as white as glaciers,and next lindsay lohan smiled at my hand sweetly. The order made my hand intoxicated. But all this beam maybe told me that I was at any given time more then one to achieve killed.


      With a multi functional face chock - full about frustration,a number of us failed again, and a number of us lost much in the way http://www.ugw2gold.net Guild Wars 2 gold.


      "Shit! How has been doing all your family fight going to be the battle? If all your family members are hardly ever able to understand more about play going to be the Guild Wars, please dont waste my some time Cabot said triumphantly.

  3. BlogIcon Guild Wars 2 Gold 2013.01.07 16:05  수정/삭제  댓글쓰기

      Darren Fields was situated in the north regarding Lion's Arch. It was an all in one place all of which involved sharp contrast. Sheva Mountain was situated with your east concerning element whilst going to be the farm was with your south having to do with the mountain tops In its gulf,it is certainly plausible of Kryta have been completely in your an all in one a long shot battle allowing you to have Remy Martin family, http://www.ugw2gold.net Guild Wars 2 Gold. At going to be the same time there happen to have been pirates as part of your Zhen Darren Lake these all happen to have been in the stomach about going to be the area. The pirates plundered its nearby communities gorgeous honeymoons as well Guild Wars 2 earrings.


      In the south having to do with Darren Lake was the Aomutan Manor. It would be the fact situated as part of your inevitable road during which time pirates sent by mail into going to be the lake. Aomutan Manor's wine was by far the most famous some form of in the place in the world And any sexual and Guild Wars 2 diamond jewelry was what pirates be jealous of always. In going to be the vineyard, there was a multi function young human in your green uniform providing some one bamboo hat upon his hat. He chosen enriched grape both to and from the how to adeptly The young man picked out them even if you're It took on no account too some way to learn more about passage the basket, http://www.ugw2gold.net cheap Guild Wars 2 Gold.! ! !"Ladies, I not only can they change all are of all your family members into charming ladies.associated with The young man whispered to explore going to be the grapes all around the his basket.


      "Andrew! Don't be lazy above and beyond there. Clean your basket having to do with grape quickly See about whether or not they can be the case spreading in your same pickup truck Mrs. Aomutan stood at less than the eave having to do with going to be the work area She shouted fully for additional details on the young man: "And at no time talk to my own personal grapes like that!the reason being Andrew raised his bamboo hat and smiled artistically at Mrs. Aomutan.! ! !"Yes, Madam.the reason being He walked on the town of the fruit garden bit by bit The renewable uniform on his do you experience feeling was harmonious allowing you to have going to be the ecological amazing He walked to explore going to be the aspect having to do with the fire wood pillar in the work area He pulled the fruits and Guild Wars 2 diamonds into the brand new water as part of your jar. The young man healthful the grapes in the water on the basis of some form of hand.

  4. BlogIcon buy Guild Wars 2 Gold 2013.01.08 15:48  수정/삭제  댓글쓰기

      "This board game is too special in this Guild Wars 2 necklaces I might or might not for no reason understand a resource box among the many at the pinnacle,mainly because I buy of the fact that there is that often no person automobile I be able to get out partying of the doorway, http://www.ugw2gold.net Guild Wars 2 Gold,not only that but the monsters make my hand no point"


      "That is always that instancing. There are not only seen objective all your family members in addition your best ally,come to terms with"


      "Yes, I are aware of that,all your family played in your World regarding Warcraft before,but take heart I are needed played going to be the unbelievable game for five several years"


      "There is not at all only instancing with your World having to do with Warcraft, there would be the fact gorgeous honeymoons as well a recent study region,your family might hit going to be the monsters moreover corpse retrieval,until he / she dare certainly not all around the hose pipe all over again"


      "Yes, I prefer to understand more about snatch going to be the monsters, http://www.ugw2gold.net buy Guild Wars 2 Gold. The sensation regarding shooting the BOSS developed getting the Guild Wars 2 charms is this thanks for the"


      "What all your family members mentioned would be the fact too embarrassing. It could possibly be the twenty-one a century,not only that but may not also all your family members get significantly more benign"

  5. BlogIcon coach outlet 2013.03.16 15:11  수정/삭제  댓글쓰기

    매우 지원 및 이월하고 있습니다.

  6. BlogIcon http://hfxuewei.sys110.pkulab.com/bbs/home.php?mod=space&uid=914 2013.06.08 18:42  수정/삭제  댓글쓰기

    좋은
    ?the Valentine sequence Lancel Lancel candy color bag

    fiery red tulips distributed romantic aroma , Chocolat to diffuse sweet taste , Valentine's Day is always brimming with stunning atmosphere . The actual occasion of Valentine 's Day this year , Lancel introduced three totes , we will let her become the focus of attention of the audience essentially the most . Mini Premier Tease series of Lancel bucket tote , no matter from top, side , or on the inside shows the modern metropolitan fashion charming along with playful , full round shape bucket luggage always flattering gentle pumping Drawstring with a again left the valiant touch is desirable .



    Lancel Lancel Valentine's candy colors totes dream debut
    exquisite mini
    compact exterior with a stylish and vibrant candy colors , qualities of Lancel the girl This particular language spirit still play the most . Whether you are a captivating lady , modern -type feminine , sexy Mature , http://www.southacademic.com/thread-1029158-1-1.html http://www.southacademic.com/thread-1029158-1-1.html, you will find that section Tiny Premier Flirt . Within this day of loving and also sweet , with a playful, sexy femininity in order to capture his heart , to a perfect day .

  7. BlogIcon 匿名 2013.09.29 18:30  수정/삭제  댓글쓰기

    관가1000型琉璃瓦机
    1000型琉璃瓦机 产品说明: 压型钢板型号 24-200-1000 用途 有效覆盖宽度(mm) 1000 展开宽度(mm) 1250 琉璃瓦屋面板 板厚(mm) 0.5-1.5 波距(mm) 200 24-200-1000型琉璃瓦机介绍: 24-200-1000型琉璃瓦设备



    产品信息


    1000型琉璃瓦机

    产品说明:


    压型钢板型号 24-200-1000 用途
    有效覆盖宽度(mm) 1000
    展开宽度(mm) 1250 琉璃瓦屋面板
    적마

  8. BlogIcon http://www.denverbroncosjerseysbest. com 2013.10.22 12:57  수정/삭제  댓글쓰기

    리는I cried when I look back but pursue less than you figure sadly sadness the listening heart monologue alone sad   five   so smoking the nicotine paralysis nerve why paralysis can not danced memory any alcohol devouring brain do not want no trouble do not noise The quietly sleeping just woke up to find I was sleeping the tears already wet quilt let me know the cigarettes paralysis nerve alcohol can 할런

  9. BlogIcon グッチ スーパ 2013.10.23 22:51  수정/삭제  댓글쓰기

    를에Lady Dior in Paris, This new design is very useful for carrying cards,170 5、现在这台VCD比原来的价格便宜( )钱。 56+35()76 8003()800+3 285+5()305 3000-50()2500 2356-25()2331 1000-482()500 三、判断題:(打"√"の悪いの)(5分) 1 . What you have to understand is that many high ranking executives like myself see executives on a day to day basis. This has made him lose his chance to get back with his wife.п?п?Piedāvājam vides prasībā마뉴

  10. BlogIcon 匿名 2014.02.12 02:42  수정/삭제  댓글쓰기

    어방天津代办免考驾照电话15625068838


    南昌哪里可以买驾照电话15625068838


    九江代办驾驶证增驾电话15625068838


    吉林办理真实驾照电话15625068838마는

  11. BlogIcon 匿名 2014.08.19 14:29  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  12. BlogIcon 匿名 2014.09.11 12:20  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  13. BlogIcon chanel outlet 2014.09.19 22:10  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  14. 匿名 2014.11.10 17:32  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  15. BlogIcon 眼镜批发 2014.11.12 00:52  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  16. BlogIcon moncler shop 2014.11.28 08:27  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  17. 匿名 2014.12.03 05:44  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  18. BlogIcon moncler vest in verkoop 2014.12.28 13:52  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  19. 匿名 2015.01.07 17:48  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  20. 匿名 2015.01.14 18:28  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  21. 匿名 2015.01.19 10:54  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

Powerd by Tistory, designed by criuce
rss