Posted
Filed under JSP, JAVA

게시판을 구현중 skin 디렉토리의 폴더 목록을 뽑아 와서 Select box에 보여줘야 될 경우가
발생 했다.
이것 저것 테스트 해본 결과..

org.apache.struts.util.LabelValueBean  을 이용하여 lavel, value값으로 ArrayList에 넣고
iterate  시켰다..

-천천히 보면 누구나 이해 할 수 있음 ... 더 좋은 방법이 있다면..
scormrte@gmail.com 이나 뎃글로 ... 조언 부탁 드립니다.

간단 한 예로
 - action
ArrayList skinList = futil.getDirectoryList(skin_path);
   skinList = ConvertLableValueBean.convert_from_ArrayList(skinList);
   request.setAttribute("skinList",skinList);


-jsp page
<select name="bcf_skin">
      <logic:iterate name="skinList" type="org.apache.struts.util.LabelValueBean" id="skin_vo">
       <option value="test"><bean:write name="skin_vo" property="value" /></option>
      </logic:iterate>
     </select>


-사용자 정의 클레스
import org.apache.struts.util.LabelValueBean;
import java.util.ArrayList;
import java.util.List;

public class ConvertLableValueBean {
 public static ArrayList convert_from_ArrayList(ArrayList targetList){
  ArrayList list = new ArrayList();
  for(int i=0; i<targetList.size(); i++){
   list.add(new LabelValueBean( targetList.get(i).toString(), targetList.get(i).toString() ));
  }
  return (ArrayList)list;
 }
 
 public static ArrayList convert_from_ArrayList(ArrayList LabelList, ArrayList LabelValue){
  ArrayList list = new ArrayList();
 
  for(int i=0; i<LabelList.size(); i++){
   list.add(new LabelValueBean( LabelList.get(i).toString(), LabelValue.get(i).toString() ));
  }
 
  return (ArrayList)list;
 }
 
}



-----------------------------------------------------------------------------------


import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.util.ArrayList;
public class FileUtil {
 
 private ArrayList list=null;
 private File dir;
 private File[] dirlist;
 
 public FileUtil(){
  list = new ArrayList();
 }
 
 //directory filter
 private FileFilter getDirectoryFilter(){
  FileFilter fileFilter = new FileFilter() {
      public boolean accept(File file) {
          return file.isDirectory();
      }
  };
  return fileFilter;
 }
 
 //file filter
 private FilenameFilter getFileFilter(){
  FilenameFilter filter = new FilenameFilter() {
      public boolean accept(File dir, String name) {
          return !name.startsWith(".");
      }
  };
  return filter;
 }
 
 
 public ArrayList getdirlist(String path){
  dir = new File(path);
  conv_fileArry_to_list(dir.listFiles(getFileFilter()));
  return list;
 }
 
 public ArrayList getDirectoryList(String path){
  dir = new File(path);
  conv_fileArry_to_list(dir.listFiles(getDirectoryFilter()));
  return list;
 }
 
 private void conv_fileArry_to_list(File[] dirlist){
  this.list.clear();
  for (File flist : dirlist){
   this.list.add(flist.getName());
  }
 }
}

2010/02/16 23:06 2010/02/16 23:06
Posted
Filed under JSP, JAVA

파일을 실제로 업로드 하기 위해서는 업로드할 디렉토리의 실제 주소를 구해야 한다.
request.getRealPath("/path") <-- path는 경로를 적어 주면 된다 .
ex)
private String skin_path="";
skin_path = request.getRealPath("/vboard/bbs_skin");

"/ <--웹 계정의 최상위 root를 말함

2010/02/16 22:58 2010/02/16 22:58
Posted
Filed under JSP, JAVA
package com.ubibada.common.util;
import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.util.ArrayList;
public class FileUtil {
 
 private ArrayList list=null;
 private File dir;
 private File[] dirlist;
 
 public FileUtil(){
  list = new ArrayList();
 }
 
 //directory filter
 private FileFilter getDirectoryFilter(){
  FileFilter fileFilter = new FileFilter() {
      public boolean accept(File file) {
          return file.isDirectory();
      }
  };
  return fileFilter;
 }
 
 //file filter
 private FilenameFilter getFileFilter(){
  FilenameFilter filter = new FilenameFilter() {
      public boolean accept(File dir, String name) {
          return !name.startsWith(".");
      }
  };
  return filter;
 }
 
 
 public ArrayList getdirlist(String path){
  dir = new File(path);
  conv_fileArry_to_list(dir.listFiles(getFileFilter()));
  return list;
 }
 
