Posted
Filed under Action Script
[원문] : http://board.flashkit.com/board/showthread.php?760109-using-TWEEN-to-scale

import fl
.transitions.Tween
;
import fl.transitions.easing
.*;

var
toMouseX:Tween
;
var
toMouseY:Tween
;

var
initialState:int = 1
;
var
finalState:int = 2
;

stage.addEventListener(MouseEvent.MOUSE_DOWN, onStagePress
);

function
onStagePress(event:MouseEvent):
void
{
   
easingAnimation
();
}
function
easingAnimation():
void
{
   
this.toMouseX = new Tween(box, "scaleX", None.easeNone
,
                             
this.initialState, this.finalState, .5, true
);
   
   
this.toMouseY = new Tween(box, "scaleY", None.easeNone
,
                             
this.initialState, this.finalState, .5, true
);
   
   
this.initialState = this.finalState
;
   
this.finalState
++;

2013/06/18 16:24 2013/06/18 16:24
Posted
Filed under Action Script
>> 플래시 콘텐츠 >>

 플래시 콘텐츠를 구성하는 무비클립 또는 버튼 등에 대체 텍스트를 제공함으로
써 사용자에게 혼란을 주게 될 경우 대체 텍스트를 제공하지 않아야 한다. 장식용
으로 사용되는 무비클립 또는 텍스트 설명이 함께 제공되는 무비클립 등이 여기
에 해당된다.
­어떤  무비클립에  대한 대체  텍스트를  제공하지  않기 위해서는  액세스  가
능성(Accessibility)  패널을  열고,  무비클립을  선택한  후에   액세스  가능
성 패널의  '객체를 액세스 가능하게 만들기(Make  object  accessible)' 항
목을  체크  해제(uncheck)한다.  이  항목을  체크  해제하면  이  무비클립의
이름(N) 항목이나 설명(D) 항목에 대체 텍스트나 설명문을 제공하더라도
보조기술은 이 무비클립에 대한 대체 텍스트를 무시하게 된다.
­플래시 콘텐츠를 ActionScript  2.0으로 개발하는 경우 무비클립(movieclip)
에 대한  _accProps 객체의  silent 속성을 ‘true’로 설정해야 한다.

// ActionScript 2.0 Example
// 'decorative_mc' is an instance placed on the movie's main timeline
_root.decorative_mc._accProps = new Object();
_root.decorative_mc._accProps.silent = true;
­
ActionScript  3.0으로  개발하는  경우  무비클립에  대한
accessibilityProperties 객체의  silent 속성을 ‘true’로 설정한다.

// ActionScript 3.0 Example
// 'decorative_mc' is an instance placed on the movie's main timeline
decorative_mc.accessibilityProperties = new AccessibilityProperties();
decorative_mc.accessibilityProperties.silent = true;

2013/03/18 16:17 2013/03/18 16:17
Posted
Filed under Action Script

[원문]http://www.campjohn.dk/wp/?p=820


생성 하고 넘겨 주는 방식..

var _theParameterFromURL:String = String(root.loaderInfo.parameters.whatParameter);
var _tempPercent:Number;
var _loader:Loader = new Loader();

_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, isloading);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishedLoading);

_loader.load(new URLRequest("howtograb.swf"));

function isloading(e:ProgressEvent):void {
            _tempPercent = e.bytesLoaded / e.bytesTotal;
            thePercent.text = String(Math.floor(_tempPercent*100))+"%";
}

function finishedLoading(e:Event):void {
            removeChildAt(0);
            _tempPercent = null;
            addChild(_loader);

            Object(_loader.content).init(_theParameterFromURL);
}




---------------------------------------------------------------------------------------'

package {
           
            import flash.display.Sprite;
            import flash.text.TextField;

           
            public class howtograb extends Sprite {
                       
                        private var _theTextFromURL:String;
                                               
                        public function howtograb():void {
                                    //
                        }
                       
                        public function init(someURL:String):void {
                                    _theTextFromURL = someURL;
                                   
                                    theText.text = _theTextFromURL;
                        }
                       
            }
}

