독도 광고 모금 캠페인

'ADOBE ACTIONSCRIPT'에 해당되는 글 2건

  1. 2008.09.22 ARRAY상태로 들어온 XML 데이터로 XML만들기 by 이현호
  2. 2008.08.04 [펌] 19가지 AS로 만들어진 라이브러리들.. by 이현호
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/11/04/positioning-labels-in-a-flex-piechart-control/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">
    <mx:Script>
        <![CDATA[
         import mx.controls.Alert;
         import com.hexagonstar.util.debug.Debug;
      private var _datas:Array = [ ["Level 1" , "1" , "Data 1-1","Data 1-2","Data 1-3","Data1-4","Data 1-5"],
          ["Level 2-1" , "2" , "Data 2-1","Data 2-2","Data 2-3","Data 2-4","Data 2-5"],
          ["Level 3-1" , "3" , "Data 3-1","Data 3-2","Data 3-3","Data 3-4","Data 3-5"],
          ["Level 4-1" , "4" , "Data 4-1","Data 4-2","Data 4-3","Data 4-4","Data 4-5"],
          ["Level 4-2" , "4" , "Data 5-1","Data 5-2","Data 5-3","Data 5-4","Data 5-5"],
          ["Level 2-3" , "2" , "Data 10-1","Data 10-2","Data 10-3","Data 10-4","Data 10-5"],
          ["Level 3-2" , "3" , "Data 6-1","Data 6-2","Data 6-3","Data 6-4","Data 6-5"],
          ["Level 2-2" , "2" , "Data 7-1","Data 7-2","Data 7-3","Data 7-4","Data 7-5"],
          ["Level 3-3" , "3" , "Data 8-1","Data 8-2","Data 8-3","Data 8-4","Data 8-5"],
          ["Level 3-4" , "3" , "Data 9-1","Data 9-2","Data 9-3","Data 9-4","Data 9-5"] ];
  
      private var _valueCount:int = 5;
            public function makeXMLClick():void
            {
             xmlData();
            }
       
            protected function xmlData():void
            {
             var dataLen:int = _datas.length;
             var mainXML:XML = new XML(<node />);
             var makeXML:XML = null;
             var prevLevel:int = 0;
             var dIdx:int = 0;
             var tempArr:Array = null;
             
             tempArr = _datas[0];
             
             // RootLevel데이터 읽어오기
             var xmlStr:String = "<node label=\""+tempArr[0]+"\" ";
             for(dIdx ; dIdx < _valueCount ; dIdx++)
             {              
              xmlStr += "value"+((dIdx+1)<10?"0"+(dIdx+1):""+(dIdx+1))+"=\""+tempArr[2+dIdx]+"\" ";              
             }
             xmlStr += "/>";
             
             mainXML.appendChild(new XML(xmlStr));
             
             prevLevel = Number(tempArr[1]);
             
//             Debug.trace("ROOT : "+mainXML.toXMLString());
             
             makeXML = mainXML.children()[0];
             
             var tempXML:XML = null;
             for(var idx:int =1 ; idx < dataLen ; idx++)
             {
              tempArr = _datas[idx];
     xmlStr = "<node label=\""+tempArr[0]+"\" ";
              for(dIdx = 0; dIdx < _valueCount ; dIdx++)
              {              
               xmlStr += "value"+((dIdx+1)<10?"0"+(dIdx+1):""+(dIdx+1))+"=\""+tempArr[2+dIdx]+"\" ";              
              }
              xmlStr += "/>";
              
              tempXML = new XML(xmlStr);
              
              if(prevLevel < Number(tempArr[1]))
              { 
               makeXML.appendChild(tempXML);
               prevLevel = Number(tempArr[1]);
               //Debug.trace("A"+idx+","+prevLevel+","+tempArr[1]+":"+makeXML.childIndex()+","+makeXML.children().length());
               makeXML = tempXML;
              }
              else
              {
               if(prevLevel == Number(tempArr[1]))
               {
                makeXML = makeXML.parent();                
               }
               else
               {
                var rLen:int = prevLevel - Number(tempArr[1]) + 1;
                for(var rIdx:int = 0 ; rIdx  < rLen ; rIdx++)
                {
                 makeXML = makeXML.parent();
                }                
               }               
               makeXML.appendChild(tempXML);               
               prevLevel = Number(tempArr[1]);
               //Debug.trace("B"+idx+","+prevLevel+","+tempArr[1]+":"+makeXML.childIndex()+","+makeXML.children().length()+","+makeXML.length());
               makeXML = tempXML;
              }              
             }
             
//             Debug.trace("RSLT : "+mainXML.toXMLString());
             
//             Alert.show("XML","XML만들기");
            }
        ]]>
    </mx:Script>

    <mx:Button label="XML 만들기" click="makeXMLClick()" />