 public ArrayList getDirectoryList(String path){
  dir = new File(path);
  conv_fileArry_to_list(dir.listFiles(getDirectoryFilter()));
  return list;
 }
 
 private void conv_fileArry_to_list(File[] dirlist){
  this.list.clear();
  for (File flist : dirlist){
   this.list.add(flist.getName());
  }
 }
}
2010/02/11 09:46 2010/02/11 09:46
Posted
Filed under JSP, JAVA

servlet 인 int 되는 시점에서 공유 변수 설정을 하기 위해서
System.setProperty 를 이용해서 값을 저장후 서블릿 단에서  getProperty 를 통해서 호출 한다..
게시판 구현시 dbcp접속 servlet이 int되는 시점에서
dbType을 저장 하는데 활용 했음 .



setProperty

public static String setProperty(String key,
                                 String value)
Sets the system property indicated by the specified key.

First, if a security manager exists, its SecurityManager.checkPermission method is called with a PropertyPermission(key, "write") permission. This may result in a SecurityException being thrown. If no exception is thrown, the specified property is set to the given value.

Parameters:
key - the name of the system property.
value - the value of the system property.
Returns:
the previous value of the system property, or null if it did not have one.
Throws:
SecurityException - if a security manager exists and its checkPermission method doesn't allow setting of the specified property.
NullPointerException - if key or value is null.
IllegalArgumentException - if key is empty.
Since:
1.2
See Also:
getProperty(java.lang.String), getProperty(java.lang.String), getProperty(java.lang.String, java.lang.String), PropertyPermission, SecurityManager.checkPermission(java.security.Permission)





getProperty

public static String getProperty(String key,
                                 String def)
Gets the system property indicated by the specified key.

First, if there is a security manager, its checkPropertyAccess method is called with the key as its argument.

If there is no current set of system properties, a set of system properties is first created and initialized in the same manner as for the getProperties method.

Parameters:
key - the name of the system property.
def - a default value.
Returns:
the string value of the system property, or the default value if there is no property with that key.
Throws:
SecurityException - if a security manager exists and its checkPropertyAccess method doesn't allow access to the specified system property.
NullPointerException - if key is null.
IllegalArgumentException - if key is empty.
See Also:
setProperty(java.lang.String, java.lang.String), SecurityManager.checkPropertyAccess(java.lang.String), getProperties()




public static String getProperty(String key)
Gets the system property indicated by the specified key.

First, if there is a security manager, its checkPropertyAccess method is called with the key as its argument. This may result in a SecurityException.

If there is no current set of system properties, a set of system properties is first created and initialized in the same manner as for the getProperties method.

Parameters:
key - the name of the system property.
Returns:
the string value of the system property, or null if there is no property with that key.
Throws:
SecurityException - if a security manager exists and its checkPropertyAccess method doesn't allow access to the specified system property.
NullPointerException - if key is null.
IllegalArgumentException - if key is empty.
See Also:
setProperty(java.lang.String, java.lang.String), SecurityException, SecurityManager.checkPropertyAccess(java.lang.String), getProperties()

