Skip to content

Instantly share code, notes, and snippets.

@peterblazejewicz
Created May 16, 2011 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterblazejewicz/974631 to your computer and use it in GitHub Desktop.
Save peterblazejewicz/974631 to your computer and use it in GitHub Desktop.
scaling html content in Adobe Air
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication 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:Script>
<![CDATA[
protected function zoomInHandler(event:MouseEvent):void
{
html.htmlLoader.window.document.body.style.zoom = 1.5;
}
protected function resetZoomHandler(event:MouseEvent):void
{
html.htmlLoader.window.document.body.style.zoom = 1.0;
}
protected function zoomOutHandler(event:MouseEvent):void
{
html.htmlLoader.window.document.body.style.zoom = 0.5;
}
]]>
</fx:Script>
<s:Button x="10" y="10" label="Zoom in" click="zoomInHandler(event)"/>
<s:Button x="88" y="10" label="Reset zoom" click="resetZoomHandler(event)"/>
<s:Button x="181" y="10" label="Zoom out" click="zoomOutHandler(event)"/>
<mx:HTML id="html" x="10" y="39" width="1057" height="621" location="http://www.google.com"/>
</s:WindowedApplication>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment