This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function saveToFileHandler(event:MouseEvent):void | |
{ | |
var data:String = inputText.text; | |
debug("data to save: "+data); | |
var path:String = mdm.Application.path+"myFile.txt"; | |
debug("saving data at: "+path); | |
mdm.FileSystem.saveFileUnicode(path, data); | |
// now load it back | |
var request:URLRequest = new URLRequest(path); | |
urlLoader = new URLLoader(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* this method help to construct paths | |
* at runtime and will work during authoring | |
* and in ZINC application and on Win/Mac/Linux | |
*/ | |
public function getPath(path:String):String | |
{ | |
if(mdm.Application && mdm.Application.path.length > 0) | |
{ | |
path = "file://"+mdm.Application.path.split("\\").join("/")+path; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# destination as file path | |
set destination_file to ((path to desktop as string) & "myImage.jpg") as string | |
# source as url string | |
set source_file_url to "http://www.nasa.gov/images/content/180842main_access-lca.jpg" | |
# start download - it returns reference to a file if created | |
tell application "URL Access Scripting" | |
download source_file_url to destination_file replacing yes | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import mdm.DLL; | |
import mdm.System; | |
public class Kernel32 | |
{ | |
/* The drive type cannot be determined. */ | |
public static const DRIVE_UNKNOWN:int = 0; | |
/* The root path is invalid; for example, there is no volume mounted at the specified path. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
xmlns:mx="library://ns.adobe.com/flex/mx" | |
width="800" height="600" | |
applicationComplete="mdm.Application.init(this);"> | |
<fx:Script> | |
<![CDATA[ | |
import mdm.Application; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.events.Event; | |
import flash.events.IOErrorEvent; | |
import flash.events.ProgressEvent; | |
import flash.net.URLRequest; | |
import flash.net.URLStream; | |
import flash.utils.ByteArray; | |
import mdm.Application; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function printHandler(event:MouseEvent):void | |
{ | |
if(browser) | |
{ | |
if(flash.system.Capabilities.os.toLowerCase().substr(0, 1) == "w") | |
{ | |
browser.print(); | |
} else | |
{ | |
browser.goto("javascript:window.print();"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function sendRequestHandler(event:MouseEvent):void | |
{ | |
var request:URLRequest = new URLRequest("http://www.multidmedia.com/downloads/exchange/files/Simple_Applescript_Sample_042011.zip"); | |
sendHeadRequest(request); | |
request = null; | |
} | |
// | |
private var socket:Socket = null; | |
private var httpRequest:String = null; | |
private var httpServer:String = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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" | |
width="800" height="600" | |
backgroundAlpha="0.90" backgroundColor="#000000" | |
initialize="visible = false" | |
creationComplete="setupStage();" > | |
<!-- --> | |
<fx:Script> |
OlderNewer