2010/02/10 21:55 2010/02/10 21:55
Posted
Filed under JSP, JAVA
[원문]http://lovelovewoo.springnote.com/pages/5055397
package board.util;
  • public class Paging {
  •  private int totalRows = 0;
     private int currentPage = 1;
     private int pageSize = 10;
     private int blockSize = 10;
     private int totalPages;
     private int totalBlocks;
     private int startPageNum;
     private int endPageNum;
     private int currentBlock;
  •  private String amp = "";
     
     // for design
     private String firstLink = "[<<]";
     private String firstOffLink = "";
     private String prevLink = "[<]";
     private String prevOffLink = "";
     private String nextLink = "[>]";
     private String nextOffLink = "";
     private String lastLink = "[>>]";
     private String lastOffLink = "";
     
     private String delimiter = "|";
     
     // current Page Wrapper
     private String preWrap = "<b>";
     private String postWrap = "</b>";
     
     private String linkPage = "";
     private String queryString = "";

  •  private int start,end;
     
     
     
     
  •  public int getStart() {
      return start;
     }
  •  public void setStart(int start) {
      this.start = start;
     }
  •  public int getEnd() {
      return end;
     }
  •  public void setEnd(int end) {
      this.end = end;
     }
  •  public String getFirstLink() {
      return firstLink;
     }
  •  public void setFirstLink(String firstLink) {
      this.firstLink = firstLink;
     }
  •  public String getFirstOffLink() {
      return firstOffLink;
     }
  •  public void setFirstOffLink(String firstOffLink) {
      this.firstOffLink = firstOffLink;
     }
  •  public String getPrevLink() {
      return prevLink;
     }
  •  public void setPrevLink(String prevLink) {
      this.prevLink = prevLink;
     }
  •  public String getPrevOffLink() {
      return prevOffLink;
     }
  •  public void setPrevOffLink(String prevOffLink) {
      this.prevOffLink = prevOffLink;
     }
  •  public String getNextLink() {
      return nextLink;
     }
  •  public void setNextLink(String nextLink) {
      this.nextLink = nextLink;
     }
  •  public String getNextOffLink() {
      return nextOffLink;
     }
  •  public void setNextOffLink(String nextOffLink) {
      this.nextOffLink = nextOffLink;
     }
  •  public String getLastLink() {
      return lastLink;
     }
  •  public void setLastLink(String lastLink) {
      this.lastLink = lastLink;
     }
  •  public String getLastOffLink() {
      return lastOffLink;
     }
  •  public void setLastOffLink(String lastOffLink) {
      this.lastOffLink = lastOffLink;
     }
  •  public String getDelimiter() {
      return delimiter;
     }
  •  public void setDelimiter(String delimiter) {
      this.delimiter = delimiter;
     }
  •  public String getPreWrap() {
      return preWrap;
     }
  •  public void setPreWrap(String preWrap) {
      this.preWrap = preWrap;
     }
  •  public String getPostWrap() {
      return postWrap;
     }
  •  public void setPostWrap(String postWrap) {
      this.postWrap = postWrap;
     }
  •  public String getLinkPage() {
      return linkPage;
     }
  •  public void setLinkPage(String linkPage) {
      this.linkPage = linkPage;
     }
  •  public String getQueryString() {
      return queryString;
     }
  •  public void setQueryString(String queryString) {
      this.queryString = queryString;
     }
  •  // result temp object
     public StringBuffer pageString = new StringBuffer();
     
     public Paging(int currentPage , int pageSize , int blockSize , int totalRows)
     {
      this.currentPage = currentPage;
      this.pageSize = pageSize;
      this.blockSize = blockSize;
      this.totalRows = totalRows;
     
      initialize();
     }
     
     public void initialize()
     {
      this.totalPages = (int)Math.ceil((double)this.totalRows / this.pageSize);
      this.totalBlocks = (int)Math.ceil((double)this.totalPages / this.blockSize);
      this.currentBlock = (int)Math.ceil((double)((this.currentPage - 1) / this.blockSize)) + 1;  
      this.startPageNum = ((this.currentBlock - 1) * this.pageSize) + 1;
      this.endPageNum = this.startPageNum + this.pageSize;
      this.start = (currentPage-1)*pageSize+1;
      this.end = start+pageSize-1;
     }
     
     public void prePrint()
     {
      // set first block link
      if(this.currentBlock > 1)
       pageString.append("<a href=\"" + this.linkPage + "?" + this.queryString + this.amp + "page=" + (((this.currentBlock - 2) * this.pageSize) + 1) + "\">" + this.firstLink + "</a> ");
      else
       pageString.append(this.firstOffLink + " ");
       
     
      // set prev page link
      if(this.currentPage > 1)
       pageString.append("<a href=\"" + this.linkPage + "?" + this.queryString + this.amp + "page=" + (this.currentPage  - 1) + "\">" + this.prevLink + "</a> ");
      else
       pageString.append(this.prevOffLink + " ");  
     }
     
     public void postPrint()
     {
      // set next page link
      if(this.currentPage < this.totalPages )
       pageString.append("<a href=\"" + this.linkPage + "?" + this.queryString + this.amp + "page=" + (this.currentPage + 1) + "\">" + this.nextLink + "</a> ");
      else
       pageString.append(this.nextOffLink + " ");
     
      // set last page link
      if(this.currentBlock < this.totalBlocks)
       pageString.append("<a href=\"" + this.linkPage + "?" + this.queryString + this.amp + "page=" + ((this.currentBlock * this.pageSize) + 1) + "\">" + this.lastLink + "</a> ");
      else
       pageString.append(this.lastOffLink);
     }
     
     public void printList()
     {
      for(int i = startPageNum ; i <= endPageNum ; i++)
      {
       if(i > this.totalPages || i == endPageNum)
        break;
       else if(i > startPageNum)
        pageString.append(this.delimiter);
       
       if(i == this.currentPage)  
        pageString.append(" " + this.preWrap + i +  this.postWrap + " ");
       else
        pageString.append(" <a href=\"" + this.linkPage + "?" + this.queryString + this.amp + "page=" + i + "\">" + i + "</a> ");
      }
     }
     
     public String print()
     {
      // set amp if already to set up queryString property
      if(!this.queryString.equals(""))
       this.amp = "&";
     
      if(this.totalPages > 1)
      {
       this.prePrint();
       this.printList();
       this.postPrint();
      }
     
      return(pageString.toString());
     }
     
     /**
      * @param args
      */
     /*
     public static void main(String[] args) {
     
      // TODO Auto-generated method stub
      Pagination page = new Pagination(1 , 10, 10 , 11);
      page.linkPage = "pagenum.jsp";
      page.queryString = "param1=test&param2=test2";
     
      // for design
      page.firstLink = "<img src=\"/first.gif\">";
      page.prevLink = "<img src=\"/prev.gif\">";
      page.nextLink = "<img src=\"/next.gif\">";
      page.lastLink = "<img src=\"/last.gif\">";
     
      page.firstOffLink = "[<<]";
      page.prevOffLink = "[<]";
      page.nextOffLink = "[>]";
      page.lastOffLink = "[>>]";
     
      page.delimiter = "||";
     
     
      //print
      System.out.println(page.print());
     }
     */
  • }
  • 2010/02/10 13:57 2010/02/10 13:57
    Posted
    Filed under JSP, JAVA
    <html:option value="<bean:write property='best' name='supplier'/>"><bean:write property="supplierName" name="supplier"/></html:option>

    option 테그에 value값을 넣기 위해서 bean:write를 사용 하게 되면, 값이 그대로 들어 가게 된다.  value=""에는 어떤 테그도 들어 갈 수 없다..
    그럼으로, <bean:define>테그를 이용하여 변수를 생성 하여 값을 넣어 주면 된다.

    <html:select property="homeContext">
    <html:option value=""><bean:message key="home.context" /></html:option>
    <logic:iterate name="supplierlst" id="supplier" scope="request">
    <bean:define id="supplierValue" ><bean:write property="best" name="supplier"/></bean:define>
    <html:option value="<%=supplierValue%>"><bean:write property="supplierName" name="supplier"/>(<bean:write property="best" name="supplier"/>)</html:option>
    </logic:iterate>
    </html:select>


    [document]http://struts.apache.org/1.x/struts-taglib/tagreference.html#bean:define

    <bean:define>

    Define a scripting variable based on the value(s) of the specified bean property.

    Create a new attribute (in the scope specified by the toScope property, if any), and a corresponding scripting variable, both of which are named by the value of the id attribute. The corresponding value to which this new attribute (and scripting variable) is set are specified via use of exactly one of the following approaches (trying to use more than one will result in a JspException being thrown):

    • Specify a name attribute (plus optional property and scope attributes) - The created attribute and scripting variable will be of the type of the retrieved JavaBean property, unless it is a Java primitive type, in which case it will be wrapped in the appropriate wrapper class (i.e. int is wrapped by java.lang.Integer).
    • Specify a value attribute - The created attribute and scripting variable will be of type java.lang.String, set to the value of this attribute.
    • Specify nested body content - The created attribute and scripting variable will be of type java.lang.String, set to the value of the nested body content.

    If a problem occurs while retrieving the specified bean property, a request time exception will be thrown.

    The <bean:define> tag differs from <jsp:useBean> in several ways, including:

    • Unconditionally creates (or replaces) a bean under the specified identifier.
    • Can create a bean with the value returned by a property getter of a different bean (including properties referenced with a nested and/or indexed property name).
    • Can create a bean whose contents is a literal string (or the result of a runtime expression) specified by the value attribute.
    • Does not support nested content (such as <jsp:setProperty> tags) that are only executed if a bean was actually created.

    USAGE NOTE - There is a restriction in the JSP 1.1 Specification that disallows using the same value for an id attribute more than once in a single JSP page. Therefore, you will not be able to use <bean:define> for the same bean name more than once in a single page.

    USAGE NOTE - If you use another tag to create the body content (e.g. bean:write), that tag must return a non-empty String. An empty String equates to an empty body or a null String, and a new scripting variable cannot be defined as null. Your bean must return a non-empty String, or the define tag must be wrapped within a logic tag to test for an empty or null value.

    USAGE NOTE - You cannot use bean:define to instantiate a DynaActionForm (type="org.apache.struts.action.DynaActionForm") with the properties specified in the struts-config. The mechanics of creating the dyna-properties is complex and cannot be handled by a no-argument constructor. If you need to create an ActionForm this way, you must use a conventional ActionForm.

    See the Bean Developer's Guide section on bean creation for more information about these differences, as well as alternative approaches to introducing beans into a JSP page.

    Can contain: JSP

    Attributes

    Name Description Type
    id*

    Specifies the name of the scripting variable (and associated page scope attribute) that will be made available with the value of the specified property.

    String
    name

    Specifies the attribute name of the bean whose property is accessed to define a new page scope attribute (if property is also specified) or the attribute name of the bean that is duplicated with the new reference created by this tag (if property is not also specified). This attribute is required unless you specify a value attribute or nested body content.

    String
    property

    Specifies the name of the property to be accessed on the bean specified by name. This value may be a simple, indexed, or nested property reference expression. If not specified, the bean identified by name is given a new reference identified by id.

    String
    scope

    Specifies the variable scope searched to retrieve the bean specified by name. If not specified, the default rules applied by PageContext.findAttribute() are applied.

    String
    toScope

    Specifies the variable scope into which the newly defined bean will be created. If not specified, the bean will be created in page scope.

    String
    type

    Specifies the fully qualified class name of the value to be exposed as the id attribute.

    String
    value

    The java.lang.String value to which the exposed bean should be set. This attribute is required unless you specify the name attribute or nested body content.

    2010/02/09 16:36 2010/02/09 16:36
    Posted
    Filed under JSP, JAVA
    C언어와는 달리, 자바에서의 문자열 바꾸기 Substitution 는 아주 쉽습니다.

    여기서 소개하는 자바의 문자열 치환 메소드(함수)들은, "Search and Replace" 또는 "Find and Replace" 개념입니다. 텍스트에디터의 문자열 바꾸기처럼, 지정한 문자열을 기존의 문자열 속에서 자동으로 찾아서 바꿉니다. 대부분의 경우에는 이것을 사용하면 됩니다.


    문자열 치환(Replace) 예제


    파일명: Foo.java
    public class Foo {
      public static void main(String[] args) {

        String s  = "봉숭아 학당! 봉숭아 학당!"; // 원본 문자열
        String s2;

        System.out.println("원본:    " + s);
        System.out.println(); // 줄바꿈


        // (1)
        s2 = s.replace("숭아", "맹구");
        System.out.println("치환(1): " + s2); // 출력 결과: 봉맹구 학당! 봉맹구 학당!

        // (2)
        s2 = s.replaceFirst("숭아", "맹구");
        System.out.println("치환(2): " + s2); // 출력 결과: 봉맹구 학당! 봉숭아 학당!

        // (3)
        s2 = s.replaceAll("숭아", "맹구");
        System.out.println("치환(3): " + s2); // 출력 결과: 봉맹구 학당! 봉맹구 학당!

      }
    }




    public String replace(CharSequence target, CharSequence replacement)
    이것은 일치되는 모든 문자열을 바꿉니다. 원본 문자열에 "숭아"가 2개 있는데 모두 "맹구"로 치환되었습니다. (CharSequence 가 아닌 String 도 사용 가능합니다.)



    public String replaceFirst(String regex, String replacement)
    이것은 첫번째로 일치되는 문자열만 바꿉니다. 첫 번째 "숭아"만 "맹구"로 치환되었습니다. 문자열 대신에, 정규식(regex)을 지정할 수도 있습니다.



    public String replaceAll(String regex, String replacement)
    맨 처음의 replace() 와 같이, 일치되는 모든 문자열을 바꿉니다. replace()와 다른 점은, 정규식/정규표현식(Regular Expressions; Regex)을 사용할 수 있다는 것입니다.




    ▶▶ Java/자바/정규식] 대소문자 구분 없이 문자열 바꾸기/치환; Replace String Ignore Case Regex

    ▶▶ Java/자바] 백슬래쉬(\; ₩) 문자 바꾸기, 문자열/정규식에 백슬래시 자체 표현 방법; Backslash

    ▶▶ Java/자바] 문자열 삭제, 일부 문자열만 지우기; Remove, Delete String

    ▶▶ Java/자바] 문자열 속에서 문자열 검색, 문자 찾기; Find Sub-String in a String

    [원문]☞ 자바(Java)
    2010/02/08 17:32 2010/02/08 17:32
    Posted
    Filed under Action Script
    package
    {
       import flash.display.MovieClip;
       import flash.display.SWFLoaderInfo;
       
       public dynamic class Main extends MovieClip
       {
          public var info:SWFLoaderInfo = SWFLoaderInfo(this.loaderInfo);
          public var listxml:String;
          public var path:String;

          public function Main()
          {
             // URL-Encoded query string to variablize
             if(!info.arguments.path)
             {
                this.listxml = info.arguments.listxml;
             }
             else if(!info.arguments.listxml)
             {
                this.path = info.arguments.path;
             }

          }
    }
    2010/02/05 09:20 2010/02/05 09:20
    Posted
    Filed under etc
    사용자 삽입 이미지
    2010/02/03 13:23 2010/02/03 13:23
    Posted
    Filed under Action Script


    flash 에서 오른쪽 마우스를 사용 하기 위해서
    ASnative 를 이용해서 dispatch 한 이벤트를 실행 한다.
    버튼, 무비클립 클릭 용으로 만들었다.

    swf 파일을 html에서 embead 할 때 menu=false로 지정 한다. 그래야 flash 상에서 메뉴 버튼이 나타나지 않는다.

    flash의 1번째 프레임에 다음과 같이 선언 한다.
    소스는 actionscript 를 조금만 할 줄 알면 누구나 이해 할 수 있음으로,, 설명은 생략 ...
    소스 사용으로 perfomence 저하에 대해서는 책임 못짐...


    var EventStack:Array  =new  Array();

    this.onEnterFrame = function() {
     //dispitchEvent by MouseRightBtnClick
     
     if (ASnative(800, 2)(2)) {
      //객체 찾기
      var temp:Array=find_object(this._currentframe);
      for(i:Number=0; i<temp.length; i++){
       if(is_mouseOver(this[temp[i].eventTarget])==true){
        //method call;
        var method:String = temp[i].tirggerMethod;
        this[method]();
        removeEventStack(temp[i].frameNo,temp[i].eventTarget,temp[i].tirggerMethod);
       }//end if
      }//end for
     }//end if
    }//end EnterFrame


    //등록
    function regist(frameNo:String,eventTarget:String,tirggerMethod:String):Void{
     var defaultObj:Object = new Object();
     defaultObj.frameNo=frameNo;
     defaultObj.eventTarget=eventTarget;
     defaultObj.tirggerMethod =tirggerMethod;
     EventStack.push(defaultObj);
    }


    // is mouseOver
    function is_mouseOver(o:Object){
     var is:Boolean=false;
     if(o.hitTest(_root._xmouse,_root._ymouse, false)){
      is=true;
     }
     return is;
    }

    function find_object(frameNo:String):Array{
     var objArray:Array = new Array();
     for(i:Number=0; i<EventStack.length; i++){
      if(EventStack[i].frameNo==frameNo){
       objArray.push(EventStack[i]);
      }
     }
     return objArray;
    }

    function removeEventStack(frameNo:String,eventTarget:String,tirggerMethod:String){
     for(i:Number =0; i<EventStack.length; i++){
      if(EventStack[i].frameNo==frameNo){
       if(EventStack[i].eventTarget==eventTarget){
        if(EventStack[i].tirggerMethod==tirggerMethod){
         array_slice(EventStack,i);
         break;
        }
       }
      }
     }
    }

    function array_slice(target_array:Array, target_num:Number){
     for(var i=0; i<target_array.length; i++){
       if(i==target_num){
        target_array.splice(i,1);
       }
     }
    }


    마우스 오른쪽 버튼을 클릭 할 위치에
     
    stop();
    //_currentframe 현제 프레임 번호 , bg1 <-- 이벤트가 발생할 객체(버튼, 무비클립), fun1 <-- 이벤트가 발생 할 후 호출될 함수 명     함수 명은 수정 될 수 있으나 해당 함수를  반드시 구현 해줘야 한다.

    regist(_currentframe,"bg1","fun1");

    //callback function
    function fun1(){
       //마우스 오른쪽 버튼 클릭시 실행될 내용
     trace("mouseclick");

    }

    2010/02/02 15:31 2010/02/02 15:31