Tutorials
« Previous Entries Next Entries »HTML Control
Monday, March 19th, 2007The mx:HTML control is something that is unique to Apollo and is very easy to integrate into your application. It can be used to simply load in an external html file by location as shown here:
123456<?xml version=â€1.0″ encoding=â€utf-8″?>
<mx:ApolloApplication
xmlns:mx=â€http://www.adobe.com/2006/mxml†layout=â€absoluteâ€>
<mx:HTML id=â€htmlâ€
location=â€http://blog.everythingflex.comâ€/>
</mx:ApolloApplication>
OR
It can be used for custom html using the htmlText property as shown below:
1234567891011<?xml version=â€1.0″ [...]
Windowing with Apollo - full source code
Monday, March 19th, 2007Windowing in Apollo is a very simple task.
The Windowing sample will demonstrate this by allowing you to set the preferences
of the new window by setting NativeWindow and NativeWindowInitOptions properties,
and then manage the windows by tracking them within a custom Array.
Creating a new window is as simple as this:
1var newWindow:NativeWindow = new NativeWindow(true,new NativeWindowInitOptions());
The function that [...]
Create your first Apollo Window
Monday, March 19th, 2007Creating a window is very simple with Apollo. This is a very basic example of how to create a new window that contains a custom component. Simply create a new Apollo project within FlexBuilder and paste the following as the main file. Create a component named MyComponent.mxml and paste the code at the bottom of [...]
File and FileStream within Apollo - full source code
Monday, March 19th, 2007Local access to the file system is what separates Apollo from Flex/Flash. This simple sample demonstrates how to read and write files to the local file system.
Here is the function that loads a file:
var file:File = File.appStorageDirectory;
file = file.resolve("Files/" + fdg.selectedItem.name);
stream = new FileStream();
stream.open(file, FileMode.READ);
var str:String = stream.readUTFBytes(stream.bytesAvailable);
stream.close();
str = str.replace(File.lineEnding, "\n");
contents.text = [...] 1234567891011private function loadFile():void{
Write your first file to the file system using Apollo
Monday, March 19th, 2007Creating a file is very simple with Apollo. This is a very basic example of how to create a new file which is saved to the appStorageDirectory. Simply create a new Apollo project within FlexBuilder and paste the following as the main file.
12345678910111213141516171819<?xml version=â€1.0″ encoding=â€utf-8″?>
<mx:ApolloApplication xmlns:mx=â€http://www.adobe.com/2006/mxmlâ€>
<mx:Script>
<![CDATA[
import flash.filesystem.*;
private var stream:FileStream;
private function saveFile():void{
var file:File = File.appStorageDirectory.resolve("HelloWorld.txt");
var stream:FileStream [...]


![[image]](http://mowser.com/img?url=http%3A%2F%2Fassets.max.adobe.com%2Fimages%2FMAX09_D125x125.jpg)



