sprout-as3-puremvc-bundle 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +48 -0
- data/lib/sprout/as3.rb +5 -0
- data/lib/sprout/as3/version.rb +12 -0
- data/lib/sprout/as3_tasks.rb +7 -0
- data/lib/sprout/generators/class/USAGE +42 -0
- data/lib/sprout/generators/class/class_generator.rb +20 -0
- data/lib/sprout/generators/class/templates/Class.as +8 -0
- data/lib/sprout/generators/class/templates/Component.mxml +8 -0
- data/lib/sprout/generators/class/templates/TestCase.as +30 -0
- data/lib/sprout/generators/class/templates/TestSuite.as +18 -0
- data/lib/sprout/generators/component/component_generator.rb +18 -0
- data/lib/sprout/generators/component/templates/Component.mxml +3 -0
- data/lib/sprout/generators/component/templates/TestSuite.as +18 -0
- data/lib/sprout/generators/component/templates/VisualTestCase.as +32 -0
- data/lib/sprout/generators/project/project_generator.rb +163 -0
- data/lib/sprout/generators/project/templates/MainClass.as +139 -0
- data/lib/sprout/generators/project/templates/README.txt +56 -0
- data/lib/sprout/generators/project/templates/TestRunner.as +15 -0
- data/lib/sprout/generators/project/templates/deploy/assets/css/main.css +5 -0
- data/lib/sprout/generators/project/templates/deploy/assets/js/swfobject.js +5 -0
- data/lib/sprout/generators/project/templates/deploy/assets/swf/express_install.swf +0 -0
- data/lib/sprout/generators/project/templates/deploy/index.html +30 -0
- data/lib/sprout/generators/project/templates/embed/fonts/arial.ttf +0 -0
- data/lib/sprout/generators/project/templates/embed/fonts/fonts.xml +42 -0
- data/lib/sprout/generators/project/templates/embed/template/AssetEmbedTemplate.as +15 -0
- data/lib/sprout/generators/project/templates/embed/template/FontTemplate.as +20 -0
- data/lib/sprout/generators/project/templates/generate +21 -0
- data/lib/sprout/generators/project/templates/lib/PureMVC_AS3_2_0_3.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/com_ffsys_utils_font.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/com_ffsys_utils_locale.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_core.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_effects.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_effects_tween.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_errors.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_events.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_io.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_address.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_array.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_assert.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_bezier.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_boolean.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_byte.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_collections.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_display.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_flex.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_font.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_history.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_identifier.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_inspector.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_locale.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_number.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_object.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_random.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_reflection.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_reflection_members.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_reflection_meta.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_reflection_parser.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_regex.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_string.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_substitution.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_time.swc +0 -0
- data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_xml.swc +0 -0
- data/lib/sprout/generators/project/templates/rakeassets.rb +77 -0
- data/lib/sprout/generators/project/templates/rakefile.rb +112 -0
- data/lib/sprout/generators/project/templates/rakefonts.rb +170 -0
- data/lib/sprout/generators/suite/USAGE +0 -0
- data/lib/sprout/generators/suite/suite_generator.rb +17 -0
- data/lib/sprout/generators/suite/templates/TestSuite.as +18 -0
- data/lib/sprout/generators/test/USAGE +37 -0
- data/lib/sprout/generators/test/templates/TestCase.as +30 -0
- data/lib/sprout/generators/test/templates/TestSuite.as +18 -0
- data/lib/sprout/generators/test/test_generator.rb +20 -0
- data/lib/sprout/tasks/asdoc_doc.rb +155 -0
- data/lib/sprout/tasks/asdoc_rdoc.rb +155 -0
- data/lib/sprout/tasks/asdoc_task.rb +276 -0
- data/lib/sprout/tasks/asunit_task.rb +148 -0
- data/lib/sprout/tasks/compc_doc.rb +543 -0
- data/lib/sprout/tasks/compc_rdoc.rb +543 -0
- data/lib/sprout/tasks/compc_task.rb +130 -0
- data/lib/sprout/tasks/fcsh_task.rb +13 -0
- data/lib/sprout/tasks/fdb_task.rb +0 -0
- data/lib/sprout/tasks/mxmlc_doc.rb +484 -0
- data/lib/sprout/tasks/mxmlc_rdoc.rb +484 -0
- data/lib/sprout/tasks/mxmlc_task.rb +659 -0
- data/rakefile.rb +73 -0
- metadata +192 -0
@@ -0,0 +1,139 @@
|
|
1
|
+
package {
|
2
|
+
//import AssetEmbed;
|
3
|
+
import flash.display.Sprite;
|
4
|
+
import flash.text.TextField;
|
5
|
+
|
6
|
+
import com.ffsys.io.loaders.events.ILoadEvent;
|
7
|
+
import com.ffsys.io.loaders.events.LoadEvent;
|
8
|
+
import com.ffsys.io.loaders.events.LoadProgressEvent;
|
9
|
+
import com.ffsys.io.loaders.events.LoadStartEvent;
|
10
|
+
import com.ffsys.io.loaders.events.LoaderQueueStartEvent;
|
11
|
+
import com.ffsys.io.loaders.events.LoadCompleteEvent;
|
12
|
+
import com.ffsys.io.loaders.events.MovieLoadEvent;
|
13
|
+
import com.ffsys.io.loaders.events.ResourceNotFoundEvent;
|
14
|
+
import com.ffsys.io.loaders.events.XmlLoadEvent;
|
15
|
+
|
16
|
+
import com.ffsys.utils.font.ITypeFaceManager;
|
17
|
+
import com.ffsys.utils.font.TypeFaceManager;
|
18
|
+
|
19
|
+
import com.ffsys.utils.locale.ILocale;
|
20
|
+
import com.ffsys.utils.locale.Locale;
|
21
|
+
|
22
|
+
public class <%= project_name %> extends Sprite {
|
23
|
+
|
24
|
+
/**
|
25
|
+
* The default path to the font definition
|
26
|
+
* document.
|
27
|
+
*/
|
28
|
+
static public const DEFAULT_FONTS_PATH:String =
|
29
|
+
"assets/xml/fonts.xml";
|
30
|
+
|
31
|
+
/**
|
32
|
+
* The type face manager used to load external
|
33
|
+
* font libraries.
|
34
|
+
*/
|
35
|
+
private var _typeFaceManager:ITypeFaceManager;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Creates a <%= project_name %> instance.
|
39
|
+
*/
|
40
|
+
public function <%= project_name %>()
|
41
|
+
{
|
42
|
+
trace("<%= project_name %> instantiated!");
|
43
|
+
//addChild( new AssetEmbed.CLASS_VARIABLE_NAME() );
|
44
|
+
//loadFonts();
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Starts the font loading process.
|
49
|
+
*/
|
50
|
+
private function loadFonts():void
|
51
|
+
{
|
52
|
+
var locale:ILocale = new Locale();
|
53
|
+
locale.lang = "en";
|
54
|
+
locale.country = "GB";
|
55
|
+
|
56
|
+
_typeFaceManager = new TypeFaceManager();
|
57
|
+
_typeFaceManager.locale = locale;
|
58
|
+
|
59
|
+
_typeFaceManager.addEventListener(
|
60
|
+
ResourceNotFoundEvent.RESOURCE_NOT_FOUND,
|
61
|
+
fontResourceNotFound, false, 0, true );
|
62
|
+
|
63
|
+
_typeFaceManager.addEventListener(
|
64
|
+
LoadEvent.DATA,
|
65
|
+
fontLoaded, false, 0, true );
|
66
|
+
|
67
|
+
_typeFaceManager.addEventListener(
|
68
|
+
LoadCompleteEvent.LOAD_COMPLETE,
|
69
|
+
fontLoadComplete, false, 0, true );
|
70
|
+
|
71
|
+
_typeFaceManager.load( DEFAULT_FONTS_PATH );
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Listeners invoked if the font definition document
|
76
|
+
* or any referenced font libraries could not be found.
|
77
|
+
*/
|
78
|
+
private function fontResourceNotFound(
|
79
|
+
event:ResourceNotFoundEvent ):void
|
80
|
+
{
|
81
|
+
//call the preventDefault() method
|
82
|
+
//if you do not want the runtime error
|
83
|
+
//thrown when a resource could not be found
|
84
|
+
//event.preventDefault();
|
85
|
+
}
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Listener invoked when the type face manager
|
89
|
+
* has loaded an asset, this is invoked for
|
90
|
+
* the definition document as well as all font
|
91
|
+
* libraries.
|
92
|
+
*/
|
93
|
+
private function fontLoaded( event:ILoadEvent ):void
|
94
|
+
{
|
95
|
+
var uri:String = event.loader.uri;
|
96
|
+
|
97
|
+
if( event is XmlLoadEvent )
|
98
|
+
{
|
99
|
+
trace("Font definition document loaded: " + uri );
|
100
|
+
}else if( event is MovieLoadEvent )
|
101
|
+
{
|
102
|
+
trace("Font library loaded: " + uri );
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Listener invoked when all fonts are loaded
|
108
|
+
* and available.
|
109
|
+
*/
|
110
|
+
private function fontLoadComplete(
|
111
|
+
event:LoadCompleteEvent ):void
|
112
|
+
{
|
113
|
+
trace( "All fonts loaded and available." );
|
114
|
+
|
115
|
+
testLoadedFont();
|
116
|
+
}
|
117
|
+
|
118
|
+
/**
|
119
|
+
* Tests adding a text field instance using
|
120
|
+
* a runtime embedded font library.
|
121
|
+
*/
|
122
|
+
private function testLoadedFont():void
|
123
|
+
{
|
124
|
+
//test for creating a textfield with loaded font data
|
125
|
+
var txt:TextField = new TextField();
|
126
|
+
|
127
|
+
txt.embedFonts = true;
|
128
|
+
|
129
|
+
txt.defaultTextFormat =
|
130
|
+
_typeFaceManager.getTextFormatById( "main" );
|
131
|
+
|
132
|
+
txt.width = 300;
|
133
|
+
txt.height = 25;
|
134
|
+
txt.text = "Runtime font library: " + txt.defaultTextFormat.font;
|
135
|
+
|
136
|
+
addChild( txt );
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
|
2
|
+
########################################
|
3
|
+
This project was generated using Sprouts
|
4
|
+
http://code.google.com/p/projectsprouts/
|
5
|
+
|
6
|
+
Please report any bugs to:
|
7
|
+
http://code.google.com/p/projectsprouts/issues/list
|
8
|
+
|
9
|
+
Please feel free to ask questions at:
|
10
|
+
http://groups.google.com/group/projectsprouts
|
11
|
+
|
12
|
+
########################################
|
13
|
+
Using your favorite terminal, cd to this directory have fun!
|
14
|
+
|
15
|
+
########################################
|
16
|
+
To create a new ActionScript class, TestCase and rebuild all project TestSuites:
|
17
|
+
|
18
|
+
script/generate class -s utils.MathUtil
|
19
|
+
|
20
|
+
########################################
|
21
|
+
To create a new Interface begin the name with I + Capital letter (eg: ISomeName)
|
22
|
+
or end the name with 'able'
|
23
|
+
|
24
|
+
Name begins with Capital 'I' followed by another capital letter
|
25
|
+
script/generate class utils.ISomeName
|
26
|
+
|
27
|
+
or
|
28
|
+
|
29
|
+
Name ends with 'able'
|
30
|
+
script/generate class utils.Observable
|
31
|
+
|
32
|
+
or
|
33
|
+
|
34
|
+
Explicitly identify interface creation
|
35
|
+
script/generate interface utils.SomeInterface
|
36
|
+
|
37
|
+
########################################
|
38
|
+
To create a new TestCase only, enter the following:
|
39
|
+
|
40
|
+
script/generate test utils.SomeTest
|
41
|
+
|
42
|
+
########################################
|
43
|
+
To compile and launch your application:
|
44
|
+
|
45
|
+
rake
|
46
|
+
|
47
|
+
########################################
|
48
|
+
To compile and launch your test suites:
|
49
|
+
|
50
|
+
rake test
|
51
|
+
|
52
|
+
########################################
|
53
|
+
To see all available rake tasks:
|
54
|
+
|
55
|
+
rake -T
|
56
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
package {
|
2
|
+
import asunit.textui.TestRunner;
|
3
|
+
|
4
|
+
public class <%= project_name %>Runner extends TestRunner {
|
5
|
+
|
6
|
+
public function <%= project_name %>Runner() {
|
7
|
+
// start(clazz:Class, methodName:String, showTrace:Boolean)
|
8
|
+
// NOTE: sending a particular class and method name will
|
9
|
+
// execute setUp(), the method and NOT tearDown.
|
10
|
+
// This allows you to get visual confirmation while developing
|
11
|
+
// visual entities
|
12
|
+
start(AllTests, null, TestRunner.SHOW_TRACE);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/* SWFObject v2.0 <http://code.google.com/p/swfobject/>
|
2
|
+
Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
3
|
+
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
4
|
+
*/
|
5
|
+
var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var e=function(){if(!a.w3cdom){return }J(I);if(a.ie&&a.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=c("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);V()}}}}catch(j){}}if(a.webkit&&typeof g.readyState!=Z){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){V()}},10)}if(typeof g.addEventListener!=Z){g.addEventListener("DOMContentLoaded",V,null)}M(V)}();function V(){if(S){return }if(a.ie&&a.win){var m=Y("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return }}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=Z){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=Z){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=Z){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(a.pv[0]>0){var k=c(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(a.webkit&&a.webkit<312){U(k)}X(m,true)}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(a.win||a.mac)){D(H[j])}else{d(k)}}}}else{X(m,true)}}}function U(m){var k=m.getElementsByTagName(P)[0];if(k){var p=Y("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(a.ie&&a.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=c(i);if(k){for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)}})}}function D(j){C=true;var o=c(j.id);if(o){if(j.altContentId){var l=c(j.altContentId);if(l){L=l;T=j.altContentId}}else{L=b(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=a.ie&&a.win?"ActiveX":"PlugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(a.ie&&a.win&&o.readyState!=4){var i=Y("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function d(j){if(a.ie&&a.win&&j.readyState!=4){var i=Y("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(b(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(b(j),j)}}function b(n){var m=Y("div");if(a.win&&a.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=c(q);if(typeof AE.id==Z){AE.id=q}if(a.ie&&a.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=c(AE.id)}else{if(a.webkit&&a.webkit<312){var AA=Y("embed");AA.setAttribute("type",W);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=Y(P);s.setAttribute("type",W);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass"){s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=Y("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function c(i){return g.getElementById(i)}function Y(i){return g.createElement(i)}function O(k){var j=a.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(a.ie&&a.mac){return }var l=g.getElementsByTagName("head")[0],k=Y("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(a.ie&&a.win)&&typeof g.createTextNode!=Z){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(a.ie&&a.win&&typeof g.styleSheets!=Z&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){i.addRule(m,j)}}}function X(k,i){var j=i?"visible":"hidden";if(S){c(k).style.visibility=j}else{A("#"+k,"visibility:"+j)}}return{registerObject:function(l,i,k){if(!a.w3cdom||!l||!i){return }var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;X(l,false)},getObjectById:function(l){var i=null;if(a.w3cdom&&S){var j=c(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=Z)){i=j}else{if(typeof k.SetVariable!=Z){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!a.w3cdom||!n||!u||!r||!t||!j){return }r+="";t+="";if(O(j)){X(u,false);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=Z){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);if(q.id==u){X(u,true)}})}else{if(m&&!C&&O("6.0.65")&&(a.win||a.mac)){X(u,false);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstall=m;D(i)})}}},getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(a.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(a.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=c(K);if(i){i.parentNode.replaceChild(L,i);if(T){X(T,true);if(a.ie&&a.win){L.style.display="block"}}L=null;T=null;C=false}}}}}();
|
Binary file
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
3
|
+
<head>
|
4
|
+
<title><%= project_name %></title>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
6
|
+
<script type="text/javascript" src="assets/js/swfobject.js"></script>
|
7
|
+
<link rel="stylesheet" media="screen" href="assets/css/main.css" type="text/css" />
|
8
|
+
<script type="text/javascript">
|
9
|
+
swfobject.registerObject( "<%= project_name %>", "9.0.0", "assets/swf/express_install.swf" );
|
10
|
+
</script>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<h3><%= project_name %></h3>
|
14
|
+
<div>
|
15
|
+
<object id="<%= project_name.downcase %>" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600">
|
16
|
+
<param name="movie" value="<%= project_name.downcase %>.swf" />
|
17
|
+
<!--[if !IE]>-->
|
18
|
+
<object id="<%= project_name.downcase %>" type="application/x-shockwave-flash" data="<%= project_name.downcase %>.swf" width="800" height="600">
|
19
|
+
<!--<![endif]-->
|
20
|
+
<div>
|
21
|
+
<h1>Alternative content</h1>
|
22
|
+
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
|
23
|
+
</div>
|
24
|
+
<!--[if !IE]>-->
|
25
|
+
</object>
|
26
|
+
<!--<![endif]-->
|
27
|
+
</object>
|
28
|
+
</div>
|
29
|
+
</body>
|
30
|
+
</html>
|
Binary file
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<TypeFaceManager>
|
3
|
+
<TypeFaceGroup lang="en">
|
4
|
+
|
5
|
+
<!-- test for non-embedded fonts -->
|
6
|
+
<TypeFace id="sans">
|
7
|
+
<TypeFaceStyles>
|
8
|
+
<TypeFaceStyle id="sansMain">
|
9
|
+
<align>left</align>
|
10
|
+
<color>0x0000ff</color>
|
11
|
+
<font>_sans</font>
|
12
|
+
</TypeFaceStyle>
|
13
|
+
</TypeFaceStyles>
|
14
|
+
</TypeFace>
|
15
|
+
|
16
|
+
<!-- test for a simple embedded font -->
|
17
|
+
<TypeFace id="arial">
|
18
|
+
<Embed>
|
19
|
+
<source>arial.ttf</source>
|
20
|
+
<fontFamily>Arial</fontFamily>
|
21
|
+
<fontWeight>normal</fontWeight>
|
22
|
+
<mimeType>application/x-font</mimeType>
|
23
|
+
<unicodeRange>U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E</unicodeRange>
|
24
|
+
<variable>ARIAL</variable>
|
25
|
+
</Embed>
|
26
|
+
<TypeFaceStyles>
|
27
|
+
<TypeFaceStyle id="main">
|
28
|
+
<align>left</align>
|
29
|
+
<color>0x0000ff</color>
|
30
|
+
|
31
|
+
<css>
|
32
|
+
<![CDATA[
|
33
|
+
.link {
|
34
|
+
color: #00ff00;
|
35
|
+
}
|
36
|
+
]]>
|
37
|
+
</css>
|
38
|
+
</TypeFaceStyle>
|
39
|
+
</TypeFaceStyles>
|
40
|
+
</TypeFace>
|
41
|
+
</TypeFaceGroup>
|
42
|
+
</TypeFaceManager>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
package {
|
2
|
+
import flash.display.Sprite;
|
3
|
+
|
4
|
+
/**
|
5
|
+
* AssetEmbed
|
6
|
+
*
|
7
|
+
* Automatically generated embed class.
|
8
|
+
*/
|
9
|
+
public class AssetEmbed extends Sprite {
|
10
|
+
<% @assets.each do |asset| %>
|
11
|
+
[Embed( source='<%= asset[:source] %>' )]
|
12
|
+
public static const <%= asset[:variable] %>:Class;
|
13
|
+
<% end %>
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
package {
|
2
|
+
import flash.display.Sprite;
|
3
|
+
import flash.text.Font;
|
4
|
+
/**
|
5
|
+
* <%= @fontClassName %>
|
6
|
+
*
|
7
|
+
* Automatically generated font embed class.
|
8
|
+
*/
|
9
|
+
public class <%= @fontClassName %> extends Sprite {
|
10
|
+
<% @group[:fonts].each do |font| %>
|
11
|
+
[Embed( source='<%= font[:source] %>',
|
12
|
+
fontFamily='<%= font[:fontFamily] %>',
|
13
|
+
fontWeight='<%= font[:fontWeight] %>',
|
14
|
+
mimeType='<%= font[:mimeType] %>',
|
15
|
+
unicodeRange='<%= font[:unicodeRange] %>' )]
|
16
|
+
public static const <%= font[:variable] %>:Class;
|
17
|
+
Font.registerFont( <%= font[:variable] %> );
|
18
|
+
<% end %>
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'sprout'
|
4
|
+
sprout 'sprout-as3-bundle'
|
5
|
+
|
6
|
+
# Add a class name if TestSuites were generated
|
7
|
+
if(ARGV.size == 1 && ARGV[0] == 'suite')
|
8
|
+
ARGV << 'AllTests'
|
9
|
+
end
|
10
|
+
|
11
|
+
# Insert class type by default
|
12
|
+
if(ARGV.size == 1)
|
13
|
+
ARGV.unshift('class')
|
14
|
+
end
|
15
|
+
|
16
|
+
# Execute generators like this:
|
17
|
+
# script/generate class utils.MathUtil
|
18
|
+
# script/generate suite
|
19
|
+
# script/generate test utils.MathUtilTest
|
20
|
+
|
21
|
+
Sprout::Sprout.generate('as3', ARGV.shift, ARGV, File.dirname(File.dirname(__FILE__)))
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_reflection_members.swc
ADDED
Binary file
|
data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_reflection_meta.swc
ADDED
Binary file
|
data/lib/sprout/generators/project/templates/lib/opt/ffsys/com_ffsys_utils_reflection_parser.swc
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require "erb"
|
2
|
+
|
3
|
+
task :embed do |t|
|
4
|
+
|
5
|
+
output_class_name = "AssetEmbed";
|
6
|
+
|
7
|
+
#path to the embed directory
|
8
|
+
embed_dir = File.join( "embed" );
|
9
|
+
|
10
|
+
#path to erb template directory
|
11
|
+
template_dir = File.join( "embed", "template" );
|
12
|
+
|
13
|
+
#path to the template class file
|
14
|
+
embed_template = File.join( template_dir, output_class_name + "Template.as" );
|
15
|
+
|
16
|
+
#array of embeddable assets
|
17
|
+
assets = [];
|
18
|
+
|
19
|
+
template = File.new( embed_template )
|
20
|
+
|
21
|
+
if !File.exists?( embed_template )
|
22
|
+
puts ERR_NO_TEMPLATE;
|
23
|
+
exit( 1 );
|
24
|
+
end
|
25
|
+
|
26
|
+
#now read in the template file
|
27
|
+
fp = File.open( embed_template );
|
28
|
+
contents = fp.read();
|
29
|
+
fp.close();
|
30
|
+
|
31
|
+
@assets = [];
|
32
|
+
|
33
|
+
dir_pattern = File.join( embed_dir, "**", "*.{png,jpg,jpeg,mp3,wav,aif}" );
|
34
|
+
|
35
|
+
dir_contents =
|
36
|
+
Dir.glob( dir_pattern );
|
37
|
+
|
38
|
+
#convert the document to an object structure
|
39
|
+
dir_contents.each do |element|
|
40
|
+
|
41
|
+
source = element;
|
42
|
+
source = source.sub( /^embed\//, "" );
|
43
|
+
|
44
|
+
asset = {
|
45
|
+
:source => source,
|
46
|
+
:variable => get_class_name( File.basename( element ) ) };
|
47
|
+
|
48
|
+
@assets.push( asset );
|
49
|
+
end
|
50
|
+
|
51
|
+
#set up the ERB instance using the template
|
52
|
+
#previously loaded
|
53
|
+
erb = ERB.new <<-EOF
|
54
|
+
#{contents}
|
55
|
+
EOF
|
56
|
+
|
57
|
+
#now do the erb template parsing
|
58
|
+
result = erb.result( binding );
|
59
|
+
|
60
|
+
#now write the parsed class file for the font group
|
61
|
+
output_file = File.join( embed_dir, output_class_name + ".as" );
|
62
|
+
|
63
|
+
fp = open( output_file, "w+" );
|
64
|
+
fp.write( result );
|
65
|
+
fp.close();
|
66
|
+
|
67
|
+
puts "#{@assets.length} assets embedded in #{output_file}";
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
def get_class_name( file_name )
|
72
|
+
#strip the extension
|
73
|
+
file_name = file_name.gsub( /\.[a-zA-Z0-9]+$/, "" );
|
74
|
+
#replace spaces with underscores
|
75
|
+
file_name.gsub( / /, "_" );
|
76
|
+
return file_name.upcase;
|
77
|
+
end
|