Skip to content

Instantly share code, notes, and snippets.

View caubry's full-sized avatar
🌵

Caroline Aubry caubry

🌵
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/1.0">
<id>com.myTest</id>
<filename>myTest</filename>
<name>NAME</name>
<description>DESCRIPTION</description>
<version>1.0</version>
<initialWindow>
<content>myTest.html</content>
<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/3.0">
<id>example.HelloWorld</id>
<versionNumber>1.0.1</versionNumber>
<filename>Hello World</filename>
<name>Example Co. AIR Hello World</name>
<description>
<text xml:lang="en">This is an example.</text>
<text xml:lang="fr">C'est un exemple.</text>
<text xml:lang="es">Esto es un ejemplo.</text>
@caubry
caubry / directory
Last active December 15, 2015 08:19
- [your_project_name]
- assets
[your_project_name].fla
- lib
[your_project_name].swc
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<application xmlns="http://ns.adobe.com/air/application/3.2">
<id>myApp</id>
<versionNumber>1.0</versionNumber>
<filename>myApp</filename>
<description>...</description>
<!-- To localize the description, use the following format for the description element.
<description>
<text xml:lang="en">English App description goes here</text>
<text xml:lang="fr">French App description goes here</text>
- [your_project_name]
- assets
[your_project_name].fla
- lib
[your_project_name]-app.xml
[your_project_name].swc
- src
Main.as
[your_project_name].sublime-project
[your_project_name].sublime-workspace
<?xml version="1.0" encoding="utf-8"?>
<flex-config>
<target-player>11.2</target-player>
<output>bin/myApp_output.swf</output>
<benchmark>false</benchmark>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<compiler>
<debug>true</debug>
<omit-trace-statements>true</omit-trace-statements>
<verbose-stacktraces>false</verbose-stacktraces>
{
"folders":
[
{
"path": "/Users/caubry/Desktop/myApp"
}
],
"template":
{
"mxmlc":
@caubry
caubry / CustomSpeed.as
Last active December 17, 2015 20:59
Snippet to calculate xSpeed depending on distance travelled and time given in milliseconds.
private static var FPS:Number = 25;
private var movingMc:MovieClip
private var stillMc:MovieClip
private var orignalXPos:Number = 0;
// Set a default value if setter isn't being called
private var xSpeed:Number = 2;
// Constructor
public function CustomSpeed():void
@caubry
caubry / Node.as
Last active December 21, 2015 20:49
var myXML:XML = generalInformationService._xml;
for (var i:int = 0; i < myXML.length(); i++)
{
var node:XML = myXML[i];
var brandNode:String = myXML[i].@brand;
var newNodes:XML = new XML( <BRAND><NAME>{brandNode}</NAME></BRAND> );
node.prependChild(newNodes);
delete node.@brand;
@caubry
caubry / LoadXML.as
Last active December 21, 2015 20:49
protected var fileStream:FileStream;
protected static const LOCATION_XML:String = "/d/.../myXML.xml"; // Location of your XML
public function loadXML():void
{
var fileSettings:File = File.applicationStorageDirectory.resolvePath(LOCATION_XML);
if (fileSettings.exists)
{
fileStream = new FileStream();