Posted
Filed under Action Script
[원문]: http://marumushi.com/tags/as3


package {
   import flash.display.MovieClip;
   import flash.display.StageAlign;
   import flash.display.StageScaleMode;
   public class Test extends MovieClip {
      // be sure this is pointing to an image in your hardrive
      [Embed(source='c:\images\whatsup.jpg')] public var MyImage:Class;
      public function Test() {
         stage.align     = StageAlign.TOP_LEFT;
         stage.scaleMode = StageScaleMode.NO_SCALE;
         var img:MyImage = new MyImage();
         addChild(img);
      }
   }
}
2010/04/26 10:16 2010/04/26 10:16
Posted
Filed under Action Script
[원문]: http://marumushi.com/tags/as3

package {

import flash.util.describeType;
import flash.display.MovieClip;
import flash.display.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;
 
   public class Test extends MovieClip {
   
      // be sure this is pointing to a ttf font in your hardrive
      [Embed(source="C:\WINDOWS\Fonts\somefont.ttf", fontFamily="foo")]
      public var bar:String;
     
      public function Test() {
               
          var format:TextFormat      = new TextFormat();
          format.font      = "foo";
          format.color                = 0xFFFFFF;
          format.size                 = 130;

          var label:TextField         = new TextField();
          label.embedFonts            = true;
          label.autoSize              = TextFieldAutoSize.LEFT;
          label.antiAliasType         = AntiAliasType.ADVANCED;
          label.defaultTextFormat     = format;
          label.text                  = "Hello World!";
          addChild(label);
       }
    }
}
2010/04/26 10:15 2010/04/26 10:15
Posted
Filed under Action Script

[원문]: http://club.filltong.net/codingdojo/23224


