본문 바로가기

AS3

[as3 byteArray]오브젝트 변환과 복제 와 전송


Created with colorer-take5 library. Type 'csharp'

//타겟 ��브젝트 (��브젝트)
                var s:Object = {a:"aaa" , b:123};
                //변�� 바이트어레이
                var ba:ByteArray = new ByteArray();
                //바이트를 쓴다
                ba.writeObject(s);
                //바이트 포지��을 0 로 돌린다 (중요!)
                ba.position = 0;
                //바이트 출력
                trace(ba);
                //바이트를 변����여 출력
                trace("read" , ba.readObject().a );
                ba.position = 0;
                //바이트�� 타입검사
                trace("type" , ba.readObject() is Object );
                ba.position = 0;
                
                
                /*
                *  ba   전  송
                */
                
                
                //받을 바이트어레이
                var ra:ByteArray = new ByteArray();
                //바이트�� 적제(복사)
                ra.writeBytes(ba);
                ra.position = 0;
                //바이트�� 복원
                trace("2read" , ra.readObject());
 
 
 

덧글

  • hika 2010/05/27 19:41 # 삭제 답글

    그러니까 {}안에는 프리머티브외에도 많은 참조가 포함되죠.
    int, number, string, object, vector, array 등은 성공적으로 복사가 됩니다만
    Function, 다른 오브젝트는 복사되지 않습니다.
    {end:function(){}}
    이렇게 되면 복사후엔 아무것도 없죠. 배열도 마찬가지인데
    {arr:[3,function(){},4]}
    이렇게하면 arr자체야 있지만 arr[1]에는 아무것도 없습니다.

    그래서 무식하게 복사하는게 가장 안전합니다.
    clone = {};
    for( key in origin ){
    clone[key] = origin[key]
    }
  • superSC 2010/05/27 19:44 # 삭제 답글

    아 ^^ ; 그렇쿤요. 예전엔 몰랐는데 Object { } 로 참 많은 일을 할수 있는거 같아요
  • 이전 댓글 더보기
  • BlogIcon 匿名 2014.10.17 12:42

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

  • BlogIcon 匿名 2014.10.17 12:42

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

  • BlogIcon woolrich uomo 2014.10.19 18:54

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

  • BlogIcon barbour outlet 2014.10.21 20:40

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

  • BlogIcon meizitang soft gel 2014.10.21 20:42

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

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

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

  • BlogIcon 深圳眼镜批发 2014.11.12 00:50

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

  • BlogIcon Buy ipad 5 online 2014.11.12 03:16

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

  • BlogIcon Ralph Lauren sale 2014.11.23 08:08

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

  • 匿名 2015.01.07 17:45

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

  • BlogIcon clubmaster Sunglasses 2015.03.05 17:04

    메립You're rather than on your own employingdegentlebecause you practicethat you simplyr curhirecarrying a kid analyze is also postive. you'll be able to seek out yourself by now caressing your abdominal praying that you simplyr particular little you can sense people. Another eight weeks will be an exilerating time to fit your needs at the side of your newborn. you will have an overly person living ma하뉴

  • BlogIcon achat chemises burberry 2015.03.21 07:22

    우다URL aIci,achat chemises burberry相关的主题文章:크뉴

  • BlogIcon Burberry sac 2015.03.31 00:03

    일우URL aIci,chaussure burberry homme pas cher,http://basketburberrypascher.moonfruit.fr相关的主题文章:


    相关的主题文章:종는

  • 匿名 2015.03.31 08:50

    메일Believe it or not, the week leading up to February 14th was on a par with the Christmas season in terms of raised spending levels. Online shoppers the country over scoured the internet for special gifts and pet presents; showing us that there really are no limits to what you can do and sell within your online shop. An ecommerce software package costing as little as ��20 a month will provide you wi부에

  • 匿名 2015.04.01 06:28

    법버火车采集器html简单模板示范






    What Is Vinyl Graphics?







    [标签:来源]








    Vinyl Graphics is the new alternative to paint. Because Vinyl is a type of material that can easily be attached onto and detached from almost any surface,Quinn Car Insurance_125852, design enthusiasts and advertisers alike have taken interest. One good thing about Vinyl is that it is cheaper to use and qui는메

  • 匿名 2015.04.03 17:37

    표있Amazon repeatedly emphasizes the benefits of a dedicated e-reader, over other portable electronic devices. According to Amazon, the Kindle uses a specially made electronic "ink" that looks like paper to the eye, and can be read clearly even in direct sunlight. Studies confirm that, the brighter the ambient light, the clearer the words become - just like regular paper. In addition, the Kindle boast비리

  • 匿名 2015.04.05 10:19

    메습and even better news is that their greatest extent EVER!Beautiful flowers and fittings add a touch of tartan jackets that unmistakable feminine essence, while injections of red.



    Purple and orange make this the biggest ever range of colors.Barbour waxed jackets, Barbour International Quilt Jacket,Top 7 Shopping Cart Advantage, Jackets Barbour Polar Quilt .


    For most people, the thought o리지

  • 匿名 2015.04.06 01:07

    알뉴火车采集器html简单模板示范






    Affiliate Marketing - It's Your Decision Or Continue to Be Sick and Tired







    [标签:来源]








    Are you sick and tired of working 9 to 5 getting paid then being broke the next day? Are you sick and tired of standing in the unemployment line and no one is hiring or the hourly rate is so low you are wondering how will you support your family? Are you si단일

  • 匿名 2015.04.09 00:24

    스에and even better news is that their greatest extent EVER!Beautiful flowers and fittings add a touch of tartan jackets that unmistakable feminine essence,Freeing Horsepower_118569, while injections of red.



    Purple and orange make this the biggest ever range of colors.Barbour waxed jackets, Barbour International Quilt Jacket, Jackets Barbour Polar Quilt .


    Secret shopping is a great way to 예분