tag:blogger.com,1999:blog-183263722009-04-28T09:42:13.937-07:00Ideas and cool stuffTyler Larson's web design and application development ideas and cool stuff that inspires me to continue doing so. Flash, Flex, ActionScript, ECMA, Ruby, et cetera!!!tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-18326372.post-51460432601627388512009-04-28T08:52:00.000-07:002009-04-28T09:42:13.951-07:00Textmate Upgrades for ActionScriptI was just upgrading Textmate and was looking into a few things that I was shown FDT can do that I didn't know how to do in TextMate and came across a few helpful things.<br /><br />The most important thing if you dont have it already is the ActionScript 3 bundle. If you have this skip this section. The most updated version always lives here.<br /><a href="http://svn.textmate.org/trunk/Review/Bundles/">svn.textmate.org/trunk/Review/Bundles</a><br /><br />You can download this with any SVN client with this url. When you get it on your computer make sure that the name of the folder ends with ".tmbundle"<br />If so you can just double click this file and it will install.<br /><br />To get this going you have to open TextMate &gt; Preferences &gt; Advanced &gt; Shell Variables and click the plus button.<br />Type MXMLC in the variable column and the path to the bin folder of your Flex SDK in the value.<br />This will enable you to compile from TextMate much like you do with Flex.<br /><br />This gives you a list of features that you can start to check out by opening File &gt; New From Template &gt; ActionScript 3 &gt; Project<br /><br />After you get this going and work with it for a while you will see there are some odd things that occasionally happen in the project draw.<br />To fix this and add all kinds of other features get this. <a href="http://ciaranwal.sh/2008/08/05/textmate-plug-in-projectplus">ProjectPlus</a><br />The biggest thing it adds for me besides reliability is SCM (source code management) info.<br /><br />With all this you will be set but one of the things that FDT can do that TextMate was missing was a searchable code browser but this is simply solved with this.<br /><a href="http://www.cocoabits.com/TmCodeBrowser/">TmCodeBrowser</a><br /><br />This has a basic implementation of ActionScript support built in but it is missing a few things. To make it better <a href="txmt://open?url=file://.ctags.tmcodebrowser">edit this page here</a> and add this.<br /><code><br />--langdef=Actionscript<br />--langmap=Actionscript:.as<br />--regex-Actionscript=/^[ \t]*[(private| public|static) ( \t)]*function[ \t]+([A-Za-z0-9_]+)[ \t]*\(/\1/f,function,functions/<br />--regex-Actionscript=/^[ \t]*[(public) ( \t)]*function[ \t]+(set|get) [ \t]+([A-Za-z0-9_]+)[ \t]*\(/\1 \2/p,property,properties/<br />--regex-Actionscript=/^[ \t]*[(private| public|static) ( \t)]*var[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/v,variable,variables/<br />--regex-Actionscript=/^[ \t]*[(private| public|static) ( \t)]*const[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/v,constant,constants/<br />--regex-Actionscript=/.*\.prototype \.([A-Za-z0-9 ]+)=([ \t]?)function( [ \t]?)*\(/\1/ f,function,functions/<br />--regex-Actionscript=/^[ \t]*class[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/c,class, classes/<br /></code><br /><br />With all this you are set, there is more features that you will really need but here is a list of my favorites.<br />doc ⇥ - Create an ASDoc block<br />⇧ ⌘ D - Open superclass<br />From the ActionScript 3 menu, Debug &gt; Install / Edit Debug Player Settings<br />⇧ ⌘ C - Insert Color<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-5146043260162738851?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-11690180077983152702008-06-20T10:54:00.000-07:002008-06-20T13:51:14.611-07:00Feature requestI've added a feature request to fix SEO in the flash player, please vote if you feel it's a good idea.<br />http://bugs.adobe.com/jira/browse/FP-362<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-1169018007798315270?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-5166411198837660802008-06-09T07:26:00.000-07:002008-06-09T07:32:15.797-07:00Hi,<br />Found this in a new JavaScript book (<a href="http://en.wikipedia.org/wiki/Douglas_Crockford" title="Douglas Crockford" rel="wikipedia" class="zem_slink">Douglas Crockford</a>'s '<a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742">JavaScript the Good Parts</a>' [O'Reilly]) converted it to AS3 and wanted to <br />share, this little object blows my mind, read it over and I'll <br />explain below.<br /><br /><pre><br />var myObject:Object = function() : Object {<br /> var value = 0;<br /> return {<br /> increment: function (inc:Number = 1) {<br /> value += inc;<br /> },<br /> getValue: function() {<br /> return value;<br /> }<br /> }<br />}();<br /><br />myObject.increment();<br />trace(myObject.getValue()); // traces: 1<br />myObject.increment();<br />trace(myObject.getValue()); // traces: 2<br /></pre><br /><br />There's a few odd things here, we are able to persist the value of a <br />variable from inside of an object and run calculations on it. This is <br />the same thing as creating a class and then defining a class level <br />variable inside of it. We are then defining functions inside of this <br />returned object that can use these persistent variables.<br /><br />Other odd things, notice the last line of the myObject definition. We <br />are executing the function right away, personally I never seen this <br />before but opens my mind a little further into the way that objects <br />interact and what calling a function really means.<br /><br />This all runs in AS3 but if you go into this to deeply I personally <br />wouldn't want to step in and work on that code. I think this is more <br />interesting to show how objects can interact and what is happening <br />and how things can be passed around.<br /><br />Thanks to J-C for sending this over to me. If you don't fully <br />understand it's cool but we should cover some of this at a fcny meeting <br />some day. There are other ideas in that book that will blow your mind even further <br />but I'll spare you for now, this one just has stuck in my mind and I <br />wanted to share.<br /><br />-Tyler<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/0e70c80d-a10a-4f22-af83-cc7ec69cdf66/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_a.png?x-id=0e70c80d-a10a-4f22-af83-cc7ec69cdf66" alt="Zemanta Pixie" /></a></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-516641119883766080?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-91829688829364228412008-04-23T20:59:00.000-07:002008-04-23T21:06:16.396-07:00Flash Coders NY MVCI've been doing ActionScript sessions at the <a href="http://flashcodersny.org">flash coders meetings</a> and have come up with a simple <a href="http://en.wikipedia.org/wiki/Model-view-controller" title="Model-view-controller" rel="wikipedia" target="_blank" class="zem_slink">MVC</a> framework that is much easier to understand and explain then the standard things that you see out there. If you are looking for something to start with it isn't bad.<br /><a href="http://motionandcolor.com/examples/fcny/fcny.zip">Download the files here!</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-9182968882936422841?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-47263679201630481762008-04-22T23:04:00.000-07:002008-04-22T23:18:22.084-07:00Runtime expression evaluation in ActionScriptThe <a href="http://www.mozilla.org/projects/tamarin/" title="Tamarin (JIT)" rel="homepage" target="_blank" class="zem_slink">Tamarin</a> port that I mentioned before is big and heavy and classes upon classes porting everything that they could from the Java source that really creates the swf byte code. The other way to go about making <a href="http://en.wikipedia.org/wiki/Eval" title="Eval" rel="wikipedia" target="_blank" class="zem_slink">eval()</a> is to break the problem down to what really needs to happen and not cloud your code with Java garbage. Amazing what you can do with ActionScript. This is a really amazing piece of code, really well written in my opinion, <a href="http://www.sephiroth.it/weblog/archives/2008/04/runtime_expression_evaluation_in_acti.php">Check it out here.</a> <br /><br />I hope more is added to the library and a few things are changed a little but I'm really excited how small it is. I will try and add it into <a href="http://code.google.com/p/htmlwrapper/">Wrapper</a> when I get a chance.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-4726367920163048176?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-57872397005931475632008-04-22T22:51:00.000-07:002008-04-22T23:04:11.613-07:00ActionScript 101 and simple MVCI'm speaking again at the <a href="http://FlashCodersNY.org">FlashCodersNY</a> meeting wednesday night. I'm going to continue my talk from a few weeks ago about class structure. Last week I should how to make a simple <a href="http://en.wikipedia.org/wiki/Model-view-controller" title="Model-view-controller" rel="wikipedia" target="_blank" class="zem_slink">MVC</a> project structure if you missed it <a href="http://motionandcolor.com/examples/fcny/fcny_structure.zip">here are the files. </a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-5787239700593147563?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-60008177077276343272008-04-12T20:48:00.000-07:002008-04-12T22:43:37.235-07:00New ActionScript Stuff<span class="zemanta-img" style="margin: 1em; display: block; float: right;"><a href="http://en.wikipedia.org/wiki/Image:Adobe_Photoshop_Elements_6.png" target="_blank"><img src="http://upload.wikimedia.org/wikipedia/en/thumb/1/13/Adobe_Photoshop_Elements_6.png/202px-Adobe_Photoshop_Elements_6.png" alt="Adobe Photoshop Elements" style="border: medium none ; display: block;"></a></span><a href="http://en.wikipedia.org/wiki/ActionScript" title="ActionScript" rel="wikipedia" target="_blank" class="zem_slink">ActionScript</a> is the coolest but to prove the point here is a few things that I've come across my travels lately. <br /><br /><a href="https://www.photoshop.com/express/">New Photoshop Elements made in Flex </a><br /><a href="http://www.adobe.com" title="Adobe Systems" rel="homepage" target="_blank" class="zem_slink">Adobe</a> is starting to take clue <a href="http://en.wikipedia.org/wiki/Web_2.0" title="Web 2.0" rel="wikipedia" target="_blank" class="zem_slink">web 2.0</a> area of getting away from the desktop and doing a pretty good job of understanding the market. Other efforts like <a href="http://www.adobe.com/products/acrobatconnect" title="Adobe Acrobat Connect" rel="homepage" target="_blank" class="zem_slink">Adobe Connect</a> isn't really mind blowing if you ask me but this is a pretty nice application that I can see a lot of people using. It is a little to simple for me but I also am not really the target audience so I still think it is pretty great. It is nice that Adobe is using there own products to create but it also scares me a little. I don't want them taking the thunder away from other businesses that are creating comparable products with there technology already. There are a few of products that already have this type of functionality but it is Adobe's niche also so I understand but hope that it doesn't continue to much. Buzzword was questionable but they are adding some nice text features that I imagine were inspired by this purchase. <br /><br /><a href="http://metal.hurlant.com/blog/2008/01/02/flash/eval%28%29eval%28%29-and-actionscript/">An ActionScript Compiler written in ActionScript</a> <br />This is an amazing project that I think was missed buy the ActionScript community at large. The ability to compile within ActionScript opens the doors to all kinds of dynamic functionality that is currently very limited. I use methods like getDefinition all the time trying to create some form of flexibility within my projects but <a href="http://en.wikipedia.org/wiki/Eval" title="Eval" rel="wikipedia" target="_blank" class="zem_slink">eval()</a>eval()() has been greatly missed and I look forward to maybe one day coming back to ActionScript. I haven't spent a lot of time with this project but I'd like to see what it is capable of with out crashing everything. <br /><br /><a href="http://jacwright.com/blog/55/air-active-record/">ActionScript ActiveRecord for AIR SQLite</a><br />I'm working on a big <a href="http://en.wikipedia.org/wiki/Adobe_Integrated_Runtime" title="Adobe Integrated Runtime" rel="wikipedia" target="_blank" class="zem_slink">AIR</a> app and have already written all my database stuff but next time totally using this. It also comes with some really nice utilities that would be great to <br /><br /><a href="http://tech.nitoyon.com/blog/2008/01/as3query_alpha.html">JQuery in ActionScript: as3Query </a><br />This is really awesome but the thing that really pulls me back is it's still written in compiled ActionScript, it would be really nice if something like this could be rendered from a dynamically. This opens my mind to a few things for Wrapper but not really with this implementation. <br /><br /><a href="http://blog.haxe.org/entry/33">Physaxe: Haxe Physics Engine </a><br />Pretty nice, it visually seems faster then anything else I have seen but testing would have to be done to prove that. But pretty impressive for realtime flash stuff. <br /><br /><br />I also have to add, I've been working in <a href="http://www.adobe.com/go/flex/" title="Adobe Flex" rel="homepage" target="_blank" class="zem_slink">Flex</a> a lot and I don't agree with the component architecture or the size of the framework. My biggest gripe is that it promotes the creation of projects that have more code than is comprehensible and requires a developer to trust the structure to much. To many things are automatically done for you without very much control for overriding or restructuring. It's all or nothing and the whole thing is big and slow. But also take into account that I still use it because there are some nice things about it too.<div id="zemanta-pixie" style="margin: 5px 0pt; width: 100%;"><a id="zemanta-pixie-a" href="http://www.zemanta.com/" title="Zemified by Zemanta"><img id="zemanta-pixie-img" src="http://img.zemanta.com/pixie.png?x-id=be7c453e-be8d-4338-8be5-f270d4250249" style="border: medium none ; float: right;"></a></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-6000817707727634327?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-54622782207457630402008-01-02T15:03:00.000-08:002008-01-02T15:13:23.754-08:00Tyler Larson's Quick Start GuideWrapper is a new technology that overlays your HTML web page, enabling your content to render consistently in all browsers, while adding the features of the Flash Player (think anything that can be done with Flash, Flex, and ActionScript) to any part of your HTML and CSS. <br /><br />How is this possible? We've created an HTML/CSS browser that runs in the Flash Player. After your standard HTML page has loaded, the contents are taken over and rendered within Wrapper --this is the key to cross-browser consistency. Even more exciting is what can be done in Wrapper to enhance your page. <br /><br />Wrapper is based on standard XHTML and CSS, but you can also add logic to your Wrapper page with scripts, by calling JavaScript Object Notation (JSON) methods, and using runtime-loaded plugins written in ActionScript 3. Most of Wrapper's features are tied directly to how HTML and CSS render in every modern browser but now you can add some exciting, enhanced features such as: filters, custom fonts, blend modes, custom shapes, gradient fills --and so much more. <br /><br />So how do I get started? <br />Just open any text editor and make something like this.<br/><br /><pre><br />&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;<br />&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;<br /> &lt;head&gt;<br /> &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html&quot; charset=&quot;utf-8&quot; /&gt;<br /> &lt;title&gt;main&lt;/title&gt;<br /> &lt;link rel=&quot;stylesheet&quot; href=&quot;main.css&quot; type=&quot;text/css&quot; /&gt;<br /> &lt;script type=&quot;text/javascript&quot; src=&quot;http://0in1.com/wrapper.js&quot;&gt;&lt;/script&gt;<br /> &lt;/head&gt;<br /> &lt;body id=&quot;wrapper&quot; onload=&quot;wrapper(&#x27;http://0in1.com&#x27;);&quot;&gt;<br /> &lt;div id=&quot;box&quot;&gt;<br /> &lt;p&gt;Hello World!&lt;/p&gt;<br /> &lt;/div&gt;<br /> &lt;/body&gt;<br />&lt;/html&gt;<br /></pre><br />and save this document as index.html<br /><br />Then make a new document called main.css and make something like this inside:<br /><pre><br />/* hide from ie on mac \*/<br />html { height: 100%; }<br />/* end hide */<br />body {<br /> margin: 0; padding: 0; height: 100%;<br /> background-color: #0099FF;<br />}<br />#box {<br /> left: center;<br /> width: 600px;<br /> height: 50%;<br /> background-color: #FF9900;<br /> shape: json(&#x27;{ &quot;type&quot;:&quot;rounded&quot;, &quot;w&quot;:10 }&#x27;);<br />}<br />p {<br /> font-file: url(&quot;http://0in1.com/assets/fonts/MankSans.swf&quot;);<br /> font-family: &quot;MankSans&quot;;<br /> color: #FFFFFF;<br /> font-size: 100;<br />}<br /></pre><br />Save this and put both files into a folder on any web server (including localhost). <br />At this point we have to make a crossdomain.xml file which will allow Wrapper to read the content on you page, If you use the downloaded version of Wrapper you wont need this. To make this go back to your text editor and create a new file named crossdomain.xml and place this inside.<br /><pre><br />&lt;?xml version=&quot;1.0&quot;?&gt;<br />&lt;cross-domain-policy&gt;<br /> &lt;allow-access-from domain=&quot;0in1.com&quot; /&gt;<br />&lt;/cross-domain-policy&gt;<br /></pre><br />All done, just navigate to that location on your server and you should see what you've made. If everything worked you should see "Hello World" inside of a orange box with rounded corners inside a blue box. It's a simple example, but you can see how easy it is to use custom shapes and fonts. Adding more complex interaction or creating an AJAX style application is not much more difficult.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-5462278220745763040?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-10321213091142224612007-10-27T13:50:00.001-07:002007-10-27T14:09:35.890-07:00How to call a class that you haven't imported.There was a post on the FlashCodersNY mailing list that was asking about how to access code that you dont have scope to. There are a few ways to do this but in general if you are having this problem it might be a sign that you application is not build the way that it should be. Unless you are doing something dynamic I suggest passing scope or importing an actual reference.<br /><br /><span style="font-size:130%;">Step 1,</span><br />Import your class and make a reference to it. The import statement itself will not compile your class into your swf. If you never reference it, the compiler will simply take it out to make your swf smaller.<br /><pre><br />package {<br />import com.project.Class1; // your import<br />public class Main {<br /> private var class1:Class1; // the reference<br />}<br />}<br /></pre><br /><span style="font-size:130%;">Step 2,</span><br />In a different class you can then get access to Class1 by using getDefinition();<br /><pre>var class1:Class = ApplicationDomain.currentDomain.getDefinition( "com.project.Class1" ) as Class; </pre><br />Here is a full example, <a href="http://flashcodersny.org/examples/getDefinition.zip">source code can also be downloaded here.</a><br />// Document class<br /><pre>package {<br />import flash.display.Sprite;<br />import com.project.Class1; // we will import this here<br />import com.project.Class2;<br />public class Main extends Sprite {<br /> private var class1:Class1; // And then give reference to it so that this class is compiled into the swf<br /> public function Main() {<br /> var class2:Class2 = new Class2();<br /> }<br />}<br />}<br /><br />// class that is not included in<br />package com.project {<br />public class Class1 {<br /> public function Class1() {<br /> trace("class1");<br /> }<br />}<br />}<br /><br />package com.project {<br />import flash.system.ApplicationDomain;<br />public class Class2 {<br /> public function Class2() {<br /> var class1:Class = convertStringToClass("com.project.Class1");<br /> new class1();<br /> trace("class2");<br /> }<br /> public function convertStringToClass( className:String ) : Class {<br /> return ApplicationDomain.currentDomain.getDefinition( className ) as Class;<br /> }<br />}<br />}<br /></pre><br /><br />You dont need to use ApplicationDomain to make this work but you can learn more why you might need this from the links below.<br /><br />I've also added links to other similar actionScript 3 methods with similar function.<br /><br />About ApplicationDomain<br />http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/ApplicationDomain.html#getDefinition()<br />and a little more<br />http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00000327.html<br /><br />and other package.utils functions<br />http://livedocs.adobe.com/flex/2/langref/flash/utils/package.html<br /><br />getDefinition()<br />Gets a public definition from the specified application domain. The definition can be that of a class, a namespace, or a function.<br /><br />describeType()<br />Produces an XML object that describes the ActionScript object named as the parameter of the method. This method implements the programming concept of reflection for the ActionScript language.<br /><br />getDefinitionByName()<br />Returns a reference to the class object of the class specified by the name parameter.<br /><br />getQualifiedClassName()<br />Returns the fully qualified class name of an object.<br /><br />getQualifiedSuperclassNam()<br />Returns the fully qualified class name of the base class of the object specified by the value parameter.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-1032121309114222461?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-88951257435201353872007-10-27T13:50:00.000-07:002007-10-27T13:57:02.292-07:00How to call a class that you haven't imported.There was a post on the FlashCodersNY mailing list that was asking about how to access code that you dont have scope to. There are a few ways to do this but in general if you are having this problem it might be a sign that you application is not build the way that it should be. Unless you are doing something dynamic I suggest passing scope or importing an actual reference.<br /><br /><span style="font-size:130%;">Step 1,</span><br />Import your class and make a reference to it. The import statement itself will not compile your class into your swf. If you never reference it, the compiler will simply take it out to make your swf smaller.<br /><pre><br />package {<br /> import com.project.Class1; // your import<br /> public class Main {<br /> private var class1:Class1; // the reference<br /> } <br />}<br /></pre><br /><span style="font-size:130%;">Step 2,</span><br />In a different class you can then get access to Class1 by using getDefinition();<br /><pre>var class1:Class = ApplicationDomain.currentDomain.getDefinition( "com.project.Class1" ) as Class; </pre><br />Here is a full example, source code can also be downloaded here.<br />// Document class<br /><pre>package {<br /> import flash.display.Sprite;<br /> import com.project.Class1; // we will import this here<br /> import com.project.Class2;<br /> public class Main extends Sprite {<br /> private var class1:Class1; // And then give reference to it so that this class is compiled into the swf<br /> public function Main() {<br /> var class2:Class2 = new Class2(); <br /> } <br /> } <br />}<br /><br />// class that is not included in<br />package com.project {<br /> public class Class1 {<br /> public function Class1() {<br /> trace("class1"); <br /> } <br /> } <br />}<br /><br />package com.project {<br /> import flash.system.ApplicationDomain;<br /> public class Class2 {<br /> public function Class2() {<br /> var class1:Class = convertStringToClass("com.project.Class1");<br /> new class1();<br /> trace("class2"); <br /> }<br /> public function convertStringToClass( className:String ) : Class {<br /> return ApplicationDomain.currentDomain.getDefinition( className ) as Class; <br /> } <br /> } <br />}<br /></pre><br /><br />You dont need to use ApplicationDomain to make this work but you can learn more why you might need this from the links below.<br /><br />I've also added links to other similar actionScript 3 methods with similar function.<br /><br />About ApplicationDomain<br />http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/ApplicationDomain.html#getDefinition()<br />and a little more<br />http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00000327.html<br /><br />and other package.utils functions<br />http://livedocs.adobe.com/flex/2/langref/flash/utils/package.html<br /><br />getDefinition()<br />Gets a public definition from the specified application domain. The definition can be that of a class, a namespace, or a function.<br /><br />describeType()<br />Produces an XML object that describes the ActionScript object named as the parameter of the method. This method implements the programming concept of reflection for the ActionScript language.<br /><br />getDefinitionByName()<br />Returns a reference to the class object of the class specified by the name parameter.<br /><br />getQualifiedClassName()<br />Returns the fully qualified class name of an object.<br /><br />getQualifiedSuperclassNam()<br />Returns the fully qualified class name of the base class of the object specified by the value parameter.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-8895125743520135387?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-48396471112362104232007-10-04T13:19:00.000-07:002007-10-04T13:27:16.881-07:00Problems no one hasI've been getting this error in an all AS3 project and am not sure what to do about it.<br /><br />"Warning: An ActionScript 1.0/2.0 SWF file has loaded an ActionScript 3.0 SWF; code in the ActionScript 3.0 SWF will not run."<br /><br />I've googled and nothing come up, I'm doing something that is very tricky but I'm afraid I've found a bug in the flash player and I dont really what is causing it or what I could report. It must have something to do with,<br />ApplicationDomain.currentDomain.getDefinition( myclass )<br /><br />If I can isolate it more I post more about it but it's messing me up.<br /><br />if anyone knows anything let me know, thanks<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-4839647111236210423?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com9tag:blogger.com,1999:blog-18326372.post-30988041316045220212007-08-22T21:55:00.000-07:002007-08-22T22:09:59.870-07:00I've been thinking about <a href="http://www.smashingmagazine.com/2007/08/21/creativity-spark-from-masters-of-graphic-design/">this post</a> in relation to flash and websites and the lack of detail that most websites have. I spend most of my time laying out boxes and dealing with functional things that I dont make many things this rich in detail. I've seen a few things that have tried but the thing that sicks in my mind from the post is how so many print designers are trying so hard to push the idea of motion and energy into things that are flat. The great thing about flash is that you can make these things move and animate, the thing that is difficult is to make this animation this perfected, dynamic and rich. Some would say that doing it on the timeline is where it is at but I feel like I need to write some classes to dynamically create this type of effect to any element on any event. Imagine you click submit and rather then getting a progress bar you get a sparking explosion of light and graphs. All it is doing is distracting the user from the time that it is taking to save what they have submitted but why not use this time to impress them with visuals. I've been making flash sites for a long time and the thing that sells is this stuff, some would argue that it is annoying but it is also the same thing that gets people hooked. It's not for everything but for some audiences there is nothing better. Stay tuned!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-3098804131604522021?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-55102719850219664492007-08-15T07:20:00.000-07:002007-08-15T07:44:10.257-07:00I WON THE FLASH ON THE BEACH CONTESTI'M GOING TO FLASH ON THE BEACH!!!!!!!!!!!!<br /><br /><a href="http://flashcodersny.org/">FlashCoderNY</a> the flash group that I'm a part of has a sister group in <a href="http://www.flashbrighton.org/">FlashBrighton</a>, they are part of <a href="http://www.flashonthebeach.com/">Flash on the Beach</a> and as part of this whole thing the good people in Brighton held a contest to make an awesome banner to get tickets to the event. The New York group judged the Brighton banners and they judged ours and it turned out that I WON!!!! Here is what I made,<br /><br /><embed allowscriptaccess="true" src="http://0in1.com/clients/Contest/banner.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" height="60" width="468"></embed><br /><br />Can't say it is the greatest thing I've ever made but <a href="http://0in1.com/birthday">this birthday card for a friend</a> that I just made might be!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-5510271985021966449?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-12298974658946474942007-08-15T07:03:00.000-07:002007-08-15T07:19:22.604-07:00ActionScript 3 access movie clips like you did in AS2So the old way of getting to movieclips was kind of nice, you could just use there name and drill through things. There is now in AS3 a separation between classes and displayobjects so now you can use the dot syntax on class instances like so... this.class1.class2.class3 but you can't do the same with movie clips like you could... _root.mc1.mc2.mc3 you have to this.getChildByName("mc1").getChildByName("mc2").getChildByName("mc");<br /><br />Personally I think this isn't as great so I made this. <br /><br />Use it something like this.<br />var mc:DisplayObject = getElement("this.parent.myClip.childClip.childClip2", this);<br /><br /><pre><br />public function getElement( path:String, <br />thisElement:DisplayObjectContainer = null ) : DisplayObject {<br /> var pathArray:Array = path.split(".");<br /> var baseElement:*;<br /> <br /> if( pathArray[0] == "root" ) baseElement = target;<br /> else if( pathArray[0] == "this" ) baseElement = thisElement;<br /> else if( pathArray[0] == "parent" ) baseElement = thisElement.parent;<br /><br /> var pathObject:* = baseElement;<br /> var currentPart:int = 1;<br /> loop();<br /> function loop() : void {<br /> if( currentPart != pathArray.length ){<br /> if( pathArray[0] == "parent" ) pathObject = pathObject.parent;<br /> else pathObject = pathObject.getChildByName( pathArray[currentPart++] );<br /> loop();<br /> } <br /> }<br /> return pathObject;<br />}<br /></pre><br /><br />I was thinking adding nextSibling type calls might be nice also but this does what I wanted for now.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-1229897465894647494?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com2tag:blogger.com,1999:blog-18326372.post-75005423414494129592007-08-15T07:00:00.000-07:002007-08-15T07:03:24.859-07:00ActionScript 3 Search through the display list for somethingSearch through the display list and return the first movie clip with this name. it helps if your names are all unique. <br /><br /><pre><br />public function getElementById( n:String, c:DisplayObjectContainer = null ) : DisplayObject {<br /> if( c == null ) { c = target; }<br /> var returnValue:DisplayObject;<br /> if( c.name == n ){<br /> returnValue = target;<br /> }else{<br /> if( c.getChildByName( n ) ) { returnValue = c.getChildByName( n ); }<br /> else{ loop( n, c ); }<br /> }<br /> function loop( id:String, container:DisplayObjectContainer ) : * {<br /> for (var i:uint=0; i < container.numChildren; i++) {<br /> const child:* = container.getChildAt(i);<br /> if( container.getChildAt(i) is DisplayObjectContainer ) {<br /> if( child.getChildByName( id ) ){ returnValue = child.getChildByName( id ); break; }<br /> else{ loop( id, DisplayObjectContainer(child) ); }<br /> }<br /> <br /> }<br /> }<br /> return returnValue;<br />}<br /></pre><br /><br />Search through the display list and return the object.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-7500542341449412959?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-41379935077639358322007-06-29T12:43:00.001-07:002007-06-29T12:43:32.031-07:00I spoke at the NYC PHP group last nightI went to the NYC PHP meeting last night at IBM thinking that I was going to hear someone else talk about the state of flash/flex/actionscript/RIA's and so on but the guy didn't show up. People started asking questions to the host and I knew all the answers, they asked me up the the podium and I ended up giving the lecture about flex and it's advantages over other technologies. I didn't have anything prepared and I'm not the biggest fan of flex but I think I gave everyone a pretty good understanding of what it is all about. <br /><br />It was the first time I had been to there meeting, they are a very smart bunch. I meet the head IT guy at the MOMA and the head IT guy at rhizome.org they where both into Ruby and we had a good conversation about technology based art.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-4137993507763935832?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-4845304790915012162007-05-07T14:56:00.000-07:002007-05-22T22:10:51.057-07:00AS3 animation classesI've been looking into animation classes in actionscript 3. Animation is one of those key parts of flash that and as soon as you make the choice on what package to go with the code gets ingrained into everything you make and isn't always easy to switch. There are many options but most of it is just syntax choices, some of them have extra features but basically much of the work was already done in AS2. Here is what I've come across so far. <br /><br /><h2><a href="http://code.google.com/p/tweener/">Tweener</a>, the new incarnation of <a href="http://hosted.zeh.com.br/mctween/">MCtween</a></h2><br />This is an example of doing a tween on various objects and calling function when it is done.<br /><pre><br />Tweener.addTween(<movieclip>, <textfield>, {alpha:0, time:1, onComplete:disappear});<br />function disappear() : void {<br /> this._visible = false;<br />};<br /></pre><br />If you like to put everything on one line and writing your objects short hand this system is really great. I prefer this in most cases but keep in mind that AS3 runs faster if you define everything and it is bad oop if your objects are not reusable. Besides this I love it especially the papervision demos.<br /><br />If you are into writing everything out, this next package seems to do pretty much all the same things. <br /><br /><h2><a href="http://www.boostworthy.com/blog/?p=158">Animation System</a></h2><br />The syntax for writing things out makes a lot more since in terms of code structure because everything is defined but because of this you are also limited and have to define your objects first in this way. In terms of code this is a lot cleaner but with the work that I do, the less lines of code that I have to write the happier I am. One of the coolest things in this package is the way that you can simulate a timeline. Both of these things are in beta, tweener is available now and the Animation System should be available soon.<br /><br />But this is not it there are many more, the <a href="http://www.alex-uhlmann.de/flash/animationpackage/ap3/index.htm">Animation Package</a> is being ported over from actionscript 2. I haven't seen any changes from the old set up but basically it's strength is in the more complex prepackaged effects, things like delay. The other big part of this package is shape morphing with something they call the supper shape. All this is wicked cool for certain things but the internals of how it gets these things to work is a little scary to me. Personally I want a tween class to just take an object and move it to the new location. The animation package does a lot of manipulations to the objects themselves and some times makes it hard to figure out what is going on. Maybe this was just me, like I say, this is a really powerful system with lots of features.<br /><br />Then there is the much hyped,<br /><h2>The Flash IDE "copy to actionscript" xml Animator stuff</h2><br />The thing to keep in mind about all this is that it was made for people that have to use the flash timeline. When they then need to turn that timeline into code you use this stuff. If you can write code there are way better ways to do all this and it is only better if you can't get away from the time line. It is limited to what you can do on a timeline and the xml is verbose and not for reediting. Here is a sample of one object moving from one position to another.<br /><pre><br />import fl.motion.Animator;<br />var target_mc_xml:XML = <Motion duration="20" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*"><br /> <source><br /> <Source frameRate="30" x="50" y="75" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="source_mc"><br /> <dimensions><br /> <geom:Rectangle left="0" top="0" width="100" height="100"/><br /> </dimensions><br /> <transformationPoint><br /> <geom:Point x="0" y="0"/><br /> </transformationPoint><br /> </Source><br /> </source><br /><br /> <Keyframe index="0" tweenSnap="true" tweenSync="true"><br /> <tweens><br /> <SimpleEase ease="0"/><br /> </tweens><br /> </Keyframe><br /><br /> <Keyframe index="19" x="100"/><br /></Motion>;<br /><br />var target_mc_animator:Animator = new Animator(target_mc_xml, target_mc);<br />target_mc_animator.play();<br /></pre><br /><br /><br />Adobe has also made the mx.effects.Tween package. It is the same thing as the old set up except but with a few add ons like arrays of properties and values.<br /><pre><br />var myTween:Tween = new Tween(_circle, [_circle.x, _circle.y], [275, 200], 1000, 31);<br /></pre><br /><br />And externally putting the event handlers and easing functions. <br /><pre><br />myTween.easingFunction = Elastic.easeOut;<br />myTween.setTweenHandlers(updateTween, endTween);<br /></pre><br /><br /><br />So this is what we have, I dont know if any of it is blowing me away. Maybe it is that I'm just missing <a href="http://www.mosessupposes.com/Fuse/">Fuse</a>. Moses (the guy behind Fuse) has been back and forth about what is going to happen to Fuse but last time he came to <a href="http://flashcodersny.org">FlashCodersNY</a> he said he had been working on a few things and will most likely commit to completing a AS3 version (but no pressure). <br /><br />So from here I think I'll have to go with Tweener. I like the way you can extended it to use any property and the way that it handles curves. But I'm having a hard time embracing these different system and will most likely change a few times in hopes for something that gives a little more.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-484530479091501216?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-55927651981802758452007-05-05T15:33:00.000-07:002007-05-07T18:30:43.065-07:00Tweening in papervisionI have been messing with <a href="http://www.papervision3d.org/">Papervision</a> ( it is awesome ) but to my disappointment, there is no tween engine(which is understandable). Papervision is all about getting your 3d models into flash and creating your 3d world. This is huge and they need lots of praise but now that you have all these 3d things in here we need to do something with them. Most people are just doing enterframes with math equations to have things move around. This is perfect for games and things that always need to be moving but I'm more inclined to impress and then pause everything to let it soak in. To do this we need a tween class. In AS2 by far my favorite is <a href="http://www.mosessupposes.com/Fuse/">Fuse</a> but the AS3 version is not ready yet, so people have been using <a href="http://labs.zeh.com.br/blog/?p=104">Tweener</a> with Papervision. I have to say it has some really nice features and is written quite well. The coolest thing is bezier tweens (basicly curve to a new position). This is huge in a 3d word, giving you the ability to do things like fly throughs.<br /><pre><br />camera.x = -1200;<br />camera.y = 1500;<br />camera.z = -1650;<br /><br />// Target moves on the path first<br />camera.target.x = -1200;<br />camera.target.y = 1500;<br />camera.target.z = -1650;<br />Tweener.addTween(camera.target, {x:200, y:350, z:325,<br />_bezier:[{x:1725, y:75, z:950}, {x:-161, y:305, z:674}],<br />time:10, transition:"linear"});<br /><br />// Animate camera position<br />Tweener.addTween(camera, {x:200, y:350, z:325,<br />_bezier:[{x:1725, y:75, z:950}, {x:-161, y:305, z:674}],<br />time:10, delay:0.5, transition:"linear"});<br /><br /></pre>Pretty cool. I'm trying to put some demos together to show at the flash meeting but I'll post something when I have it. Also to note I like how Tweener deals with events and special properties, it is very flexible.<br /><pre><br /></pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-5592765198180275845?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com1tag:blogger.com,1999:blog-18326372.post-69320972487228367552007-05-03T22:56:00.000-07:002007-05-04T09:12:26.279-07:00Undocumented ActionScript 3One of the things that I hung my hat on for a while in ActionScript 2 was this class for drawing boxes with corners of any radius. In ActionScript 3, they happen to have such a function built in but they don't like to talk about it. Apparently, it is used by some component in Flex but is not in any of their documentation. Doing searches might bring up some old beta syntax but this is the final:<br /><br />displayObject.graphics.drawRoundRectComplex( x, y, width, height, tl-corner, tr-corner, br-corner, bl-corner );<br /><br />Works great, and all in one line! I can't even begin to tell you how complicated my AS2 one was. Here is a full example:<br /><pre>var element:Sprite = new Sprite();<br />element.graphics.beginFill( 0xFF3300, 100 );<br />element.graphics.drawRoundRectComplex( 10, 10, 100, 100, 5, 10, 5, 0 );<br />element.graphics.endFill();<br />addChild(element);<br /><br /></pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-6932097248722836755?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com3tag:blogger.com,1999:blog-18326372.post-58780362777987472622007-05-03T22:34:00.000-07:002007-05-04T11:58:35.205-07:00I love DENGIn 2002, Claus Wahlers started a project called <a href="http://deng.com.br/examples/">DENG</a> to attempt to render standards-based HTML inside of Flash. At this time, ActionScript 1 was still in full swing and, until recently, has stayed that way. I talked to him a few weeks ago, and he is working on a new version in ActionScript 3. Of course, he talks about the speed increases as being incredible, but I hope this isn't going to take 5 more years. In AS1, he has support for almost full CSS3 (which none of the browsers yet do), XHTML, SVG, XForms, XFrames, and a little <a href="http://www.w3.org/AudioVideo/">SMIL</a>. This is out of this world and I wish him all the luck fixing this stuff up; I wish I had more time to help him out.<br /><br /><a href="http://www.w3.org/AudioVideo/">SMIL</a>, for the people who don't know, is a W3C standard markup language created and used by the video player companies who put out things like QuickTime and Real Player. It is much like Fuse, except in markup form, and has way more features. Basically, it is a language to create animations in a linear fashion, interactively --and it's wicked powerful. I would love to one day have something like this in Flash.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-5878036277798747262?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-2902151420317042552007-05-03T22:18:00.000-07:002007-05-04T11:57:36.037-07:00Why are more people not talking aboutWhile I was at GoRuCo (see post below) I was talking to some people at Google, and Flash came up. I was talking to them about where I think things are going and brought up <a href="http://www.mozilla.org/projects/tamarin/faq.html">Tamarin, the new Adobe/Mozilla version of Spider Monkey, a 4th generation edition of ECMAScript, which is basically just open source ActionScript</a>. This is a dream come true for so many people, and will open up the doors for many things to happen but no one is talking about it! -- for instance these people at Google hadn't even known about it. It is supposed to be ready next year, which sure is a long time, but, realistically, Microsoft will be pumping us lies for at least that long before any of that new Silverlight s**t comes out. Not to mention all the things that Firefox is also working on: hardware rendering, off-line browsing, etc. The internet will change drastically and you can forget about rounded corners being the most complicated thing you've made on your website.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-290215142031704255?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-11125991161547363432007-05-03T21:58:00.000-07:002007-05-04T09:14:09.700-07:00GORUCO Gotham Ruby ConferenceA week or so ago I was the <a href="http://www.goruco.com/">Gotham Ruby Conference</a>. It was lots of fun and I learned many things but I feel like the Ruby community is missing the point a little bit. Most of the presenters were way too aimlessly esoteric. The highlights were <a href="http://jruby.sourceforge.net/">JRuby</a> which isn't really ready and some VoIP stuff. But I think the best part of the gig was Google.<br /><br />Google hooked them up with everything and more. My favorite part was the cereal vending machines. All food is free at Google but that isn't even the point --evidently, they have a whole system of making sure everyone has what they could ever want, before they could even dream of having it! If I didn't have things together over here I would love to work there...<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-1112599116154736343?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0tag:blogger.com,1999:blog-18326372.post-66664737004723671372007-05-03T21:41:00.001-07:002007-05-07T18:32:18.146-07:00AJAX is dumbThe deal with AJAX is, that JavaScript is so far behind that you need huge libraries to do anything good. One of the things they always make are auto-updating search boxes where they search the database as you type. Here is the same thing in Flash, but without the 180K of Prototype and Scriptaculous. I know you can compress it down but this will compile down to about 4k but maybe a little bigger depending on what kind of button you have. I do make HTML sites, but some of these examples are just crazy.<br /><br /><pre><br />var samples:Array = ["suggestion1", "suggestion2", "suggestion3"];<br /><br />var myString:String = samples[random(samples.length)];<br /><br />var inField:Boolean = false;<br /><br />var loader:LoadVars = new LoadVars();<br /><br />var txt:TextField; // the search box<br />var suggestedTxt:TextField;<br />txt.text = myString;<br />txt.onSetFocus = function(){<br />if( this.text == myString ){<br />this.text = ""; inField = true;<br />}<br />}<br />txt.onKillFocus = function(){ if(this.text == ""){<br />myString = samples[random(samples.length)];<br />inField = false; this.text = myString; }<br />}<br /><br />var btn:MovieClip;<br />btn.onRollOver = function(){ this.gotoAndStop(2); }<br />btn.onRollOut = function(){ this.gotoAndStop(1); }<br />btn.onRelease = function(){<br />getURL( "/search.php?query="+txt.text );<br />}<br /><br />var keyListener = new Object();<br />keyListener.onKeyDown = function(){<br />if( Key.getCode() == Key.ENTER &&amp; txt.text != myString &&amp; txt.text != "" ){<br />getURL("/contact/search/?query="+txt.text);<br />}else if( inField ){<br />loader.onLoad = function(){<br /> // this is the response from the server<br /> _root.suggestedTxt.text = this;<br />}<br />loader.load( "/search.php?query=" + txt.text );<br />}<br />};<br />Key.addListener(keyListener);<br /></pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-6666473700472367137?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com3tag:blogger.com,1999:blog-18326372.post-82041988074285586202007-03-20T09:20:00.000-07:002007-05-07T18:31:30.486-07:00The Apollo public alphaAdobe's Apollo came out yesterday, which is similar to many other tools already out there ( <a href="http://www.multidmedia.com/">Zinc</a>, <a href="http://www.screentime.com/software/mprojector/">mProjector</a>, <a href="http://osflash.org/screenweaver">screenwaver</a>, etc. ). I've spent some time making a few applications and felt it needed some attention. So what is the difference between these and why is this something to care about?<br /><br />The main point is that Adobe made it and because of that there are simpler implementations of things that are rather complex in many of the other products and it does a few things they can't. Most of the other ones work by sending things out of <a href="http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary372.html">FScommand</a>, but have limited ways of receiving things back from the system. Their set up is usually based on add-ons or fitting things into what Adobe has already made but with apollo they seem to much more closely tried system level processes with actionscript then the other projector tools that I've used.<br /><br />In short, because Adobe has control of their technology they have not only added ways to talk to things outside of flash but given control elements inside of your swf from the outside. They have a much more basic functionality in terms of system control then the others do but most projects only need basic system level control.<br /><br />What does Apollo have that these others don't?<br />Apollo is way more then these other projector type applications, Apollo has 4 main parts: window controls, file system controls, calling scripts ( which is what the others do ), and combining the different web technologies together (html/javascript and flash).<br /><br />This last part is the kicker.<br />var htmlView:HTMLControl = new HTMLControl();<br />You now have an element in side of your swf that can load an html page, then with javascript like you normally do or actionscript you can manipulate this element like any other movieclip on your stage.<br /><br />// from an apollo application open a new window and add a html element to it.<br /><br />package {<br /> import flash.display.Sprite;<br /> import flash.html.HTMLControl;<br /> import flash.net.URLRequest;<br /> import flash.display.NativeWindow;<br /> import flash.display.NativeWindowInitOptions;<br /> import flash.display.NativeWindowSystemChrome;<br /><br /> public class Main extends Sprite<br /> {<br /> public function Main()<br /> {<br /> // window options<br /> var options:NativeWindowInitOptions = new NativeWindowInitOptions();<br /> options.systemChrome = NativeWindowSystemChrome.STANDARD;<br /> options.transparent = false;<br /> <br /> var newWindow:NativeWindow = new NativeWindow(false, options);<br /> newWindow.title = "Hey cool.";<br /> newWindow.width = 800;<br /> newWindow.height = 600;<br /> newWindow.visible = true;<br /> <br /> //newWindow is a NativeWindow instance<br /> var htmlView:HTMLControl = new HTMLControl();<br /> htmlView.width = newWindow.width;<br /> htmlView.height = newWindow.height;<br /> <br /> //set the stage so display objects are added to the top-left and not scaled<br /> newWindow.stage.align = "TL";<br /> newWindow.stage.scaleMode = "noScale";<br /> newWindow.stage.addChild( htmlView );<br /> <br /> //set exposeRuntime=true to allow JavaScript on the page to reference ActionScript classes<br /> htmlView.exposeRuntime = true;<br /> <br /> //urlString is the URL of the HTML page to load<br /> var urlReq:URLRequest = new URLRequest("http://www.listenerinteractive.com/");<br /> htmlView.load(urlReq);<br /><br /> }<br /> }<br />}<br /><br />This was my first application and I'll write more about this soon, but this very simple small thing is the start of something very big in my mind.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-8204198807428558620?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com2tag:blogger.com,1999:blog-18326372.post-61158871641650423862007-03-20T09:14:00.000-07:002007-03-20T09:16:26.881-07:00startI've opened many accounts around the internet but few of them I do anything with. This is one of them but I'm going to start posting. Mark my words today is the beginning.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18326372-6115887164165042386?l=talltyler.blogspot.com'/></div>tylerhttp://www.blogger.com/profile/05243631841038669176noreply@blogger.com0