package
{
  import flash.utils.ByteArray;

  public class FindPermutation
  {
    protected var s:String = "abcdefgh";
    protected var dict:Array = [];

    public function FindPermutation()
    {
      makeDict();
    }

    public function makeDict():void
    {
      var arr:Array = s.split("");
      dict = permutation(arr)
      dict.map(function(element:*, index:int, arr:Array):void { arr[index] = (element as Array).join("") });
    }

    public function find(words:String):Number
    {
      return dict.indexOf(words) + 1;
    }

    protected function permutation(array:Array):Array
    {
      if(array.length == 1) {
        return [array];
      }

      var result:Array = [];

      array.forEach(function(element:*, index:int, arr:Array):void {
        var tmp:Array = cloneArray(arr);
        tmp.splice(index,1);
        permutation(tmp).forEach(function(e:*, i:int, a:Array):void {
          result.push([element].concat(e));
        });
      });
      return result;
    }

    protected function cloneArray(src:*):* {
      var result:ByteArray = new ByteArray();
      result.writeObject(src);
      result.position = 0;
      return(result.readObject());
    }
  }

2010/04/23 19:54 2010/04/23 19:54
Posted
Filed under Action Script
flash에 서 파일 다운로드  by php

ac2.0
getURL("dl.php?file=chat6.zip", "_self");
ac3.0
NavigateToURL()

<?
// downloading a file use http://somewhere.com/download.php?filename=name of file

$filename = $_GET['file'];
if(!$filename){ echo "ERROR: No filename specified. Please try again."; }
else {

// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// browser must download file from server instead of cache

// force download dialog
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");

// use the Content-Disposition header to supply a recommended filename and
// force the browser to display the save dialog.
header("Content-Disposition: attachment; filename=".basename($filename).";");

header("Content-Transfer-Encoding: binary");

$root_path = "./audio/";

$myfile = $root_path . $filename;

//header("Content-Length: ".filesize($myfile));

readfile("$myfile");
exit();
}

?>
2010/04/23 11:48 2010/04/23 11:48
Posted
Filed under Action Script
flash에 서 파일 다운로드  by php

ac2.0
getURL("dl.php?file=chat6.zip", "_self");
ac3.0
NavigateToURL()

<?

// downloading a file use http://somewhere.com/download.php?filename=name of file

$filename = $_GET['file'];
if(!$filename){ echo "ERROR: No filename specified. Please try again."; }
else {

// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// browser must download file from server instead of cache

// force download dialog
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");

// use the Content-Disposition header to supply a recommended filename and
// force the browser to display the save dialog.
header("Content-Disposition: attachment; filename=".basename($filename).";");

header("Content-Transfer-Encoding: binary");

$root_path = "./audio/";

$myfile = $root_path . $filename;

//header("Content-Length: ".filesize($myfile));

readfile("$myfile");
exit();
}

?>
2010/04/23 11:47 2010/04/23 11:47
Posted
Filed under Action Script

[원문] : http://www.isgoodstuff.com/2008/06/10/actionscript-30-buttons-and-drag-drop/
 
actionscript 3.0에서 ....

MovieClipName.addEventListener(MouseEvent.MOUSE_DOWN,DragStart);
MovieClipName.addEventListener(MouseEvent.MOUSE_UP,DragStop);
function DragStart(event:Event){
	trace("Drag Started!");
	event.target.startDrag(false);
}
 
function DragStop(event:Event){
	trace("Drag Stoped!");
	event.target.stopDrag();
}
2010/04/20 15:44 2010/04/20 15:44
Posted
Filed under 웹표준

background: url(../images/asdf.png) no-repeat center top;
//CSS문서 위치를 중심으로 이미지 경로를 따질것

background
-image : none;
filter
: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/asdf.png',sizingMethod='scale');
//실제 읽어들이는 페이지를 중심으로 이미지 경로를 따질것

2010/04/18 00:02 2010/04/18 00:02
Posted
Filed under Htm&Javascript
[원문] : http://ehofldi123.oranc.co.kr/tc/entry/IE6%BF%A1%BC%AD-%BD%BA%C5%A9%B7%D1%BD%C3%BF%A1-%B9%E8%B0%E6%C0%CC-%B9%D0%B7%C1%BC%AD-%C0%DC%BB%F3%C0%CC%B3%AA%BF%C0%B4%C2%C7%F6%BB%F3?category=0

IE6에서 스크롤시에 배경이 밀려서 잔상이나오는현상
body{
background:#fff;url(/html/script/css/webv2/design/layout3_type3/images/sub/sub_bg.jpg) repeat-x;
}

또는

* html{ background:#fff;}
모든 페이지에 적용 해주자

2010/04/17 20:45 2010/04/17 20:45
Posted
Filed under Htm&Javascript

[원문] : http://www.webcredible.co.uk/user-friendly-resources/css/internet-explorer.shtml

IE에서 background 에 이미지 부릿 형태로 이미지 적용을 해보면 적용이 되질 않는다.
그래서 해결 할 수 있는 방법은 ; position: relative 포함 해주자 .

IE
has a very freaky bug where it likes to make background images (and sometimes even text - particularly if there are floated elements around) disappear. This often happens when you scroll up and down on a web page and you can usually make the background re-appear by refreshing the page.

Obviously you won't want your site visitors to have to refresh a page to see a background image in full! A freaky solution to this freaky problem is to insert the CSS command, position: relative into the CSS rule containing the background image:

.foo {
background: url(filename.jpg);
position: relative
}

Occasionally this won't work, so another solution is to assign a width or a height to the element with the background image. You may not want to assign a height or width, so a solution is to assign a height of 1% for Internet Explorer. Because IE interprets height as min-height (see point 2 above) this CSS rule won't affect the appearance:

.foo {
background: url(filename.jpg);
height: 1%
}
html>body .foo {
height: auto
}

The height: 1% CSS command is cancelled out by the height: auto CSS command. Internet Explorer doesn't understand html>body, so by inserting this in front of the second CSS rule this whole CSS rule is ignored by IE.

2010/04/16 02:20 2010/04/16 02:20