</mx:Application>


뭐... 그냥... 필요할때가 있음.. ㅡ.ㅡ;;
Posted by 이현호
,

이것도 역시 Flash enabled Blog에서 퍼왔습니다.

시간순서상으로는 이게 먼저 포스트 된거지만 제가 읽은게 지금이라서.. ^^;;

PS : Trackback이 자꾸 실패나서 홈페이지 Link겁니다.

--> Blog 가기 <--



One cool thing you can do in Flash and Flex, is to create custom classes in order to help you to repeat certain tasks in a easily manner. Today i show you a collection of some cool custom classes, which can help you to develop more and faster.

SoundManager

The SoundManager is a Singleton that does exactly what it says. It has a host of methods to choose from that should make adding sounds to your projects super simple. It has a dependency to TweenLite for the sound fading

Active Window Blur

Blurs a background (MovieClip or Sprite) behind a transparent window (MovieClip or Sprite).

TweenMax

TweenMax builds on top of the TweenLite core class and its big brother, TweenFilterLite, to round out the tweening family with popular (though not essential) features like bezier tweening, pause/resume capabilities, easier sequencing, hex color tweening, and more.

YouTube

A simple light class to connect to the YouTube gdata API and source playlists and featured videos.

Pulse Particles

Pulse Particles is a general purpose AS3 particle system.

Animated Bitmap

The AnimatedBitmap class provides functionality for Bitmap objects that are animated by using a series of still images. When creating a new AnimatedBitmap you provide a BitmapData object that contains an image that consists of the ’single-frame’ images for the animation.

QueueLoader

The QueueLoader is an actionscript library for sequential asset loading and monitoring. QueueLoader is designed to be used with Actionscript 3.0 and has become an open source project. If you are interested in contributing please contact the project leader.

Prioritization

The url prioritization class, it works with Loader, URLLoader, and Sound Objects (and maybe NetStream objects one day). This will let you set a priority for requests so they execute in the right order, take a look at currently executing requests or loading requests.

DistortImage

An updated version of the original DistortImage class for AS2, which allows you to programmatically distort images.

Layout class

This class - rather, a collection of 3: Layout, LayoutConstraint, and LayoutManager - provide that functionality to objects in Flash CS3 through ActionScript 3 using a somewhat similar API (though ActionScript only, no authoring interface). Using these classes you can constrain objects to the top, right, bottom, left, or center them horizontally or vertically within a layout. There are also controls for height and width as well as a property for maintaining aspect ratio.

Color Sampler Class

Color sampling engine for DisplayObjects. Takes a defined sample area (width, height, x, y) of a BitmapData object and computes the average color within the area. The RGB, red channel, green channel, blue channel, hue, saturation, and brightness values are stored from the sample.

2D Character Rigging Classes

The AS 3 rigging classes are used for skelton rigging and skinning of 2D characters. The rigging class library is organized around the development of highly specific articulated rigs. The current focus is on humaniod bipedal characters.

XML Loader Class

AS3 XML loader

StyleCollection

The StyleCollection class lets you create groups of styles that are applied to and automatically updated on subscribing components. It supports both instance and renderer styles (setStyle and setRendererStyle respectively), and uses component introspection to apply only relevant styles to each component. StyleCollection exposes a robust interface, including a static interface that provides global access to named styles.

Easing

Easing is a Singleton that lets you do dynamic point-to-point property tweening. It is able to manipulate virtually any property of any object on or off the stage.

CSSLoader

The class enables you to load CSS files into your flex application during runtime, a functionality Actionscript3.0 lacks.

Autocomplete Text Field

Create an automcplete text field in an AS 3 project.

fZIP

A little Actionscript 3 class that enables you to load standard ZIP archives and extract contained files while the archive is still loading.

Reflection Class

Generate reflections from images


Posted by 이현호
,