2010-11-25 3 views

답변

0

도움이 될 경우이 예제를 시도하십시오. 이미지의 위치에 대한 경로에주의하십시오.

 <?xml version="1.0" encoding="utf-8"?> 
     <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> 
<mx:Script> 
    <![CDATA[ 
     /*in the source put the absolute path(like directory:/folder/image.gif) or the relative path (../image.gif where ../ is your project directory)to the location of your image 
     */ 
     [Embed (source="../src/assets/images/image.gif")] 
     [Bindable] 
     //this variable of type Class is used to refer to the aboveimage.. 
     public var img:Class; 
     public function buttonClickHandler():void{ 
      if(image.visible) 
      image.visible = false; 
      else 
      image.visible = true; 
      } 
      ]]> 
</mx:Script> 
<mx:Image source="{img}" visible="false" id="image"/> 
<mx:Button x="172" y="225" label="Button" id="button" click="buttonClickHandler()"/> 
</mx:Application> 
0

안녕 단추에 대한 클릭 처리기가 있습니다. 클릭 핸들러의 기능은 시각을 전환하여 이미지를 표시합니다. 이미지는 디자인 자체에 포함되어 있습니다. 버튼 클릭에 대한 가시성과 함께 플레이하십시오.

+0

을 포함한 자산 매입의에 대한 모든 종류의, here.explains. 그것은 가능한가? 다시 한번 감사드립니다 ..! – hemanth

+0

이미지를 복사하여 작업 영역의 프로젝트 폴더에 보관하십시오. 프로젝트 폴더에 임베드 할 수 있습니다 ... 아래 예를 참조하십시오. 그가 어떻게 임베드했는지 ... 같은 방법으로 – Flextron

+0

그게 좋습니다. 고맙습니다. 그것은 나에게 매우 유용하며 이제는 그런 종류의 일을 할 수 있습니다. 내가 알아야 할 한 가지 더. 즉, 사용자가 이미지를 볼 수있을 때 배경에서 사운드를 재생할 수 있습니다. 나는 '다음'버튼으로 이미지를 하나씩 보여줄 계획이고 적절한 사운드를 재생할 것입니다. 어떤 가능성? – hemanth

관련 문제