2011/07/04 19:58 2011/07/04 19:58
Posted
Filed under Action Script

stop();

var ctrl:MovieClipLoader = new MovieClipLoader();
var _listener:Object = new Object();
_listener.onLoadInit = function(_mc:MovieClip)
{
   trace("Done loading...");
}

ctrl.addListener(_listener);
this.createEmptyMovieClip("_mc", this.getNextHighestDepth());
ctrl.loadClip("./menubar.swf", _mc);


// 접근 하려고 할 때
_root._mc.하위 객체명

2011/06/07 15:25 2011/06/07 15:25
Posted
Filed under Action Script
[원문] - http://www.actionscript.org/forums/showthread.php3?t=193793

var frameArray = fl.getDocumentDOM().getTimeline().layers[0].frames;
var n = frameArray.length;
var frame_rate=30;

for (i=0; i<n; i++)
{
if (i==frameArray[i].startFrame)
{
alert("Keyframe at: " + i);
}
}


 n/frame_rate < == 초

flash 또한 ECMA표준을 지키고 있음으로, javascrip처럼 둠 으로 접근 할 수 있습니다.
jsfl을 이용해서 이 뿐만 아니라 문서내의 다양한 정보들을 얻을 수 있을듯 보임니다.

2010/08/17 14:23 2010/08/17 14:23
Posted
Filed under Action Script
출처  :  [api 에서]
/***************************************************************************/

외부 xml파일을 로딩할 경우
charset이 utf-8이면 상관이 없지만, euc-kr일 경우 다음과 같이 설정을 해줘야 한다.

System.useCodePage = true;

/***************************************************************************/

A Boolean value that tells Flash Player which code page to use to interpret external text files. When the property is set to false, Flash Player interprets external text files as Unicode. (These files must be encoded as Unicode when you save them.) When the property is set to true, Flash Player interprets external text files using the traditional code page of the operating system running the player. The default value of useCodePage is false.

Text that you load as an external file (using flash.display.Loader.load() or the flash.net.URLLoader, flash.net.URLStream, or XML class) must have been saved as Unicode in order for Flash Player to recognize it as Unicode. To encode external files as Unicode, save the files in an application that supports Unicode, such as Notepad on Windows 2000.

If you load external text files that are not Unicode-encoded, set useCodePage to true. Add the following as the first line of code in the first frame of the SWF file that is loading the data:

System.useCodePage = true;

When this code is present, Flash Player interprets external text using the traditional code page of the operating system running Flash Player. This is generally CP1252 for an English Windows operating system and Shift-JIS for a Japanese operating system. If you set useCodePage to true, Flash Player 6 and later treat text as Flash Player 5 does. (Flash Player 5 treated all text as if it were in the traditional code page of the operating system running the player.)

If you set useCodePage to true, remember that the traditional code page of the operating system running the player must include the characters used in your external text file in order to display your text. For example, if you load an external text file that contains Chinese characters, those characters cannot display on a system that uses the CP1252 code page because that code page does not include Chinese characters.

To ensure that users on all platforms can view external text files used in your SWF files, you should encode all external text files as Unicode and leave useCodePage set to false. This way, Flash Player 6 and later interprets the text as Unicode.


Implementation
    public static function get useCodePage():Boolean
    public function set useCodePage(value:Boolean):void
2010/08/16 16:05 2010/08/16 16:05
Posted
Filed under Action Script

[원문] : http://2rang.tistory.com/2

var obj:Object = LoaderInfo(this.root.loaderInfo).
parameters;

_aaa = obj["aaa"];

_bbb = obj["bbb"];

로 간편하게 ... 넘어온 변수를 사용하시면 되겠습니다.


FlashVar 방식..
이든 쿼리스트링 방식..이든 데이터를 swf에  전달하기 위해 전문적으로 설계되지는 않았다고 합니다.

아주 작은 데이터 전송일때만 사용하고 복잡한 데이터엔 URLLoader.. 를 사용하기를 권한다고 합니다.

2010/08/16 15:55 2010/08/16 15:55
Posted
Filed under Action Script



