vkwave

Falsh Builder 4.5 Code

Jan 6th, 2012
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 1.01 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:WindowedApplication creationComplete="copyAndLoadImageInContainer()"  xmlns:fx="http://ns.adobe.com/mxml/2009"
  3.                        xmlns:s="library://ns.adobe.com/flex/spark"
  4.                        xmlns:mx="library://ns.adobe.com/flex/mx">
  5.     <fx:Declarations>
  6.         <!-- Place non-visual elements (e.g., services, value objects) here -->
  7.     </fx:Declarations>
  8.     <fx:Script>
  9.         <![CDATA[
  10.             import mx.controls.Text;
  11.             private function copyAndLoadImageInContainer():void
  12.             {
  13.                 var copyToFile:File = File.applicationStorageDirectory.resolvePath("demo-image.jpg");
  14.                 if(!copyToFile.exists)
  15.                 {
  16.                     var copyFile:File = File.applicationDirectory.resolvePath("demo-image.jpg");
  17.                     copyFile.copyTo(copyToFile);
  18.                 }
  19.                
  20.                 var displayImageText:String = '<img alt="demo-image" src="app-storage:/demo-image.jpg" />';
  21.                 imageDisplayDemo.htmlText = displayImageText;
  22.             }
  23.                        
  24.         ]]>
  25.     </fx:Script>
  26.  
  27.     <mx:HTML id="imageDisplayDemo" width="100%" height="100%" />   
  28.  
  29. </s:WindowedApplication>
Advertisement
Add Comment
Please, Sign In to add comment