개발 기록/Javascript

[Adobe Flash/Action Script] 각종 설정

JasonM 2023. 5. 1. 22:18
반응형

1. Color 객체

1.setRGB

myColor = new Color(MovieClip);
-->myColor라는 이름의 칼라 객체 생성- 대상은 MovieClip

myColor.setRGB(0x00000);
--> RGB 칼라 적용


2.setTransform


myColor.setTransform(colorTransformObject);

Parameters

colorTransformObject An object created with the new Object constructor. This instance of the Object object must have the following properties that specify color transform values: ra, rb, ga, gb, ba, bb, aa, ab. These properties are explained below.

Returns

Nothing.

Description

Method; sets color transform information for an instance of the Color object. The colorTransformObject parameter is a generic object that you create from the new Object constructor. It has parameters specifying the percentage and offset values for the red, green, blue, and alpha (transparency) components of a color, entered in the format .

The parameters for a color transform object correspond to the settings in the Advanced Effect dialog box and are defined as follows:

?ra is the percentage for the red component (-100 to 100).
?rb is the offset for the red component (-255 to 255).
?ga is the percentage for the green component (-100 to 100).
?gb is the offset for the green component (-255 to 255).
?ba is the percentage for the blue component (-100 to 100).
?bb is the offset for the blue component (-255 to 255).
?aa is the percentage for alpha (-100 to 100).
?ab is the offset for alpha (-255 to 255).

You create a colorTransformObject parameter as follows:

myColorTransform = new Object();
myColorTransform.ra = 50;
myColorTransform.rb = 244;
myColorTransform.ga = 40;
myColorTransform.gb = 112;
myColorTransform.ba = 12;
myColorTransform.bb = 90;
myColorTransform.aa = 40;
myColorTransform.ab = 70;

//You can also use the following syntax to create a colorTransformObject parameter:
myColorTransform = { ra: `50', rb: `244', ga: `40', gb: `112', ba: `12', bb: `90', aa: `40', ab: `70'}



Example

This example creates a new instance of the Color object for a target movie, creates a generic object called myColorTransform with the properties defined above, and uses the setTransform method to pass the colorTransformObject to a Color object. To use this code in a Flash (FLA) document, place it on Frame 1 on the main Timeline and place a movie clip on the Stage with the instance name myMovie, as in the following code:

// Create a color object called myColor for the target myMovie
myColor = new Color(myMovie);
// Create a color transform object called myColorTransfrom using
// the generic Object object
myColorTransform = new Object();
// Set the values for myColorTransform
myColorTransform = { ra: '50', rb: '244', ga: '40', gb: '112', ba: '12', bb: '90', aa: '40', ab: '70'};
// Associate the color transform object with the Color object
// created for myMovie
myColor.setTransform(myColorTransform);

 

 

 

2. html에서 플래시 무비 속성 정하기

 

<PARAM name="wmode" value="transparent">
--> 플래시 파일의 바탕을 투명하게..

<PARAM name="menu" value="false">
--> 마우스 오른쪽 메뉴 없애기..

<PARAM name="bgcolor" value="#000000">
--> 배경색을 검정색으로...


_root상에 값이 들어가게 됩니다.
따라서 값을 용할때는 _root.변수명 의 형태로 용하면 됩니다.

참고로,

object태그에서는
<PARAM NAME=flashvars value="a=10&b=22&c=34&d=hihi&e=99">


embed태그 에서는
flashvars="a=10&b=22&c=34&d=hihi&e=99"

와 같은 속성을 줌으로서 같은 결과를 가져 올수 있습니다( mx이상 )
이경우 url주소에 주는 방식보다 더 좋을듯 싶어요

 

 

3. 자바스크립트로 플래시 제어하기

<script language="javascript">

function zoom_in(){
    document.object태그의 ID.Zoom(50);
    //플래시무비를50만큼 확대한다
}

function zoom_out(){
    document.object태그의 ID.Zoom(200);
    //플래시무비를200만큼 축소한다
}

function go_right(){
    document.object태그의 ID.Pan(20, 0, 1)
    //플래시 무비를 오른쪽으로 움직인다
}

function go_left(){
    document.object태그의 ID.Pan(-20, 0, 1)
    //플래시 무비를 왼쪽으로 움직인다
}

function go_top(){
    document.object태그의 ID.Pan(0, 20, 1)
    //플래시 무비를 위쪽으로 움직인다
}

function go_bottom(){
    document.object태그의 ID.Pan(0, -20, 1)
    //플래시 무비를 아래쪽으로 움직인다
}

function no_zoom(){
    document.object태그의 ID.Zoom(0);
    //확대된 플래시무비를 원상복구 시킨다
}

function swf_control(tmp,reftime){
    var movie = document.swf;
    // html소스 코드의 object 태그안의 ID

    movie.setVariable("_root.변수명","데이터");
    //플래시 파일안의 변수에 데이터를 입력!!

    movie.GotoFrame(1);
    //플래시무비의 첫번째프레임으로 이동시킨다.

    movie.Play();
    //플래시 무비를 실행 시킨다.

}

</script>

 

 

4. loadVariables 사용 시 한글 처리

System.useCodePage = true;

loadVariables("loadVariables.jsp","");
로드되는 시간보다 더 늦게 변수를 선언하거나..
루프를 돌려서 변수에 값을 다시 집어넣어야 한다!!
제발 까먹지 말자..ㅜㅜ
이젠 지겹당..

 

5. FScommand로 스크립트 링크걸기

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub isMenu_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call isMenu_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
}

function isMenu_DoFSCommand(command, args){
  if(command == "FMshow()") {
    FMshow();
  }else if(command == "FMhide()"){
    FMhide();
  }
}

 

6, 플래시위에 레이어 올리기

<table border ="0">
<tr>
  <td width=800>  
   <object id= "adswf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="800" height="400">
   <param name=movie value="./H630.swf">
   <param name=quality value=high>
   <PARAM NAME="WMode" VALUE="Transparent">   
   <embed src="main_img/menu_iken.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="780" height="40">
   </embed>
   </object>  
  </td>
  <td>
  <div id="data2" style="position:absolute; left:550px; top:20px; width:262px; height:400px; z-index:1">
   <table border ="0">
    <tr>
    <td>     
    <input type="text" name="name" value =" ABCD " ><br>
    <input type="submit" value="????">  
    </td>
   </tr> 
   <tr>
    <td>
    <iframe name="iframe2" width="200" height="400" src="./UKEN_WS_111.jsp" frameborder="0" style="border-width:0; border-style:solid;">
    </td>
   </tr>
  </table>
  </div>  
  </td>
 </tr>    
</table>

<PARAM NAME="WMode" VALUE="Transparent"> 를 해줘야 함.

반응형