Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <s:WindowedApplication creationComplete="copyAndLoadImageInContainer()" xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark"
- xmlns:mx="library://ns.adobe.com/flex/mx">
- <fx:Declarations>
- <!-- Place non-visual elements (e.g., services, value objects) here -->
- </fx:Declarations>
- <fx:Script>
- <![CDATA[
- import mx.controls.Text;
- private function copyAndLoadImageInContainer():void
- {
- var copyToFile:File = File.applicationStorageDirectory.resolvePath("demo-image.jpg");
- if(!copyToFile.exists)
- {
- var copyFile:File = File.applicationDirectory.resolvePath("demo-image.jpg");
- copyFile.copyTo(copyToFile);
- }
- var displayImageText:String = '<img alt="demo-image" src="app-storage:/demo-image.jpg" />';
- imageDisplayDemo.htmlText = displayImageText;
- }
- ]]>
- </fx:Script>
- <mx:HTML id="imageDisplayDemo" width="100%" height="100%" />
- </s:WindowedApplication>
Advertisement
Add Comment
Please, Sign In to add comment