IT기술/Flex 41

flex 6 class를 이용하여 이미지를 넣자

MyImage.as package comp1 { import mx.containers.Panel; import mx.controls.Image; public class MyImage extends Panel{ public function MyImage(){ super(); var img:Image = new Image(); img.source = "test.jpg"; this.addChild(img); } } } 넣고싶은 이미지를 import시켜놓으면 찾아갈수 있다. design보기로 들어서 보면 좌측의 Components의 Custom에 보면 MyImage가 생긴것을 볼 수 있다. 이미지처럼 끌어다 쓰면 된다. ImageUse.mxml

IT기술/Flex 2008.11.19