down load file

flash auto compile  using jsfl

jsfl same like mecro ...script

core file :  compileProject.jstl, compile_schma.txt

2010/08/16 09:29 2010/08/16 09:29
Posted
Filed under Action Script

[원문] - http://note.marines.co.kr/45

1. 모든 무비클립에 Linkage를 걸어주는 jsfl

   - 첩부파일 Linkage.jsfl

  1. var libItems = fl.getDocumentDOM().library.items;
  2.  
  3. for( i = 0; i < libItems.length; ++i ){
  4.    if( libItems[i].itemType == "movie clip" ){
  5.       libItems[i].linkageExportForAS = true;
  6.       libItems[i].linkageExportInFirstFrame = true;
  7.    }
  8. }

2. 1번의 반대 모든 무비클립의 Linkage를 없애는 jsfl

   - 첩부파일 UnLinkage.jsfl

  1. function init(){
  2.         fl.outputPanel.clear();
  3.        
  4.         var dom = fl.getDocumentDOM();
  5.         if (dom == null) { alert("Cannot execute JSFL script. \nError: No Open Document"); return; }
  6.        
  7.         var item_array = fl.getDocumentDOM().library.items;
  8.         var i = item_array.length;
  9.         while(i--){
  10.                 var item = item_array[i];
  11.                 if(item.itemType == "movie clip"){
  12.                         item.linkageExportForAS = false;
  13.                         fl.trace("Examining "+(item_array.length - i)+" of "+item_array.length+": "+item.name+" ("+item.itemType+")");
  14.                         fl.trace("  -- Prepared library item: "+item.name);
  15.                 }
  16.         }
  17. }
  18.  
  19. init();

3. 라이브러리의 모든 이미지를 무손실압축(png)로 변경하고 AllowSmooth 적용

   - 첩부파일 AllowSmoothing.jsfl

  1. var libItems = fl.getDocumentDOM().library.items;
  2.  
  3. for( i = 0; i < libItems.length; ++i ){
  4.    if( libItems[i].itemType == "bitmap" ){
  5.       libItems[i].allowSmoothing = true;
  6.       libItems[i].compressionType = "lossless";
  7.    }
  8. }

4. 라이브러리의 객체들을 종류별로 폴더에 정리합니다.

    종류는 sound, bitmap, button, graphic, movie clip 입니다.

      - 첩부파일 Arrangement.jsfl

  1. var lib = fl.getDocumentDOM().library;
  2. var libItems = lib.items;
  3.  
  4. lib.newFolder("Audio");
  5. lib.newFolder("Bitmap");
  6. lib.newFolder("Buttons");
  7. lib.newFolder("Graphics");
  8. lib.newFolder("Movie Clips");
  9. lib.newFolder("Miscellaneous");
  10.  
  11. for( var i=0; i<libItems.length; ++i ){
  12.         if(libItems[i].itemType == "sound"){
  13.                 lib.moveToFolder("Audio", libItems[i].name, true);
  14.         }else if(libItems[i].itemType == "bitmap"){
  15.                 lib.moveToFolder("Bitmap", libItems[i].name, true);
  16.         }else if(libItems[i].itemType == "button"){
  17.                 lib.moveToFolder("Buttons", libItems[i].name, true);
  18.         }else if(libItems[i].itemType == "graphic"){
  19.                 lib.moveToFolder("Graphics", libItems[i].name, true);
  20.         }else if(libItems[i].itemType == "movie clip"){
  21.                 lib.moveToFolder("Movie Clips", libItems[i].name, true);
  22.         }else{
  23.                 lib.moveToFolder("Miscellaneous", libItems[i].name, true);             
  24.         }
  25. }

4. 열려있는 fla파일을 한번에 퍼블리싱하는 jsfl

      - 첩부파일 PublishAll.jsfl

  1. var flDocs = fl.documents;
  2.  
  3. for( var i=0; i<flDocs.length; ++i ){
  4.         flDocs[i].publish();
  5. }
2010/08/12 13:12 2010/08/12 13:12